X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FController.h;h=c9118c023be3dcabdb35a737aee3ea1ff547433f;hb=73c14d29e5ad89dd1798d73f424791396c944b69;hp=807e08ff7295537c22d67c3017a54b6f6c988134;hpb=3dd79f6623809ceb16c6d311d51a6c0f4cdbf5a3;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/Controller.h b/macosx/Controller.h index 807e08ff..c9118c02 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -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: . + Homepage: . It may be used under the terms of the GNU General Public License. */ #import @@ -11,26 +11,51 @@ #import "ChapterTitles.h" #import "PictureController.h" +#import "HBFilterController.h" +#import "HBPreviewController.h" #import "HBQueueController.h" -#import "MVMenuButton.h" #import "HBAdvancedController.h" #import "HBPreferencesController.h" +#import "HBPresets.h" @class HBOutputPanelController; +@class PictureFilterController; -@interface HBController : NSObject +/* We subclass NSView so that our drags show both the icon as well as PresetName columns */ +@interface HBPresetsOutlineView : NSOutlineView +{ + +BOOL fIsDragging; + +} +@end +@interface HBController : NSObject { IBOutlet NSWindow * fWindow; - NSToolbar * toolbar; + + /* Main Menu Outlets */ + NSMenuItem * fOpenSourceTitleMMenu; + + /* Source Title Scan Outlets */ + IBOutlet NSPanel * fScanSrcTitlePanel; + IBOutlet NSTextField * fScanSrcTitlePathField; + IBOutlet NSTextField * fSrcDsplyNameTitleScan; + IBOutlet NSTextField * fScanSrcTitleNumField; + IBOutlet NSButton * fScanSrcTitleCancelButton; + IBOutlet NSButton * fScanSrcTitleOpenButton; - /* Picture panel */ + /* Picture Settings */ PictureController * fPictureController; + /* Picture Filters */ + PictureFilterController * fPictureFilterController; + /* Picture Preview */ + PreviewController * fPreviewController; /* Advanced options tab */ HBAdvancedController * fAdvancedOptions; IBOutlet NSBox * fAdvancedView; - + HBPreferencesController * fPreferencesController; /* Queue panel */ @@ -56,12 +81,17 @@ /* Destination box */ IBOutlet NSTextField * fDstFormatField; IBOutlet NSPopUpButton * fDstFormatPopUp; - IBOutlet NSButton * fDstMpgLargeFileCheck; - IBOutlet NSTextField * fDstCodecsField; - IBOutlet NSPopUpButton * fDstCodecsPopUp; + IBOutlet NSTextField * fDstFile1Field; IBOutlet NSTextField * fDstFile2Field; IBOutlet NSButton * fDstBrowseButton; + /* MP4 Options */ + // Creates 64 bit mp4's that allow file sizes over 4gb + IBOutlet NSButton * fDstMp4LargeFileCheck; + // Optimizes mp4's for http + IBOutlet NSButton * fDstMp4HttpOptFileCheck; + // Creates iPod compatible mp4's (add ipod uuid atom) + IBOutlet NSButton * fDstMp4iPodFileCheck; /* Video box */ IBOutlet NSTextField * fVidRateField; @@ -69,6 +99,8 @@ IBOutlet NSTextField * fVidEncoderField; IBOutlet NSPopUpButton * fVidEncoderPopUp; IBOutlet NSTextField * fVidQualityField; + IBOutlet NSTextField * fVidQualityRFLabel; + IBOutlet NSTextField * fVidQualityRFField; IBOutlet NSMatrix * fVidQualityMatrix; IBOutlet NSButtonCell * fVidTargetCell; IBOutlet NSTextField * fVidTargetSizeField; @@ -76,38 +108,17 @@ 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 * fPicLabelOutp; - IBOutlet NSTextField * fPicLabelAr; - IBOutlet NSTextField * fPicLabelSrcX; - IBOutlet NSTextField * fPicLabelOutputX; - IBOutlet NSTextField * fPicLabelAutoCrop; - IBOutlet NSTextField * fPicLabelDetelecine; - IBOutlet NSTextField * fPicLabelDeinterlace; - IBOutlet NSTextField * fPicLabelDenoise; + /* Status read out fileds for picture sizing */ + IBOutlet NSTextField * fPictureSizeField; + IBOutlet NSTextField * fPictureCroppingField; + + /* Status read out fileds for video filters */ + IBOutlet NSTextField * fVideoFiltersField; - IBOutlet NSTextField * fPicSrcWidth; - IBOutlet NSTextField * fPicSrcHeight; - IBOutlet NSTextField * fPicSettingWidth; - IBOutlet NSTextField * fPicSettingHeight; - IBOutlet NSTextField * fPicSettingDeinterlace; - IBOutlet NSTextField * fPicSettingARkeep; - IBOutlet NSTextField * fPicSettingPAR; - IBOutlet NSTextField * fPicSettingAutoCrop; - IBOutlet NSTextField * fPicSettingDetelecine; - IBOutlet NSTextField * fPicSettingDenoise; - - IBOutlet NSTextField * fPicLabelAnamorphic; - IBOutlet NSTextField * fPicLabelPAROutputX; - IBOutlet NSTextField * fPicSettingPARWidth; - IBOutlet NSTextField * fPicSettingPARHeight; - /* Picture variables */ + /* Picture variables */ int PicOrigOutputWidth; int PicOrigOutputHeight; int AutoCropTop; @@ -120,20 +131,58 @@ IBOutlet NSButton * fSubForcedCheck; /* Audio box */ - IBOutlet NSTextField * fAudLang1Field; + /* 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 NSTextField * fAudLang2Field; IBOutlet NSPopUpButton * fAudLang2PopUp; - /* New Audio Mix PopUps */ - IBOutlet NSTextField * fAudTrack1MixLabel; + 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 NSTextField * fAudTrack2MixLabel; - IBOutlet NSPopUpButton * fAudTrack2MixPopUp; + IBOutlet NSPopUpButton * fAudTrack2MixPopUp; + IBOutlet NSPopUpButton * fAudTrack3MixPopUp; + IBOutlet NSPopUpButton * fAudTrack4MixPopUp; - IBOutlet NSTextField * fAudRateField; - IBOutlet NSPopUpButton * fAudRatePopUp; - IBOutlet NSTextField * fAudBitrateField; - IBOutlet NSPopUpButton * fAudBitratePopUp; + /* 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; /* Chapters box */ IBOutlet NSButton * fCreateChapterMarkers; @@ -141,17 +190,23 @@ 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; IBOutlet NSTextField * fPresetNewName; IBOutlet NSTextField * fPresetNewDesc; IBOutlet NSPopUpButton * fPresetNewPicSettingsPopUp; + IBOutlet NSButton * fPresetNewPicFiltersCheck; + IBOutlet NSButton * fPresetNewFolderCheck; IBOutlet NSTextField * fPresetSelectedDisplay; NSString * AppSupportDirectory; @@ -161,46 +216,66 @@ 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; - IBOutlet NSTableView * tableView; - IBOutlet NSButton * fPresetsAdd; - IBOutlet NSButton * fPresetsDelete; - IBOutlet MVMenuButton * fPresetsActionButton; - IBOutlet NSMenu * fPresetsActionMenu; + /* NSOutline View for the presets */ + NSArray *fDraggedNodes; + IBOutlet HBPresetsOutlineView * fPresetsOutlineView; + IBOutlet NSButton * fPresetsAdd; + IBOutlet NSButton * fPresetsDelete; + 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; - int SuccessfulScan; + BOOL SuccessfulScan; + BOOL applyQueueToScan; NSString * currentSource; - - hb_job_t * fLastKnownCurrentJob; + NSString * browsedSourceDisplayName; } -- (void) TranslateStrings; +- (void) writeToActivityLog:(char *) format, ...; +- (IBAction) browseSources: (id) sender; +- (void) browseSourcesDone: (NSOpenPanel *) sheet + returnCode: (int) returnCode contextInfo: (void *) contextInfo; +- (IBAction) showSourceTitleScanPanel: (id) sender; +- (IBAction) closeSourceTitleScanPanel: (id) sender; +- (void) performScan:(NSString *) scanPath scanTitleNum: (int) scanTitleNum; +- (IBAction) showNewScan: (id) sender; - (void) updateUI: (NSTimer *) timer; - (void) enableUI: (bool) enable; -- (IBAction) showNewScan: (id) sender; -- (IBAction) showScanPanel: (id) sender; -- (IBAction) browseSources: (id) sender; -- (void) browseSourcesDone: (NSOpenPanel *) sheet - returnCode: (int) returnCode contextInfo: (void *) contextInfo; - + - (IBAction) titlePopUpChanged: (id) sender; - (IBAction) chapterPopUpChanged: (id) sender; - (IBAction) formatPopUpChanged: (id) sender; -- (IBAction) codecsPopUpChanged: (id) sender; -- (IBAction) encoderPopUpChanged: (id) sender; +- (IBAction) videoEncoderPopUpChanged: (id) sender; +- (IBAction) autoSetM4vExtension: (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; @@ -208,21 +283,43 @@ - (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; + 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) showFiltersPanel: (id) sender; +- (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:(unsigned)insertIndex; +- (void)getQueueStats; +- (void)setQueueEncodingItemsAsPending; - (IBAction) addToQueue: (id) sender; - (void) overwriteAddToQueueAlertDone: (NSWindow *) sheet - returnCode: (int) returnCode contextInfo: (void *) contextInfo; + returnCode: (int) returnCode contextInfo: (void *) contextInfo; - (void) doAddToQueue; - (IBAction) showQueueWindow:(id)sender; @@ -231,12 +328,12 @@ - (IBAction) Rip: (id) sender; - (void) overWriteAlertDone: (NSWindow *) sheet - returnCode: (int) returnCode contextInfo: (void *) contextInfo; -- (void) updateAlertDone: (NSWindow *) sheet - returnCode: (int) returnCode contextInfo: (void *) contextInfo; + returnCode: (int) returnCode contextInfo: (void *) contextInfo; - (void) doRip; - (IBAction) Cancel: (id) sender; +- (void) doCancelCurrentJob; +- (void) doCancelCurrentJobAndStop; - (IBAction) Pause: (id) sender; - (IBAction) calculateBitrate: (id) sender; @@ -247,34 +344,39 @@ - (IBAction) openUserGuide: (id) sender; // Preset Methods Here + +/* These are required by the NSOutlineView Datasource Delegate */ +/* We use this to deterimine children of an item */ +- (id)outlineView:(NSOutlineView *)fPresetsOutlineView child:(NSInteger)index ofItem:(id)item; +/* We use this to determine if an item should be expandable */ +- (BOOL)outlineView:(NSOutlineView *)fPresetsOutlineView isItemExpandable:(id)item; +/* used to specify the number of levels to show for each item */ +- (int)outlineView:(NSOutlineView *)fPresetsOutlineView numberOfChildrenOfItem:(id)item; +/* Used to tell the outline view which information is to be displayed per item */ +- (id)outlineView:(NSOutlineView *)fPresetsOutlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item; +/* Use to customize the font and display characteristics of the title cell */ +- (void)outlineView:(NSOutlineView *)fPresetsOutlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item; +/* We use this to edit the name field in the outline view */ +- (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; + +/* We use this to actually select the preset and act accordingly */ +- (IBAction)selectPreset:(id)sender; + +/* Manage User presets */ - (void) loadPresets; - (IBAction) customSettingUsed: (id) sender; - (IBAction) showAddPresetPanel: (id) sender; - (IBAction) closeAddPresetPanel: (id) sender; - (NSDictionary *)createPreset; -- (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; -- (NSDictionary *)createDeuxSixQuatrePreset; -- (NSDictionary *)createBrokePreset; -- (NSDictionary *)createBlindPreset; -- (NSDictionary *)createCRFPreset; - (IBAction) revertPictureSizeToMax:(id)sender; - (IBAction)setDefaultPreset:(id)sender; - (IBAction)selectDefaultPreset:(id)sender; - (void) savePreset; +- (void)sortPresets; - (IBAction)addFactoryPresets:(id)sender; - (IBAction)deleteFactoryPresets:(id)sender; - (IBAction)addUserPreset:(id)sender; @@ -282,26 +384,17 @@ - (IBAction)insertPreset:(id)sender; - (IBAction)deletePreset:(id)sender; - (IBAction)getDefaultPresets:(id)sender; -- (IBAction)tableViewSelected:(id)sender; - -// NSTableDataSource methods -- (int)numberOfRowsInTableView:(NSTableView *)aTableView; -- (id)tableView:(NSTableView *)aTableView - objectValueForTableColumn:(NSTableColumn *)aTableColumn - row:(int)rowIndex; -- (void)tableView:(NSTableView *)aTableView - 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 + +-(void)sendToMetaX:(NSString *) filePath; + // Growl methods - (NSDictionary *) registrationDictionaryForGrowl; --(IBAction)showGrowlDoneNotification:(id)sender; +-(void)showGrowlDoneNotification:(NSString *) filePath; - (IBAction)showDebugOutputPanel:(id)sender; - (void)setupToolbar; + +- (void) prepareJobForPreview; +- (void) remindUserOfSleepOrShutdown; + +- (void)moveObjectsInPresetsArray:(NSMutableArray *)array fromIndexes:(NSIndexSet *)indexSet toIndex:(unsigned)insertIndex; @end