OSDN Git Service

x264 bump to r1338-19977e9
[handbrake-jp/handbrake-jp-git.git] / macosx / Controller.h
index efb67dc..07a0272 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id: Controller.h,v 1.35 2005/08/01 14:29:50 titer Exp $
 
    This file is part of the HandBrake source code.
-   Homepage: <http://handbrake.m0k.org/>.
+   Homepage: <http://handbrake.fr/>.
    It may be used under the terms of the GNU General Public License. */
 
 #import <Cocoa/Cocoa.h>
 #include "hb.h"
 
 #import "ChapterTitles.h"
+#import "HBSubtitles.h"
 #import "PictureController.h"
+#import "HBPreviewController.h"
 #import "HBQueueController.h"
-#import "MVMenuButton.h"
 #import "HBAdvancedController.h"
 #import "HBPreferencesController.h"
 #import "HBPresets.h"
+
 @class HBOutputPanelController;
 
 /* We subclass NSView so that our drags show both the icon as well as PresetName columns */
@@ -26,11 +28,12 @@ BOOL                        fIsDragging;
 
 }
 @end
+
 @interface HBController : NSObject <GrowlApplicationBridgeDelegate>
 {
+    NSImage                      * fApplicationIcon;
     IBOutlet NSWindow            * fWindow;
-    NSToolbar                    * toolbar;
-    
+
     /* Main Menu Outlets */
     NSMenuItem                   * fOpenSourceTitleMMenu;
     
@@ -41,10 +44,14 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField          * fScanSrcTitleNumField;
     IBOutlet NSButton             * fScanSrcTitleCancelButton;
     IBOutlet NSButton             * fScanSrcTitleOpenButton;
+
     
-    /* Picture panel */
+    /* Picture Settings */
     PictureController            * fPictureController;
     
+    /* Picture Preview */
+    PreviewController            * fPreviewController;
+    
     /* Advanced options tab */
     HBAdvancedController         * fAdvancedOptions;
        IBOutlet NSBox               * fAdvancedView;
@@ -64,6 +71,12 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField         * fSrcDVD2Field;
     IBOutlet NSTextField         * fSrcTitleField;
     IBOutlet NSPopUpButton       * fSrcTitlePopUp;
+    
+    
+    /* lib dvd nav specific */
+    IBOutlet NSTextField         * fSrcAngleLabel;
+    IBOutlet NSPopUpButton       * fSrcAnglePopUp;
+    
     IBOutlet NSTextField         * fSrcChapterField;
     IBOutlet NSPopUpButton       * fSrcChapterStartPopUp;
     IBOutlet NSTextField         * fSrcChapterToField;
@@ -74,8 +87,7 @@ BOOL                        fIsDragging;
     /* Destination box */
     IBOutlet NSTextField         * fDstFormatField;
        IBOutlet NSPopUpButton       * fDstFormatPopUp;
-       //IBOutlet NSTextField         * fDstCodecsField;
-    //IBOutlet NSPopUpButton       * fDstCodecsPopUp;
+       
     IBOutlet NSTextField         * fDstFile1Field;
     IBOutlet NSTextField         * fDstFile2Field;
     IBOutlet NSButton            * fDstBrowseButton;
@@ -93,6 +105,8 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField         * fVidEncoderField;
     IBOutlet NSPopUpButton       * fVidEncoderPopUp;
     IBOutlet NSTextField         * fVidQualityField;
+    IBOutlet NSTextField         * fVidQualityRFLabel;
+    IBOutlet NSTextField         * fVidQualityRFField;
     IBOutlet NSMatrix            * fVidQualityMatrix;
     IBOutlet NSButtonCell        * fVidTargetCell;
     IBOutlet NSTextField         * fVidTargetSizeField;
@@ -100,32 +114,15 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField         * fVidBitrateField;
     IBOutlet NSButtonCell        * fVidConstantCell;
     IBOutlet NSSlider            * fVidQualitySlider;
-    IBOutlet NSButton            * fVidGrayscaleCheck;
     IBOutlet NSButton            * fVidTwoPassCheck;
     IBOutlet NSButton            * fVidTurboPassCheck;
        
-       /* Picture Settings box */
-       IBOutlet NSTextField         * fPicLabelSettings;
-       IBOutlet NSTextField         * fPicLabelSrc;
-    IBOutlet NSTextField         * fPicSettingsSrc;
-       IBOutlet NSTextField         * fPicLabelOutp;
-    IBOutlet NSTextField         * fPicSettingsOutp;
-    IBOutlet NSTextField         * fPicLabelAnamorphic;
-    IBOutlet NSTextField         * fPicSettingsAnamorphic;
-    
-    IBOutlet NSTextField         * fPicLabelAr;
-       IBOutlet NSTextField         * fPicLabelAutoCrop;
-    IBOutlet NSTextField         * fPicLabelDetelecine;
-       IBOutlet NSTextField         * fPicLabelDeinterlace;
-    IBOutlet NSTextField         * fPicLabelDenoise;
-    IBOutlet NSTextField         * fPicLabelDeblock;
-       IBOutlet NSTextField         * fPicSettingDeinterlace;
-       IBOutlet NSTextField         * fPicSettingARkeep;
-       IBOutlet NSTextField         * fPicSettingPAR;
-       IBOutlet NSTextField         * fPicSettingAutoCrop;
-       IBOutlet NSTextField         * fPicSettingDetelecine;
-       IBOutlet NSTextField         * fPicSettingDenoise;
-    IBOutlet NSTextField         * fPicSettingDeblock;
+       /* Status read out fileds for picture sizing */
+    IBOutlet NSTextField         * fPictureSizeField;
+    IBOutlet NSTextField         * fPictureCroppingField;
+       
+    /* Status read out fileds for video filters */
+    IBOutlet NSTextField         * fVideoFiltersField;
        
        /* Picture variables */
        int                        PicOrigOutputWidth;
@@ -138,6 +135,12 @@ BOOL                        fIsDragging;
     IBOutlet NSTextField         * fSubField;
     IBOutlet NSPopUpButton       * fSubPopUp;
        IBOutlet NSButton            * fSubForcedCheck;
+    
+    
+    IBOutlet NSTableView         * fSubtitlesTable;
+       HBSubtitles                  * fSubtitlesDelegate;
+    IBOutlet NSButton            * fBrowseSrtFileButton;
+    
        
     /* Audio box */
     /* Track Labels */
@@ -199,11 +202,15 @@ BOOL                        fIsDragging;
        ChapterTitles                * fChapterTitlesDelegate;
        
     /* Bottom */
-    IBOutlet NSButton            * fPictureButton;
     IBOutlet NSTextField         * fStatusField;
     IBOutlet NSProgressIndicator * fRipIndicator;
        BOOL                           fRipIndicatorShown;
     
+    /* Queue File variables */
+    NSString                     * QueueFile;
+       NSMutableArray               * QueueFileArray;
+    int                            currentQueueEncodeIndex; // Used to track the currently encoding queueu item
+    
        /* User Preset variables here */
        HBPresets                    * fPresetsBuiltin;
        IBOutlet NSDrawer            * fPresetDrawer;
@@ -211,6 +218,7 @@ BOOL                        fIsDragging;
        IBOutlet NSTextField         * fPresetNewDesc;
        IBOutlet NSPopUpButton       * fPresetNewPicSettingsPopUp;
     IBOutlet NSButton            * fPresetNewPicFiltersCheck;
+    IBOutlet NSButton            * fPresetNewFolderCheck;
        IBOutlet NSTextField         * fPresetSelectedDisplay;
        
        NSString                     * AppSupportDirectory;
@@ -220,30 +228,49 @@ BOOL                        fIsDragging;
        NSMutableDictionary          * chosenPreset;
     int                            curUserPresetChosenNum;
         
-       int                            presetHbDefault; // this is 1 in "Default" preset key
-       int                            presetUserDefault;// this is 2 in "Default" preset key
+       NSMutableDictionary          *presetHbDefault; // this is 1 in "Default" preset key
+       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
     IBOutlet NSPanel             * fAddPresetPanel;
-       /* new NSOutline View for the presets */
+       
+    /* NSOutline View for the presets */
     NSArray                      *fDraggedNodes;
     IBOutlet HBPresetsOutlineView * fPresetsOutlineView;
     IBOutlet NSButton            * fPresetsAdd;
        IBOutlet NSButton            * fPresetsDelete;
-    IBOutlet MVMenuButton        * fPresetsActionButton;
-    IBOutlet NSMenu              * fPresetsActionMenu;
-       
+    IBOutlet NSPopUpButton       * fPresetsActionButton;
+
     hb_handle_t                  * fHandle;
+    
+    /* Queue variables */
+    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
+    int                          fPendingCount;         // Number of various kinds of job groups in fJobGroups.
+    int                          fCompletedCount;
+    int                          fCanceledCount;
+    int                          fWorkingCount;
+    
+    
     /* integer to set to determine the previous state
                of encode 0==idle, 1==encoding, 2==cancelled*/
     int                            fEncodeState;
        int                            currentScanCount;
        int                            currentSuccessfulScanCount;
     BOOL                           SuccessfulScan;
+    BOOL                           applyQueueToScan;
        NSString                      * currentSource;
     NSString                     * browsedSourceDisplayName;
+    
+    double                         dockIconProgress;
 }
-- (void) writeToActivityLog:(char *) format, ...;
+
+- (IBAction) showAboutPanel:(id)sender;
+
+- (void) writeToActivityLog:(const char *) format, ...;
 - (IBAction) browseSources: (id) sender;
 - (void) browseSourcesDone: (NSOpenPanel *) sheet
                 returnCode: (int) returnCode contextInfo: (void *) contextInfo;
@@ -252,8 +279,6 @@ BOOL                        fIsDragging;
 - (void) performScan:(NSString *) scanPath scanTitleNum: (int) scanTitleNum;
 - (IBAction) showNewScan: (id) sender;
 
-- (void)     TranslateStrings;
-
 - (void)     updateUI: (NSTimer *) timer;
 - (void)     enableUI: (bool) enable;
 
@@ -273,20 +298,43 @@ 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;
+- (void) picturePanelWindowed;
+- (IBAction) showPreviewWindow: (id) sender;
+- (void)pictureSettingsDidChange;
 - (IBAction) calculatePictureSizing: (id) sender;
 - (IBAction) openMainWindow: (id) sender;
 
+/* Queue File Stuff */
+- (void) loadQueueFile;
+- (NSDictionary *)createQueueFileItem;
+- (void)saveQueueFileItem;
+- (void) incrementQueueItemDone:(int) queueItemDoneIndexNum;
+- (void) performNewQueueScan:(NSString *) scanPath scanTitleNum: (int) scanTitleNum;
+- (void) processNewQueueEncode;
+- (void) clearQueueEncodedItems;
+- (IBAction)applyQueueSettings:(id)sender;
+- (void) removeQueueFileItem:(int) queueItemToRemove;
+- (void) clearQueueAllItems;
+- (void)moveObjectsInQueueArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex;
+- (void)getQueueStats;
+- (void)setQueueEncodingItemsAsPending;
 - (IBAction) addToQueue: (id) sender;
 - (void) overwriteAddToQueueAlertDone: (NSWindow *) sheet
                            returnCode: (int) returnCode contextInfo: (void *) contextInfo;
@@ -303,7 +351,7 @@ BOOL                        fIsDragging;
 
 - (IBAction) Cancel: (id) sender;
 - (void)     doCancelCurrentJob;
-
+- (void) doCancelCurrentJobAndStop;
 - (IBAction) Pause: (id) sender;
 
 - (IBAction) calculateBitrate: (id) sender;
@@ -330,10 +378,19 @@ 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;
@@ -362,8 +419,15 @@ BOOL                        fIsDragging;
 - (IBAction)showDebugOutputPanel:(id)sender;
 - (void)setupToolbar;
 
+- (void) prepareJobForPreview;
 - (void) remindUserOfSleepOrShutdown;
 
-- (void)moveObjectsInPresetsArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(unsigned)insertIndex;
+- (void)moveObjectsInPresetsArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex;
+
+- (int) hbInstances;
+
+
+
+
 @end