Homepage: <http://handbrake.m0k.org/>.
It may be used under the terms of the GNU General Public License. */
-#include <Cocoa/Cocoa.h>
+#import <Cocoa/Cocoa.h>
+#import <Growl/Growl.h>
#include "hb.h"
-#include "ScanController.h"
-#include "PictureController.h"
-#include "QueueController.h"
+#import "ChapterTitles.h"
+#import "PictureController.h"
+#import "HBQueueController.h"
+#import "MVMenuButton.h"
+#import "HBAdvancedController.h"
+#import "HBPreferencesController.h"
-@interface HBController : NSObject
+@class HBOutputPanelController;
+
+@interface HBController : NSObject <GrowlApplicationBridgeDelegate>
{
IBOutlet NSWindow * fWindow;
-
- /* Scan panel */
- IBOutlet ScanController * fScanController;
- IBOutlet NSPanel * fScanPanel;
-
+ NSToolbar * toolbar;
+
/* Picture panel */
- IBOutlet PictureController * fPictureController;
- IBOutlet NSPanel * fPicturePanel;
-
+ PictureController * fPictureController;
+
+ /* Advanced options tab */
+ HBAdvancedController * fAdvancedOptions;
+ IBOutlet NSBox * fAdvancedView;
+
+ HBPreferencesController * fPreferencesController;
+
/* Queue panel */
- IBOutlet QueueController * fQueueController;
- IBOutlet NSPanel * fQueuePanel;
- IBOutlet NSButton * fQueueCheck;
- IBOutlet NSButton * fQueueAddButton;
- IBOutlet NSButton * fQueueShowButton;
-
+ HBQueueController * fQueueController;
+ IBOutlet NSTextField * fQueueStatus;
+
+ /* Output panel */
+ HBOutputPanelController *outputPanel;
+
/* Source box */
- IBOutlet NSTextField * fSrcDVD1Field;
+ IBOutlet NSProgressIndicator * fScanIndicator;
+ NSString * sourceDisplayName;
IBOutlet NSTextField * fSrcDVD2Field;
IBOutlet NSTextField * fSrcTitleField;
IBOutlet NSPopUpButton * fSrcTitlePopUp;
IBOutlet NSPopUpButton * fSrcChapterEndPopUp;
IBOutlet NSTextField * fSrcDuration1Field;
IBOutlet NSTextField * fSrcDuration2Field;
-
+
/* Destination box */
IBOutlet NSTextField * fDstFormatField;
- IBOutlet NSPopUpButton * fDstFormatPopUp;
+ IBOutlet NSPopUpButton * fDstFormatPopUp;
+ IBOutlet NSButton * fDstMpgLargeFileCheck;
IBOutlet NSTextField * fDstCodecsField;
IBOutlet NSPopUpButton * fDstCodecsPopUp;
IBOutlet NSTextField * fDstFile1Field;
IBOutlet NSTextField * fDstFile2Field;
IBOutlet NSButton * fDstBrowseButton;
-
+
/* Video box */
IBOutlet NSTextField * fVidRateField;
IBOutlet NSPopUpButton * fVidRatePopUp;
IBOutlet NSSlider * fVidQualitySlider;
IBOutlet NSButton * fVidGrayscaleCheck;
IBOutlet NSButton * fVidTwoPassCheck;
-
+ IBOutlet NSButton * fVidTurboPassCheck;
/* Picture Settings box */
IBOutlet NSTextField * fPicLabelSettings;
IBOutlet NSTextField * fPicLabelSrc;
IBOutlet NSTextField * fPicLabelOutp;
IBOutlet NSTextField * fPicLabelAr;
- IBOutlet NSTextField * fPicLabelDeinter;
IBOutlet NSTextField * fPicLabelSrcX;
IBOutlet NSTextField * fPicLabelOutputX;
+ IBOutlet NSTextField * fPicLabelAutoCrop;
+ IBOutlet NSTextField * fPicLabelDetelecine;
+ IBOutlet NSTextField * fPicLabelDeinterlace;
+ IBOutlet NSTextField * fPicLabelDenoise;
IBOutlet NSTextField * fPicSrcWidth;
IBOutlet NSTextField * fPicSrcHeight;
IBOutlet NSTextField * fPicSettingWidth;
IBOutlet NSTextField * fPicSettingHeight;
+ IBOutlet NSTextField * fPicSettingDeinterlace;
IBOutlet NSTextField * fPicSettingARkeep;
IBOutlet NSTextField * fPicSettingPAR;
- IBOutlet NSTextField * fPicSettingDeinterlace;
- IBOutlet NSTextField * fPicSettingARkeepDsply;
- IBOutlet NSTextField * fPicSettingPARDsply;
- IBOutlet NSTextField * fPicSettingDeinterlaceDsply;
+ IBOutlet NSTextField * fPicSettingAutoCrop;
+ IBOutlet NSTextField * fPicSettingDetelecine;
+ IBOutlet NSTextField * fPicSettingDenoise;
+
IBOutlet NSTextField * fPicLabelAnamorphic;
- IBOutlet NSTextField * fPicLabelPAROutp;
IBOutlet NSTextField * fPicLabelPAROutputX;
IBOutlet NSTextField * fPicSettingPARWidth;
IBOutlet NSTextField * fPicSettingPARHeight;
-
-
+ /* Picture variables */
+ int PicOrigOutputWidth;
+ int PicOrigOutputHeight;
+ int AutoCropTop;
+ int AutoCropBottom;
+ int AutoCropLeft;
+ int AutoCropRight;
/* Subtitles box */
IBOutlet NSTextField * fSubField;
IBOutlet NSPopUpButton * fSubPopUp;
-
+ IBOutlet NSButton * fSubForcedCheck;
+
/* Audio box */
IBOutlet NSTextField * fAudLang1Field;
IBOutlet NSPopUpButton * fAudLang1PopUp;
- IBOutlet NSButton * fAudLang1SurroundCheck;
IBOutlet NSTextField * fAudLang2Field;
IBOutlet NSPopUpButton * fAudLang2PopUp;
- IBOutlet NSTextField * fAudRateField;
+ /* New Audio Mix PopUps */
+ IBOutlet NSTextField * fAudTrack1MixLabel;
+ IBOutlet NSPopUpButton * fAudTrack1MixPopUp;
+ IBOutlet NSTextField * fAudTrack2MixLabel;
+ IBOutlet NSPopUpButton * fAudTrack2MixPopUp;
+
+ IBOutlet NSTextField * fAudRateField;
IBOutlet NSPopUpButton * fAudRatePopUp;
IBOutlet NSTextField * fAudBitrateField;
IBOutlet NSPopUpButton * fAudBitratePopUp;
-
+
+ /* Chapters box */
+ IBOutlet NSButton * fCreateChapterMarkers;
+ IBOutlet NSTableView * fChapterTable;
+ ChapterTitles * fChapterTitlesDelegate;
+
/* Bottom */
IBOutlet NSButton * fPictureButton;
IBOutlet NSTextField * fStatusField;
IBOutlet NSProgressIndicator * fRipIndicator;
- IBOutlet NSButton * fShowQuButton;
- IBOutlet NSButton * fAddToQuButton;
- IBOutlet NSButton * fPauseButton;
- IBOutlet NSButton * fRipButton;
-
- /* User Preset variables here fPresetNewPicSettingsApply*/
+ BOOL fRipIndicatorShown;
+
+ /* User Preset variables here */
IBOutlet NSDrawer * fPresetDrawer;
IBOutlet NSTextField * fPresetNewName;
- IBOutlet NSButton * fPresetNewPicSettingsApply;
+ IBOutlet NSTextField * fPresetNewDesc;
+ IBOutlet NSPopUpButton * fPresetNewPicSettingsPopUp;
IBOutlet NSTextField * fPresetSelectedDisplay;
- NSString * AppSupportDirectory;
- NSString * UserPresetsFile;
- NSString * x264ProfilesFile;
- NSMutableArray * UserPresets;
- NSMutableArray * x264Profiles;
- NSMutableArray *UserPresetssortedArray;
- NSMutableDictionary * chosenPreset;
-
-
- IBOutlet NSPanel * fAddPresetPanel;
+ NSString * AppSupportDirectory;
+ NSString * UserPresetsFile;
+ NSMutableArray * UserPresets;
+ NSMutableArray * UserPresetssortedArray;
+ NSMutableDictionary * chosenPreset;
+ int curUserPresetChosenNum;
+
+ int presetHbDefault; // this is 1 in "Default" preset key
+ int presetUserDefault;// this is 2 in "Default" preset key
+ IBOutlet NSPanel * fAddPresetPanel;
IBOutlet NSTableView * tableView;
IBOutlet NSButton * fPresetsAdd;
IBOutlet NSButton * fPresetsDelete;
+ IBOutlet MVMenuButton * fPresetsActionButton;
+ IBOutlet NSMenu * fPresetsActionMenu;
+
hb_handle_t * fHandle;
hb_title_t * fTitle;
+ /* integer to set to determine the previous state
+ of encode 0==idle, 1==encoding, 2==cancelled*/
+ int fEncodeState;
+ int currentScanCount;
+ int currentSuccessfulScanCount;
+ int SuccessfulScan;
+ NSString * currentSource;
+
+ hb_job_t * fLastKnownCurrentJob;
}
- (void) TranslateStrings;
-- (void) UpdateUI: (NSTimer *) timer;
-- (void) EnableUI: (bool) enable;
-
-- (IBAction) ShowScanPanel: (id) sender;
-
-- (IBAction) TitlePopUpChanged: (id) sender;
-- (IBAction) ChapterPopUpChanged: (id) sender;
-
-- (IBAction) FormatPopUpChanged: (id) sender;
-- (IBAction) CodecsPopUpChanged: (id) sender;
-- (IBAction) EncoderPopUpChanged: (id) sender;
-- (IBAction) Check6ChannelAACExtraction: (id) sender;
-- (IBAction) LanguagePopUpChanged: (id) sender;
-
-- (IBAction) BrowseFile: (id) sender;
-- (void) BrowseFileDone: (NSSavePanel *) sheet
+- (void) updateUI: (NSTimer *) timer;
+- (void) enableUI: (bool) enable;
+- (IBAction) showNewScan: (id) sender;
+- (IBAction) showScanPanel: (id) sender;
+- (IBAction) browseSources: (id) sender;
+- (void) browseSourcesDone: (NSOpenPanel *) sheet
returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+
+- (IBAction) titlePopUpChanged: (id) sender;
+- (IBAction) chapterPopUpChanged: (id) sender;
+
+- (IBAction) formatPopUpChanged: (id) sender;
+- (IBAction) codecsPopUpChanged: (id) sender;
+- (IBAction) encoderPopUpChanged: (id) sender;
+- (IBAction) twoPassCheckboxChanged: (id) sender;
+- (IBAction) videoFrameRateChanged: (id) sender;
+- (IBAction) setEnabledStateOfAudioMixdownControls: (id) sender;
+- (IBAction) addAllAudioTracksToPopUp: (id) sender;
+- (IBAction) selectAudioTrackInPopUp: (id) sender searchPrefixString: (NSString *) searchPrefixString selectIndexIfNotFound: (int) selectIndexIfNotFound;
+- (IBAction) audioTrackPopUpChanged: (id) sender;
+- (IBAction) audioTrackPopUpChanged: (id) sender mixdownToUse: (int) mixdownToUse;
+- (IBAction) audioTrackMixdownChanged: (id) sender;
+- (IBAction) subtitleSelectionChanged: (id) sender;
+
+- (IBAction) browseFile: (id) sender;
+- (void) browseFileDone: (NSSavePanel *) sheet
+ returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+
+- (IBAction) videoMatrixChanged: (id) sender;
+- (IBAction) qualitySliderChanged: (id) sender;
-- (IBAction) VideoMatrixChanged: (id) sender;
-- (IBAction) QualitySliderChanged: (id) sender;
+- (IBAction) showPicturePanel: (id) sender;
+- (IBAction) calculatePictureSizing: (id) sender;
+- (IBAction) openMainWindow: (id) sender;
-- (IBAction) ShowPicturePanel: (id) sender;
-- (IBAction) CalculatePictureSizing: (id) sender;
+- (IBAction) addToQueue: (id) sender;
+- (IBAction) showQueueWindow:(id)sender;
-- (IBAction) EnableQueue: (id) sender;
-- (IBAction) AddToQueue: (id) sender;
-- (IBAction) ShowQueuePanel: (id) sender;
+- (IBAction)showPreferencesWindow:(id)sender;
- (IBAction) Rip: (id) sender;
-- (void) OverwriteAlertDone: (NSWindow *) sheet
+- (void) overWriteAlertDone: (NSWindow *) sheet
returnCode: (int) returnCode contextInfo: (void *) contextInfo;
-- (void) UpdateAlertDone: (NSWindow *) sheet
+- (void) updateAlertDone: (NSWindow *) sheet
returnCode: (int) returnCode contextInfo: (void *) contextInfo;
- (void) _Rip;
- (IBAction) Cancel: (id) sender;
contextInfo: (void *) contextInfo;
- (IBAction) Pause: (id) sender;
-- (IBAction) CalculateBitrate: (id) sender;
-- (void) controlTextDidBeginEditing: (NSNotification *) notification;
-- (void) controlTextDidEndEditing: (NSNotification *) notification;
+- (IBAction) calculateBitrate: (id) sender;
- (void) controlTextDidChange: (NSNotification *) notification;
-- (IBAction) OpenHomepage: (id) sender;
-- (IBAction) OpenForums: (id) sender;
+- (IBAction) openHomepage: (id) sender;
+- (IBAction) openForums: (id) sender;
+- (IBAction) openUserGuide: (id) sender;
// Preset Methods Here
-
-- (IBAction) ShowAddPresetPanel: (id) sender;
-- (IBAction) CloseAddPresetPanel: (id) sender;
-- (NSDictionary *)CreatePreset;
-
+- (void) loadPresets;
+- (IBAction) customSettingUsed: (id) sender;
+- (IBAction) showAddPresetPanel: (id) sender;
+- (IBAction) closeAddPresetPanel: (id) sender;
+- (NSDictionary *)createPreset;
+- (NSDictionary *)createIpodLowPreset;
+- (NSDictionary *)createIpodHighPreset;
+- (NSDictionary *)createAppleTVPreset;
+- (NSDictionary *)createPSThreePreset;
+- (NSDictionary *)createPSPPreset;
+- (NSDictionary *)createNormalPreset;
+- (NSDictionary *)createClassicPreset;
+- (NSDictionary *)createQuickTimePreset;
+- (NSDictionary *)createFilmPreset;
+- (NSDictionary *)createTelevisionPreset;
+- (NSDictionary *)createAnimationPreset;
+- (NSDictionary *)createBedlamPreset;
+- (NSDictionary *)createiPhonePreset;
+- (NSDictionary *)createDeuxSixQuatrePreset;
+- (NSDictionary *)createBrokePreset;
+- (NSDictionary *)createBlindPreset;
+- (NSDictionary *)createCRFPreset;
+
+- (IBAction) revertPictureSizeToMax:(id)sender;
+
+- (IBAction)setDefaultPreset:(id)sender;
+- (IBAction)selectDefaultPreset:(id)sender;
- (void) savePreset;
-- (IBAction)addPreset:(id)sender;
+- (IBAction)addFactoryPresets:(id)sender;
+- (IBAction)deleteFactoryPresets:(id)sender;
+- (IBAction)addUserPreset:(id)sender;
+- (void)addPreset;
- (IBAction)insertPreset:(id)sender;
- (IBAction)deletePreset:(id)sender;
+- (IBAction)getDefaultPresets:(id)sender;
- (IBAction)tableViewSelected:(id)sender;
+
// NSTableDataSource methods
- (int)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView
setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex;
-
-
-
+// To determine user presets cell display properties
+- (void)tableView:(NSTableView *)aTableView
+ willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn
+ row:(int)rowIndex;
+
+// Growl methods
+- (NSDictionary *) registrationDictionaryForGrowl;
+-(IBAction)showGrowlDoneNotification:(id)sender;
+- (IBAction)showDebugOutputPanel:(id)sender;
+- (void)setupToolbar;
@end