X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FController.h;h=f9634abe901bbb999b1217008b1f76341fea89a7;hb=4b72a63eb61a01275493c4bfb51ba02152d1c5e1;hp=2c6f0d1cda897bb2ad6b8e2a933ab192cf633375;hpb=6c415da3a9b00825a1c99b8a5fbf43987069aec6;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/Controller.h b/macosx/Controller.h index 2c6f0d1c..f9634abe 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -10,11 +10,20 @@ #include "hb.h" #import "ChapterTitles.h" +#import "HBSubtitles.h" #import "PictureController.h" +#import "HBPreviewController.h" #import "HBQueueController.h" #import "HBAdvancedController.h" #import "HBPreferencesController.h" #import "HBPresets.h" +#import "HBAudioController.h" + +extern NSString *HBContainerChangedNotification; +extern NSString *keyContainerTag; +extern NSString *HBTitleChangedNotification; +extern NSString *keyTitleTag; + @class HBOutputPanelController; /* We subclass NSView so that our drags show both the icon as well as PresetName columns */ @@ -25,8 +34,10 @@ BOOL fIsDragging; } @end + @interface HBController : NSObject { + NSImage * fApplicationIcon; IBOutlet NSWindow * fWindow; /* Main Menu Outlets */ @@ -39,10 +50,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; @@ -62,10 +77,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; @@ -85,11 +117,15 @@ BOOL fIsDragging; IBOutlet NSButton * fDstMp4iPodFileCheck; /* Video box */ + IBOutlet NSButton * fFrameratePfrCheck; + IBOutlet NSTextField * fVidRateField; IBOutlet NSPopUpButton * fVidRatePopUp; 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 +133,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; @@ -137,68 +154,24 @@ BOOL fIsDragging; IBOutlet NSTextField * fSubField; IBOutlet NSPopUpButton * fSubPopUp; IBOutlet NSButton * fSubForcedCheck; - - /* Audio box */ - /* Track Labels */ - IBOutlet NSTextField * fAudSourceLabel; - IBOutlet NSTextField * fAudCodecLabel; - IBOutlet NSTextField * fAudMixdownLabel; - IBOutlet NSTextField * fAudSamplerateLabel; - IBOutlet NSTextField * fAudBitrateLabel; - IBOutlet NSTextField * fAudDrcLabel; - - IBOutlet NSTextField * fAudTrack1Label; - IBOutlet NSTextField * fAudTrack2Label; - IBOutlet NSTextField * fAudTrack3Label; - IBOutlet NSTextField * fAudTrack4Label; - - /* Source Audio PopUps */ - IBOutlet NSPopUpButton * fAudLang1PopUp; - IBOutlet NSPopUpButton * fAudLang2PopUp; - IBOutlet NSPopUpButton * fAudLang3PopUp; - IBOutlet NSPopUpButton * fAudLang4PopUp; - /* Codec Popups */ - IBOutlet NSPopUpButton * fAudTrack1CodecPopUp; - IBOutlet NSPopUpButton * fAudTrack2CodecPopUp; - IBOutlet NSPopUpButton * fAudTrack3CodecPopUp; - IBOutlet NSPopUpButton * fAudTrack4CodecPopUp; - /* Mixdown PopUps */ - IBOutlet NSPopUpButton * fAudTrack1MixPopUp; - IBOutlet NSPopUpButton * fAudTrack2MixPopUp; - IBOutlet NSPopUpButton * fAudTrack3MixPopUp; - IBOutlet NSPopUpButton * fAudTrack4MixPopUp; - - /* Samplerate PopUps */ - IBOutlet NSPopUpButton * fAudTrack1RatePopUp; - IBOutlet NSPopUpButton * fAudTrack2RatePopUp; - IBOutlet NSPopUpButton * fAudTrack3RatePopUp; - IBOutlet NSPopUpButton * fAudTrack4RatePopUp; - - /* Bitrate PopUps */ - IBOutlet NSPopUpButton * fAudTrack1BitratePopUp; - IBOutlet NSPopUpButton * fAudTrack2BitratePopUp; - IBOutlet NSPopUpButton * fAudTrack3BitratePopUp; - IBOutlet NSPopUpButton * fAudTrack4BitratePopUp; - - /* Dynamic Range Compression */ - IBOutlet NSSlider * fAudTrack1DrcSlider; - IBOutlet NSTextField * fAudTrack1DrcField; - IBOutlet NSSlider * fAudTrack2DrcSlider; - IBOutlet NSTextField * fAudTrack2DrcField; - IBOutlet NSSlider * fAudTrack3DrcSlider; - IBOutlet NSTextField * fAudTrack3DrcField; - IBOutlet NSSlider * fAudTrack4DrcSlider; - IBOutlet NSTextField * fAudTrack4DrcField; + IBOutlet NSTableView * fSubtitlesTable; + HBSubtitles * fSubtitlesDelegate; + IBOutlet NSButton * fBrowseSrtFileButton; + /* New Audio box */ + IBOutlet HBAudioController * fAudioDelegate; + /* Chapters box */ IBOutlet NSButton * fCreateChapterMarkers; IBOutlet NSTableView * fChapterTable; + IBOutlet NSButton * fLoadChaptersButton; + IBOutlet NSButton * fSaveChaptersButton; + IBOutlet NSTableColumn * fChapterTableNameColumn; ChapterTitles * fChapterTitlesDelegate; /* Bottom */ - IBOutlet NSButton * fPictureButton; IBOutlet NSTextField * fStatusField; IBOutlet NSProgressIndicator * fRipIndicator; BOOL fRipIndicatorShown; @@ -214,6 +187,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; @@ -229,9 +206,10 @@ 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; - /* new NSOutline View for the presets */ + + /* NSOutline View for the presets */ NSArray *fDraggedNodes; IBOutlet HBPresetsOutlineView * fPresetsOutlineView; IBOutlet NSButton * fPresetsAdd; @@ -240,7 +218,9 @@ BOOL fIsDragging; hb_handle_t * fHandle; - hb_handle_t * fQueueEncodeLibhb; // libhb for HB Encoding + /* Queue variables */ + 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 @@ -249,6 +229,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*/ @@ -258,9 +241,15 @@ BOOL fIsDragging; BOOL SuccessfulScan; BOOL applyQueueToScan; NSString * currentSource; - NSString * browsedSourceDisplayName; + NSString * browsedSourceDisplayName; + + double dockIconProgress; + BOOL hasValidPresetSelected; } -- (void) writeToActivityLog:(char *) format, ...; +- (int) getPidnum; +- (IBAction) showAboutPanel:(id)sender; + +- (void) writeToActivityLog:(const char *) format, ...; - (IBAction) browseSources: (id) sender; - (void) browseSourcesDone: (NSOpenPanel *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo; @@ -269,37 +258,42 @@ 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; - (IBAction) autoSetM4vExtension: (id) sender; -- (void) shouldEnableHttpMp4CheckBox: (id) sender; - (IBAction) twoPassCheckboxChanged: (id) sender; - (IBAction) videoFrameRateChanged: (id) sender; -- (IBAction) audioAddAudioTrackCodecs: (id)sender; -- (IBAction) audioCodecsPopUpChanged: (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; - (void) prepareJob; - (IBAction) browseFile: (id) sender; - (void) browseFileDone: (NSSavePanel *) sheet returnCode: (int) returnCode contextInfo: (void *) contextInfo; - (IBAction) videoMatrixChanged: (id) sender; + - (IBAction) qualitySliderChanged: (id) sender; -- (IBAction) audioDRCSliderChanged: (id) sender; +- (void) setupQualitySlider; + +- (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; @@ -311,10 +305,14 @@ 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:(unsigned)insertIndex; +- (void)moveObjectsInQueueArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(NSUInteger)insertIndex; - (void)getQueueStats; - (void)setQueueEncodingItemsAsPending; - (IBAction) addToQueue: (id) sender; @@ -360,14 +358,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; @@ -386,15 +394,31 @@ BOOL fIsDragging; - (IBAction)getDefaultPresets:(id)sender; -(void)sendToMetaX:(NSString *) filePath; - // Growl methods +// Growl methods - (NSDictionary *) registrationDictionaryForGrowl; -(void)showGrowlDoneNotification:(NSString *) filePath; - (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; + +// 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; + ++ (unsigned int) maximumNumberOfAllowedAudioTracks; +@property (nonatomic, assign) BOOL hasValidPresetSelected; +- (IBAction) addAllAudioTracks: (id) sender; + @end