OSDN Git Service

MacGui: "Ritsuka Bar" toolbar initial implementation
[handbrake-jp/handbrake-jp-git.git] / macosx / Controller.h
index c4abf29..be931df 100644 (file)
@@ -5,33 +5,38 @@
    It may be used under the terms of the GNU General Public License. */
 
 #include <Cocoa/Cocoa.h>
+#include <Growl/Growl.h>
 
 #include "hb.h"
 
+
+#include "ChapterTitles.h"
 #include "ScanController.h"
 #include "PictureController.h"
 #include "QueueController.h"
 
-@interface HBController : NSObject
+@class HBOutputPanelController;
+
+@interface HBController : NSObject <GrowlApplicationBridgeDelegate>
 
 {
     IBOutlet NSWindow            * fWindow;
-
+       
     /* Scan panel */
-    IBOutlet ScanController      * fScanController;
+       IBOutlet ScanController      * fScanController;
     IBOutlet NSPanel             * fScanPanel;
-
+       
     /* Picture panel */
     IBOutlet PictureController   * fPictureController;
     IBOutlet NSPanel             * fPicturePanel;
-
+       
     /* Queue panel */
     IBOutlet QueueController     * fQueueController;
     IBOutlet NSPanel             * fQueuePanel;
-    IBOutlet NSButton            * fQueueCheck;
-    IBOutlet NSButton            * fQueueAddButton;
-    IBOutlet NSButton            * fQueueShowButton;
-
+    IBOutlet NSTextField         * fQueueStatus;
+    //IBOutlet NSButton            * fQueueAddButton;
+    //IBOutlet NSButton            * fQueueShowButton;
+       
     /* Source box */
     IBOutlet NSTextField         * fSrcDVD1Field;
     IBOutlet NSTextField         * fSrcDVD2Field;
     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;
-       IBOutlet NSButton            * fCreateChapterMarkers;
-
+       
     /* Video box */
     IBOutlet NSTextField         * fVidRateField;
     IBOutlet NSPopUpButton       * fVidRatePopUp;
@@ -69,7 +74,7 @@
     IBOutlet NSSlider            * fVidQualitySlider;
     IBOutlet NSButton            * fVidGrayscaleCheck;
     IBOutlet NSButton            * fVidTwoPassCheck;
-
+    IBOutlet NSButton            * fVidTurboPassCheck;
        
        /* Picture Settings box */
        IBOutlet NSTextField         * fPicLabelSettings;
        IBOutlet NSTextField         * fPicSettingDeinterlace;
        IBOutlet NSTextField         * fPicSettingARkeepDsply;
        IBOutlet NSTextField         * fPicSettingPARDsply;
+       IBOutlet NSTextField         * fPicSettingAutoCropLabel;
+       IBOutlet NSTextField         * fPicSettingAutoCrop;
+       IBOutlet NSTextField         * fPicSettingAutoCropDsply;
        IBOutlet NSTextField         * fPicSettingDeinterlaceDsply;
        IBOutlet NSTextField         * fPicLabelAnamorphic;
        IBOutlet NSTextField         * fPicLabelPAROutp;
        IBOutlet NSTextField         * fPicLabelPAROutputX;
        IBOutlet NSTextField         * fPicSettingPARWidth;
        IBOutlet NSTextField         * fPicSettingPARHeight;
-       
+    /* Picture variables */
+       int                        PicOrigOutputWidth;
+       int                        PicOrigOutputHeight;
        
     /* Subtitles box */
     IBOutlet NSTextField         * fSubField;
     IBOutlet NSPopUpButton       * fSubPopUp;
-
+       
     /* 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 NSButton            * fAddToQuButton;
     IBOutlet NSButton            * fPauseButton;
     IBOutlet NSButton            * fRipButton;
-
-       /* User Preset variables here fPresetNewPicSettingsApply*/
+       
+       /* Advanced Tab for opts fX264optView*/
+       IBOutlet NSView              * fX264optView;
+       IBOutlet NSTextField         * fX264optViewTitleLabel;
+       IBOutlet NSTextField         * fDisplayX264OptionsLabel;
+       IBOutlet NSTextField         * fDisplayX264Options;
+       IBOutlet NSTextField         * fX264optBframesLabel;
+       IBOutlet NSPopUpButton       * fX264optBframesPopUp;
+       IBOutlet NSTextField         * fX264optRefLabel;
+       IBOutlet NSPopUpButton       * fX264optRefPopUp;
+       IBOutlet NSTextField         * fX264optNfpskipLabel;
+       IBOutlet NSButton            * fX264optNfpskipSwitch;
+       IBOutlet NSTextField         * fX264optNodctdcmtLabel;
+       IBOutlet NSButton            * fX264optNodctdcmtSwitch;
+       IBOutlet NSTextField         * fX264optSubmeLabel;
+       IBOutlet NSPopUpButton       * fX264optSubmePopUp;
+       IBOutlet NSTextField         * fX264optTrellisLabel;
+       IBOutlet NSPopUpButton       * fX264optTrellisPopUp;
+    IBOutlet NSTextField         * fX264optMixedRefsLabel;
+    IBOutlet NSButton            * fX264optMixedRefsSwitch;
+    IBOutlet NSTextField         * fX264optMotionEstLabel;
+    IBOutlet NSPopUpButton       * fX264optMotionEstPopUp;
+    IBOutlet NSTextField         * fX264optMERangeLabel;
+    IBOutlet NSPopUpButton       * fX264optMERangePopUp;
+    IBOutlet NSTextField         * fX264optWeightBLabel;
+    IBOutlet NSButton            * fX264optWeightBSwitch;
+    IBOutlet NSTextField         * fX264optBRDOLabel;
+    IBOutlet NSButton            * fX264optBRDOSwitch;
+    IBOutlet NSTextField         * fX264optBPyramidLabel;
+    IBOutlet NSButton            * fX264optBPyramidSwitch;
+    IBOutlet NSTextField         * fX264optBiMELabel;
+    IBOutlet NSButton            * fX264optBiMESwitch;
+    IBOutlet NSTextField         * fX264optDirectPredLabel;
+    IBOutlet NSPopUpButton       * fX264optDirectPredPopUp;
+    IBOutlet NSTextField         * fX264optDeblockLabel;
+    IBOutlet NSPopUpButton       * fX264optAlphaDeblockPopUp;
+    IBOutlet NSPopUpButton       * fX264optBetaDeblockPopUp;
+    
+       /* User Preset variables here fPresetNewDesc*/
        
        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;
-
+       NSString                     * AppSupportDirectory;
+       NSString                     * UserPresetsFile;
+       NSString                     * x264ProfilesFile;
+       NSMutableArray               * UserPresets;
+       NSMutableArray               * x264Profiles;
+       NSMutableArray               * UserPresetssortedArray;
+       NSMutableDictionary          * chosenPreset;
+    int                            curUserPresetChosenNum;
        
-    IBOutlet NSPanel            * fAddPresetPanel;
+    IBOutlet NSPanel             * fAddPresetPanel;
        IBOutlet NSTableView         * tableView;
        IBOutlet NSButton            * fPresetsAdd;
        IBOutlet NSButton            * fPresetsDelete;
     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;
+       NSString                      * currentSource;
+       HBOutputPanelController *outputPanel;
+       
+       BOOL                         startButtonEnabled;
+    BOOL                         pauseButtonEnabled;
+    BOOL                         AddToQueueButtonEnabled;
+       BOOL                         stopOrStart;
+       BOOL                         resumeOrPause;
 }
 
 - (void)     TranslateStrings;
 
 - (void)     UpdateUI: (NSTimer *) timer;
 - (void)     EnableUI: (bool) enable;
-
+- (IBAction) ShowNewScan: (id) sender;
 - (IBAction) ShowScanPanel: (id) sender;
 
 - (IBAction) TitlePopUpChanged: (id) sender;
 - (IBAction) FormatPopUpChanged: (id) sender;
 - (IBAction) CodecsPopUpChanged: (id) sender;
 - (IBAction) EncoderPopUpChanged: (id) sender;
-- (IBAction) Check6ChannelAACExtraction: (id) sender;
-- (IBAction) LanguagePopUpChanged: (id) sender;
+- (IBAction) TwoPassCheckboxChanged: (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) BrowseFile: (id) sender;
 - (void)     BrowseFileDone: (NSSavePanel *) sheet
 
 - (IBAction) ShowPicturePanel: (id) sender;
 - (IBAction) CalculatePictureSizing: (id) sender;
+- (IBAction) OpenMainWindow: (id) sender;
 
-- (IBAction) EnableQueue: (id) sender;
 - (IBAction) AddToQueue: (id) sender;
 - (IBAction) ShowQueuePanel: (id) sender;
 
 
 - (IBAction) OpenHomepage: (id) sender;
 - (IBAction) OpenForums:   (id) sender;
+- (IBAction) OpenUserGuide:   (id) sender;
 
-// Preset Methods Here
+// x264 Advanced Panel Methods
+- (IBAction) X264AdvancedOptionsSet: (id) sender;
+- (IBAction) X264AdvancedOptionsStandardizeOptString: (id) sender;
+- (IBAction) X264AdvancedOptionsSetCurrentSettings: (id) sender;
+- (NSString *)  X264AdvancedOptionsStandardizeOptNames:(NSString *) cleanOptNameString;
+- (IBAction) X264AdvancedOptionsChanged: (id) sender;
 
+// Preset Methods Here
+- (IBAction) CustomSettingUsed: (id) sender;
 - (IBAction) ShowAddPresetPanel: (id) sender;
 - (IBAction) CloseAddPresetPanel: (id) sender;
 - (NSDictionary *)CreatePreset;
-- (NSDictionary *)CreateIpodPreset;
-- (NSDictionary *)CreateAppleTVPreset;  
+- (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;
+- (IBAction) RevertPictureSizeToMax:(id)sender;
+
 
 - (void) savePreset;
 - (IBAction)AddFactoryPresets:(id)sender;
+- (IBAction)DeleteFactoryPresets:(id)sender;
 - (IBAction)AddUserPreset:(id)sender;
-- (IBAction)AddPreset:(id)sender;
+- (void)AddPreset;
 - (IBAction)InsertPreset:(id)sender;
 - (IBAction)DeletePreset:(id)sender;
 - (IBAction)tableViewSelected:(id)sender;
         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