OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / macosx / Controller.h
index b3c425e..c94308e 100644 (file)
@@ -10,6 +10,7 @@
 #include "hb.h"
 
 #import "ChapterTitles.h"
+#import "HBSubtitles.h"
 #import "PictureController.h"
 #import "HBPreviewController.h"
 #import "HBQueueController.h"
@@ -30,6 +31,7 @@ BOOL                        fIsDragging;
 
 @interface HBController : NSObject <GrowlApplicationBridgeDelegate>
 {
+    NSImage                      * fApplicationIcon;
     IBOutlet NSWindow            * fWindow;
 
     /* Main Menu Outlets */
@@ -42,6 +44,7 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField          * fScanSrcTitleNumField;
     IBOutlet NSButton             * fScanSrcTitleCancelButton;
     IBOutlet NSButton             * fScanSrcTitleOpenButton;
+
     
     /* Picture Settings */
     PictureController            * fPictureController;
@@ -68,10 +71,27 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField         * fSrcDVD2Field;
     IBOutlet NSTextField         * fSrcTitleField;
     IBOutlet NSPopUpButton       * fSrcTitlePopUp;
+    
+    
+    /* lib dvd nav specific */
+    IBOutlet NSTextField         * fSrcAngleLabel;
+    IBOutlet NSPopUpButton       * fSrcAnglePopUp;
+    
+    /* Source start and end points */
+    IBOutlet NSPopUpButton       * fEncodeStartStopPopUp;
+    /* pts based start / stop */
+    IBOutlet NSTextField         * fSrcTimeStartEncodingField;
+    IBOutlet NSTextField         * fSrcTimeEndEncodingField;
+    /* frame based based start / stop */
+    IBOutlet NSTextField         * fSrcFrameStartEncodingField;
+    IBOutlet NSTextField         * fSrcFrameEndEncodingField;
+    
     IBOutlet NSTextField         * fSrcChapterField;
     IBOutlet NSPopUpButton       * fSrcChapterStartPopUp;
     IBOutlet NSTextField         * fSrcChapterToField;
     IBOutlet NSPopUpButton       * fSrcChapterEndPopUp;
+    
+    /* Source duration information */
     IBOutlet NSTextField         * fSrcDuration1Field;
     IBOutlet NSTextField         * fSrcDuration2Field;
        
@@ -91,6 +111,8 @@ BOOL                        fIsDragging;
     IBOutlet NSButton            * fDstMp4iPodFileCheck;
        
     /* Video box */
+    IBOutlet NSButton            * fFrameratePfrCheck;
+    
     IBOutlet NSTextField         * fVidRateField;
     IBOutlet NSPopUpButton       * fVidRatePopUp;
     IBOutlet NSTextField         * fVidEncoderField;
@@ -126,6 +148,12 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField         * fSubField;
     IBOutlet NSPopUpButton       * fSubPopUp;
        IBOutlet NSButton            * fSubForcedCheck;
+    
+    
+    IBOutlet NSTableView         * fSubtitlesTable;
+       HBSubtitles                  * fSubtitlesDelegate;
+    IBOutlet NSButton            * fBrowseSrtFileButton;
+    
        
     /* Audio box */
     /* Track Labels */
@@ -184,6 +212,9 @@ BOOL                        fIsDragging;
     /* Chapters box */
     IBOutlet NSButton            * fCreateChapterMarkers;
     IBOutlet NSTableView         * fChapterTable;
+       IBOutlet NSButton            * fLoadChaptersButton;
+       IBOutlet NSButton            * fSaveChaptersButton;
+       IBOutlet NSTableColumn       * fChapterTableNameColumn;
        ChapterTitles                * fChapterTitlesDelegate;
        
     /* Bottom */
@@ -202,6 +233,10 @@ BOOL                        fIsDragging;
        IBOutlet NSTextField         * fPresetNewName;
        IBOutlet NSTextField         * fPresetNewDesc;
        IBOutlet NSPopUpButton       * fPresetNewPicSettingsPopUp;
+    IBOutlet NSTextField         * fPresetNewPicWidth;
+    IBOutlet NSTextField         * fPresetNewPicHeight;
+    IBOutlet NSBox               * fPresetNewPicWidthHeightBox;
+    
     IBOutlet NSButton            * fPresetNewPicFiltersCheck;
     IBOutlet NSButton            * fPresetNewFolderCheck;
        IBOutlet NSTextField         * fPresetSelectedDisplay;
@@ -217,7 +252,7 @@ BOOL                        fIsDragging;
        NSMutableDictionary          *presetUserDefault;// this is 2 in "Default" preset key
     NSMutableDictionary          *presetUserDefaultParent;
     NSMutableDictionary          *presetUserDefaultParentParent;
-    int                        presetCurrentBuiltInCount; // keeps track of the current number of built in presets
+    int                           presetCurrentBuiltInCount; // keeps track of the current number of built in presets
     IBOutlet NSPanel             * fAddPresetPanel;
        
     /* NSOutline View for the presets */
@@ -230,7 +265,8 @@ BOOL                        fIsDragging;
     hb_handle_t                  * fHandle;
     
     /* Queue variables */
-    hb_handle_t              * fQueueEncodeLibhb;           // libhb for HB Encoding
+    int                          hbInstanceNum; //stores the number of HandBrake instances currently running
+    hb_handle_t                  * fQueueEncodeLibhb;           // libhb for HB Encoding
        hb_title_t                   * fTitle;
     hb_title_t                   * fQueueEncodeTitle;
     int                          fEncodingQueueItem;     // corresponds to the index of fJobGroups encoding item
@@ -239,6 +275,9 @@ BOOL                        fIsDragging;
     int                          fCanceledCount;
     int                          fWorkingCount;
     
+    int                          fqueueEditRescanItemNum; // queue array item to be reloaded into the main window
+    int                          pidNum; // The pid number for this instance
+    NSString                     * currentQueueEncodeNameString;
     
     /* integer to set to determine the previous state
                of encode 0==idle, 1==encoding, 2==cancelled*/
@@ -248,10 +287,12 @@ BOOL                        fIsDragging;
     BOOL                           SuccessfulScan;
     BOOL                           applyQueueToScan;
        NSString                      * currentSource;
-    NSString                     * browsedSourceDisplayName;
+    NSString                      * browsedSourceDisplayName;
     
     double                         dockIconProgress;
 }
+- (int) getPidnum;
+- (IBAction) showAboutPanel:(id)sender;
 
 - (void) writeToActivityLog:(const char *) format, ...;
 - (IBAction) browseSources: (id) sender;
@@ -262,11 +303,17 @@ BOOL                        fIsDragging;
 - (void) performScan:(NSString *) scanPath scanTitleNum: (int) scanTitleNum;
 - (IBAction) showNewScan: (id) sender;
 
+
+- (IBAction) cancelScanning:(id)sender;
+
 - (void)     updateUI: (NSTimer *) timer;
 - (void)     enableUI: (bool) enable;
-
+- (IBAction) encodeStartStopPopUpChanged: (id) sender;
 - (IBAction) titlePopUpChanged: (id) sender;
 - (IBAction) chapterPopUpChanged: (id) sender;
+- (IBAction) startEndSecValueChanged: (id) sender;
+- (IBAction) startEndFrameValueChanged: (id) sender;
+
 
 - (IBAction) formatPopUpChanged: (id) sender;
 - (IBAction) videoEncoderPopUpChanged: (id) sender;
@@ -281,17 +328,20 @@ BOOL                        fIsDragging;
 - (IBAction) audioTrackPopUpChanged: (id) sender;
 - (IBAction) audioTrackPopUpChanged: (id) sender mixdownToUse: (int) mixdownToUse;
 - (IBAction) audioTrackMixdownChanged: (id) sender;
-- (IBAction) subtitleSelectionChanged: (id) sender;
 - (void) prepareJob;
 - (IBAction) browseFile: (id) sender;
 - (void)     browseFileDone: (NSSavePanel *) sheet
                  returnCode: (int) returnCode contextInfo: (void *) contextInfo;
 
 - (IBAction) videoMatrixChanged: (id) sender;
+
 - (IBAction) qualitySliderChanged: (id) sender;
 - (void) setupQualitySlider;
 
 - (IBAction) audioDRCSliderChanged: (id) sender;
+- (IBAction) browseImportSrtFile: (id) sender;
+- (void) browseImportSrtFileDone: (NSSavePanel *) sheet
+                     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
 
 - (IBAction) showPicturePanel: (id) sender;
 - (void) picturePanelFullScreen;
@@ -309,7 +359,11 @@ BOOL                        fIsDragging;
 - (void) performNewQueueScan:(NSString *) scanPath scanTitleNum: (int) scanTitleNum;
 - (void) processNewQueueEncode;
 - (void) clearQueueEncodedItems;
-- (IBAction)applyQueueSettings:(id)sender;
+/* Queue Editing */
+- (IBAction)applyQueueSettingsToMainWindow:(id)sender;
+- (IBAction)rescanQueueItemToMainWindow:(NSString *) scanPath scanTitleNum: (int) scanTitleNum selectedQueueItem: (int) selectedQueueItem;
+
+
 - (void) removeQueueFileItem:(int) queueItemToRemove;
 - (void) clearQueueAllItems;
 - (void)moveObjectsInQueueArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex;
@@ -358,14 +412,24 @@ BOOL                        fIsDragging;
 - (void)outlineView:(NSOutlineView *)fPresetsOutlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
 /* We use this to provide tooltips for the items in the presets outline view */
 - (NSString *)outlineView:(NSOutlineView *)fPresetsOutlineView toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tc item:(id)item mouseLocation:(NSPoint)mouseLocation;
-
+- (void) checkBuiltInsForUpdates;
 /* We use this to actually select the preset and act accordingly */
 - (IBAction)selectPreset:(id)sender;    
 
+/* Export / Import Presets */
+- (IBAction) browseExportPresetFile: (id) sender;
+- (void) browseExportPresetFileDone: (NSSavePanel *) sheet
+             returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+             
+- (IBAction) browseImportPresetFile: (id) sender;
+- (void) browseImportPresetDone: (NSSavePanel *) sheet
+                   returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+
 /* Manage User presets */    
 - (void) loadPresets;
 - (IBAction) customSettingUsed: (id) sender;
 - (IBAction) showAddPresetPanel: (id) sender;
+- (IBAction) addPresetPicDropdownChanged: (id) sender;
 - (IBAction) closeAddPresetPanel: (id) sender;
 - (NSDictionary *)createPreset;
 
@@ -384,7 +448,7 @@ BOOL                        fIsDragging;
 - (IBAction)getDefaultPresets:(id)sender;
 
 -(void)sendToMetaX:(NSString *) filePath;
-    // Growl methods
+// Growl methods
 - (NSDictionary *) registrationDictionaryForGrowl;
 -(void)showGrowlDoneNotification:(NSString *) filePath;
 - (IBAction)showDebugOutputPanel:(id)sender;
@@ -394,5 +458,17 @@ BOOL                        fIsDragging;
 - (void) remindUserOfSleepOrShutdown;
 
 - (void)moveObjectsInPresetsArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex;
+
+- (int) hbInstances;
+
+// Chapter files methods
+- (IBAction) browseForChapterFile: (id) sender;
+- (void)     browseForChapterFileDone: (NSOpenPanel *) sheet
+                 returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+
+- (IBAction) browseForChapterFileSave: (id) sender;
+- (void)     browseForChapterFileSaveDone: (NSSavePanel *) sheet
+                 returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+
 @end