OSDN Git Service

MacGui: The textarea was misaligned of 1px to the left.
[handbrake-jp/handbrake-jp-git.git] / macosx / Controller.h
index 4df14f9..b3c425e 100644 (file)
 
 #import "ChapterTitles.h"
 #import "PictureController.h"
+#import "HBPreviewController.h"
 #import "HBQueueController.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 */
@@ -25,6 +27,7 @@ BOOL                        fIsDragging;
 
 }
 @end
+
 @interface HBController : NSObject <GrowlApplicationBridgeDelegate>
 {
     IBOutlet NSWindow            * fWindow;
@@ -40,9 +43,12 @@ BOOL                        fIsDragging;
     IBOutlet NSButton             * fScanSrcTitleCancelButton;
     IBOutlet NSButton             * fScanSrcTitleOpenButton;
     
-    /* Picture panel */
+    /* Picture Settings */
     PictureController            * fPictureController;
     
+    /* Picture Preview */
+    PreviewController            * fPreviewController;
+    
     /* Advanced options tab */
     HBAdvancedController         * fAdvancedOptions;
        IBOutlet NSBox               * fAdvancedView;
@@ -90,6 +96,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;
@@ -97,34 +105,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         * fPicLabelDecomb;
-    IBOutlet NSTextField         * fPicLabelDenoise;
-    IBOutlet NSTextField         * fPicLabelDeblock;
-       IBOutlet NSTextField         * fPicSettingDeinterlace;
-    IBOutlet NSTextField         * fPicSettingDecomb;
-       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;
@@ -198,11 +187,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;
@@ -210,6 +203,7 @@ BOOL                        fIsDragging;
        IBOutlet NSTextField         * fPresetNewDesc;
        IBOutlet NSPopUpButton       * fPresetNewPicSettingsPopUp;
     IBOutlet NSButton            * fPresetNewPicFiltersCheck;
+    IBOutlet NSButton            * fPresetNewFolderCheck;
        IBOutlet NSTextField         * fPresetSelectedDisplay;
        
        NSString                     * AppSupportDirectory;
@@ -219,11 +213,14 @@ 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;
@@ -231,17 +228,32 @@ BOOL                        fIsDragging;
     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, ...;
+
+- (void) writeToActivityLog:(const char *) format, ...;
 - (IBAction) browseSources: (id) sender;
 - (void) browseSourcesDone: (NSOpenPanel *) sheet
                 returnCode: (int) returnCode contextInfo: (void *) contextInfo;
@@ -259,7 +271,6 @@ BOOL                        fIsDragging;
 - (IBAction) formatPopUpChanged: (id) sender;
 - (IBAction) videoEncoderPopUpChanged: (id) sender;
 - (IBAction) autoSetM4vExtension: (id) sender;
-- (void) shouldEnableHttpMp4CheckBox: (id) sender;
 - (IBAction) twoPassCheckboxChanged: (id) sender;
 - (IBAction) videoFrameRateChanged: (id) sender;
 - (IBAction) audioAddAudioTrackCodecs: (id)sender;
@@ -271,19 +282,39 @@ BOOL                        fIsDragging;
 - (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) 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;
@@ -300,7 +331,7 @@ BOOL                        fIsDragging;
 
 - (IBAction) Cancel: (id) sender;
 - (void)     doCancelCurrentJob;
-
+- (void) doCancelCurrentJobAndStop;
 - (IBAction) Pause: (id) sender;
 
 - (IBAction) calculateBitrate: (id) sender;
@@ -359,9 +390,9 @@ 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;
 @end