From 5d4117bccd9ce796e102842270726eae9fcf07e5 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Wed, 5 Sep 2007 20:01:14 +0000 Subject: MacGui: New Active Queue implementation courtesy of travistex - Thanks travistex! - queue is now in a separate window - queue currently shows jobs grouped together as one encode, which is configurable - queue now shows currently encoding job, which is independently cancellable without losing the rest of the queue. - can start and pause encoding in the queue window - queue uses its own nib - progress status needs work - This has a way to go, but needed to get checked in as it changes the current xcode project structure. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@925 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- Jamfile | 6 +- libhb/common.h | 5 + libhb/hb.c | 1 + libhb/hb.h | 1 + macosx/Controller.h | 10 +- macosx/Controller.mm | 158 +- macosx/English.lproj/MainMenu.nib/classes.nib | 4 +- macosx/English.lproj/MainMenu.nib/info.nib | 7 +- macosx/English.lproj/MainMenu.nib/keyedobjects.nib | Bin 134396 -> 132148 bytes macosx/English.lproj/Queue.nib/classes.nib | 370 ++ macosx/English.lproj/Queue.nib/info.nib | 28 + macosx/English.lproj/Queue.nib/keyedobjects.nib | 3615 ++++++++++++++++++++ macosx/HBQueueController.h | 62 + macosx/HBQueueController.mm | 841 +++++ macosx/HandBrake.xcodeproj/project.pbxproj | 61 +- macosx/icons/Delete.png | Bin 0 -> 228 bytes macosx/icons/DeleteHighlight.png | Bin 0 -> 208 bytes macosx/icons/DeleteHighlightPressed.png | Bin 0 -> 212 bytes macosx/icons/DeletePressed.png | Bin 0 -> 224 bytes macosx/icons/JobLarge.png | Bin 0 -> 9131 bytes macosx/icons/JobSmall.png | Bin 0 -> 570 bytes 21 files changed, 5115 insertions(+), 54 deletions(-) create mode 100644 macosx/English.lproj/Queue.nib/classes.nib create mode 100644 macosx/English.lproj/Queue.nib/info.nib create mode 100644 macosx/English.lproj/Queue.nib/keyedobjects.nib create mode 100644 macosx/HBQueueController.h create mode 100644 macosx/HBQueueController.mm create mode 100644 macosx/icons/Delete.png create mode 100644 macosx/icons/DeleteHighlight.png create mode 100644 macosx/icons/DeleteHighlightPressed.png create mode 100644 macosx/icons/DeletePressed.png create mode 100644 macosx/icons/JobLarge.png create mode 100644 macosx/icons/JobSmall.png diff --git a/Jamfile b/Jamfile index 4c6cdf46a..1c6f93db8 100644 --- a/Jamfile +++ b/Jamfile @@ -59,7 +59,7 @@ if $(OS) = MACOSX OSX_SRC = macosx/main.mm macosx/Controller.h macosx/Controller.mm macosx/PictureController.h macosx/PictureController.mm macosx/PictureGLView.h macosx/PictureGLView.mm - macosx/QueueController.h macosx/QueueController.mm + macosx/HBQueueController.h macosx/HBQueueController.mm macosx/HBPreferencesController.h macosx/HBPreferencesController.m macosx/English.lproj/InfoPlist.strings macosx/English.lproj/MainMenu.nib/classes.nib @@ -69,6 +69,10 @@ if $(OS) = MACOSX macosx/English.lproj/Express.nib/classes.nib macosx/English.lproj/Express.nib/info.nib macosx/English.lproj/Express.nib/keyedobjects.nib + macosx/English.lproj/Queue.nib + macosx/English.lproj/Queue.nib/classes.nib + macosx/English.lproj/Queue.nib/info.nib + macosx/English.lproj/Queue.nib/keyedobjects.nib macosx/English.lproj/Preferences.nib macosx/English.lproj/Preferences.nib/classes.nib macosx/English.lproj/Preferences.nib/info.nib diff --git a/libhb/common.h b/libhb/common.h index 0fc36473d..12558871e 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -104,6 +104,11 @@ const char * hb_mixdown_get_short_name_from_mixdown( int amixdown ); *****************************************************************************/ struct hb_job_s { +#if JOB_GROUPS + /* ID assigned by UI so it can lump jobs together */ + int sequence_id; +#endif + /* Pointer to the title to be ripped */ hb_title_t * title; diff --git a/libhb/hb.c b/libhb/hb.c index 94206e053..fbcd81043 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -796,6 +796,7 @@ void hb_start( hb_handle_t * h ) { /* XXX Hack */ h->job_count = hb_list_count( h->jobs ); + h->job_count_permanent = h->job_count; hb_lock( h->state_lock ); h->state.state = HB_STATE_WORKING; diff --git a/libhb/hb.h b/libhb/hb.h index 547718280..6f8af2aee 100644 --- a/libhb/hb.h +++ b/libhb/hb.h @@ -82,6 +82,7 @@ void hb_set_size( hb_job_t *, int ratio, int pixels ); /* Handling jobs */ int hb_count( hb_handle_t * ); hb_job_t * hb_job( hb_handle_t *, int ); +hb_job_t * hb_current_job( hb_handle_t * h ); void hb_add( hb_handle_t *, hb_job_t * ); void hb_rem( hb_handle_t *, hb_job_t * ); diff --git a/macosx/Controller.h b/macosx/Controller.h index 2ef1144fb..733c47338 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -12,7 +12,7 @@ #include "ChapterTitles.h" #include "PictureController.h" -#include "QueueController.h" +#include "HBQueueController.h" #import "MVMenuButton.h" @class HBOutputPanelController; @@ -26,8 +26,7 @@ IBOutlet NSPanel * fPicturePanel; /* Queue panel */ - IBOutlet QueueController * fQueueController; - IBOutlet NSPanel * fQueuePanel; + HBQueueController * fQueueController; IBOutlet NSTextField * fQueueStatus; /* Menu Items */ @@ -160,6 +159,7 @@ IBOutlet NSButton * fAddToQuButton; IBOutlet NSButton * fPauseButton; IBOutlet NSButton * fRipButton; + BOOL fRipIndicatorShown; /* Advanced Tab for opts fX264optView*/ IBOutlet NSView * fX264optView; @@ -238,6 +238,8 @@ NSString * currentSource; HBOutputPanelController *outputPanel; + hb_job_t * fLastKnownCurrentJob; + BOOL startButtonEnabled; BOOL pauseButtonEnabled; BOOL addToQueueButtonEnabled; @@ -283,7 +285,7 @@ - (IBAction) openMainWindow: (id) sender; - (IBAction) addToQueue: (id) sender; -- (IBAction) showQueuePanel: (id) sender; +- (IBAction) showQueueWindow:(id)sender; - (IBAction) Rip: (id) sender; - (void) overWriteAlertDone: (NSWindow *) sheet diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 173a54c5e..3817b1175 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -51,6 +51,26 @@ static NSString* AddToQueueIdentifier = @"Add to Queue Item Identifier" static NSString* DebugOutputIdentifier = @"Debug Output Item Identifier"; static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifier"; +#if JOB_GROUPS +/** + * Returns the number of jobs groups in the queue. + * @param h Handle to hb_handle_t. + * @return Number of job groups. + */ +static int hb_group_count(hb_handle_t * h) +{ + hb_job_t * job; + int count = 0; + int index = 0; + while( ( job = hb_job( h, index++ ) ) ) + { + if (job->sequence_id == 0) + count++; + } + return count; +} +#endif + /******************************* * HBController implementation * *******************************/ @@ -62,6 +82,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie [HBPreferencesController registerUserDefaults]; fHandle = NULL; outputPanel = [[HBOutputPanelController alloc] init]; + fQueueController = [[HBQueueController alloc] init]; return self; } @@ -70,10 +91,6 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie int build; char * version; - // Open debug output window now if it was visible when HB was closed - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"OutputPanelIsOpen"]) - [self showDebugOutputPanel:nil]; - // Init libhb int debugLevel = [[NSUserDefaults standardUserDefaults] boolForKey:@"ShowVerboseOutput"] ? HB_DEBUG_ALL : HB_DEBUG_NONE; fHandle = hb_init(debugLevel, [[NSUserDefaults standardUserDefaults] boolForKey:@"CheckForUpdates"]); @@ -82,7 +99,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie [GrowlApplicationBridge setGrowlDelegate: self]; /* Init others controllers */ [fPictureController SetHandle: fHandle]; - [fQueueController SetHandle: fHandle]; + [fQueueController setHandle: fHandle]; fChapterTitlesDelegate = [[ChapterTitles alloc] init]; [fChapterTable setDataSource:fChapterTitlesDelegate]; @@ -107,6 +124,16 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie } + // Open debug output window now if it was visible when HB was closed + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"OutputPanelIsOpen"]) + [self showDebugOutputPanel:nil]; + + // Open queue window now if it was visible when HB was closed + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"QueueWindowIsOpen"]) + [self showQueueWindow:nil]; + + [self openMainWindow:nil]; + /* Show scan panel ASAP */ [self performSelectorOnMainThread: @selector(showScanPanel:) withObject: NULL waitUntilDone: NO]; @@ -128,6 +155,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie - (void)applicationWillTerminate:(NSNotification *)aNotification { [outputPanel release]; + [fQueueController release]; hb_close(&fHandle); } @@ -150,7 +178,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie /* Init UserPresets .plist */ [self loadPresets]; - + fRipIndicatorShown = NO; // initially out of view in the nib /* Show/Dont Show Presets drawer upon launch based on user preference DefaultPresetsDrawerShow*/ @@ -393,7 +421,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie // Tell the item what message to send when it is clicked [toolbarItem setTarget: self]; - [toolbarItem setAction: @selector(showQueuePanel:)]; + [toolbarItem setAction: @selector(showQueueWindow:)]; } else if ([itemIdent isEqual: AddToQueueIdentifier]) { toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease]; @@ -736,6 +764,21 @@ list = hb_get_titles( fHandle ); [fRipIndicator setIndeterminate: NO]; [fRipIndicator setDoubleValue: 100.0 * progress_total]; + // If progress bar hasn't been revealed at the bottom of the window, do + // that now. This code used to be in _Rip. I moved it to here to handle + // the case where hb_start is called by HBQueueController and not from + // HBController. + if (!fRipIndicatorShown) + { + NSRect frame = [fWindow frame]; + if (frame.size.width <= 591) + frame.size.width = 591; + frame.size.height += 36; + frame.origin.y -= 36; + [fWindow setFrame:frame display:YES animate:YES]; + fRipIndicatorShown = YES; + } + /* Update dock icon */ [self UpdateDockIcon: progress_total]; @@ -749,6 +792,15 @@ list = hb_get_titles( fHandle ); startButtonEnabled = YES; stopOrStart = YES; + // Has current job changed? That means the queue has probably changed as + // well so update it + if (fLastKnownCurrentJob != hb_current_job(fHandle)) + { + fLastKnownCurrentJob = hb_current_job(fHandle); + [fQueueController updateQueueUI]; + } + [fQueueController updateCurrentJobUI]; + break; } #undef p @@ -770,6 +822,8 @@ list = hb_get_titles( fHandle ); /* Update dock icon */ [self UpdateDockIcon: 1.0]; + // Pass along the info to HBQueueController + [fQueueController updateCurrentJobUI]; break; } @@ -786,6 +840,10 @@ list = hb_get_titles( fHandle ); resumeOrPause = YES; startButtonEnabled = YES; stopOrStart = YES; + + // Pass along the info to HBQueueController + [fQueueController updateCurrentJobUI]; + break; case HB_STATE_WORKDONE: @@ -810,19 +868,42 @@ list = hb_get_titles( fHandle ); resumeOrPause = NO; startButtonEnabled = YES; stopOrStart = NO; - NSRect frame = [fWindow frame]; - if (frame.size.width <= 591) - frame.size.width = 591; - frame.size.height += -36; - frame.origin.y -= -36; - [fWindow setFrame:frame display:YES animate:YES]; - + +#if JOB_GROUPS + hb_job_t * job; + while( ( job = hb_job( fHandle, 0 ) ) && (job->sequence_id != 0) ) + hb_rem( fHandle, job ); + // Start processing back up if jobs still left in queue + if (hb_count(fHandle) > 0) + { + hb_start(fHandle); + break; + } +#else /* FIXME */ hb_job_t * job; while( ( job = hb_job( fHandle, 0 ) ) ) { hb_rem( fHandle, job ); } +#endif + + if (fRipIndicatorShown) + { + NSRect frame = [fWindow frame]; + if (frame.size.width <= 591) + frame.size.width = 591; + frame.size.height += -36; + frame.origin.y -= -36; + [fWindow setFrame:frame display:YES animate:YES]; + fRipIndicatorShown = NO; + } + + // Queue has been modified so update the UI + fLastKnownCurrentJob = nil; + [fQueueController updateQueueUI]; + [fQueueController updateCurrentJobUI]; + /* Check to see if the encode state has not been cancelled to determine if we should check for encode done notifications */ if (fEncodeState != 2) { @@ -896,7 +977,11 @@ list = hb_get_titles( fHandle ); /* Lets show the queue status here in the main window*/ +#if JOB_GROUPS + int queue_count = hb_group_count( fHandle ); +#else int queue_count = hb_count( fHandle ); +#endif if( queue_count ) { [fQueueStatus setStringValue: [NSString stringWithFormat: @@ -1350,19 +1435,6 @@ list = hb_get_titles( fHandle ); [self calculatePictureSizing: sender]; } -- (IBAction) showQueuePanel: (id) sender -{ - /* Update the OutlineView */ - [fQueueController Update: sender]; - - /* Show the panel */ - [NSApp beginSheet: fQueuePanel modalForWindow: fWindow - modalDelegate: NULL didEndSelector: NULL contextInfo: NULL]; - [NSApp runModalForWindow: fQueuePanel]; - [NSApp endSheet: fQueuePanel]; - [fQueuePanel orderOut: self]; -} - - (void) PrepareJob { hb_list_t * list = hb_get_titles( fHandle ); @@ -1597,6 +1669,12 @@ list = hb_get_titles( fHandle ); [fSrcTitlePopUp indexOfSelectedItem] ); hb_job_t * job = title->job; +#if JOB_GROUPS + // Assign a sequence number, starting at zero, to each job added so they can + // be lumped together in the UI. + job->sequence_id = -1; +#endif + [self PrepareJob]; /* Destination file */ @@ -1634,6 +1712,9 @@ list = hb_get_titles( fHandle ); /* * Add the pre-scan job */ +#if JOB_GROUPS + job->sequence_id++; +#endif hb_add( fHandle, job ); job->x264opts = x264opts_tmp; @@ -1658,7 +1739,13 @@ list = hb_get_titles( fHandle ); job->subtitle_scan = 0; job->pass = 1; +#if JOB_GROUPS + job->sequence_id++; +#endif hb_add( fHandle, job ); +#if JOB_GROUPS + job->sequence_id++; +#endif job->pass = 2; job->x264opts = (char *)calloc(1024, 1); /* Fixme, this just leaks */ @@ -1672,13 +1759,16 @@ list = hb_get_titles( fHandle ); { job->subtitle_scan = 0; job->pass = 0; +#if JOB_GROUPS + job->sequence_id++; +#endif hb_add( fHandle, job ); } [[NSUserDefaults standardUserDefaults] setObject:destinationDirectory forKey:@"LastDestinationDirectory"]; /* Lets try to update stuff, taken from remove in the queue controller */ - [fQueueController performSelectorOnMainThread: @selector( Update: ) - withObject: sender waitUntilDone: NO]; + [fQueueController performSelectorOnMainThread: @selector( updateQueueUI ) + withObject: NULL waitUntilDone: NO]; } } @@ -1769,12 +1859,14 @@ list = hb_get_titles( fHandle ); [fMenuPauseEncode setEnabled: YES]; +/* Moved this to updateUI NSRect frame = [fWindow frame]; if (frame.size.width <= 591) frame.size.width = 591; frame.size.height += 36; frame.origin.y -= 36; [fWindow setFrame:frame display:YES animate:YES]; +*/ } - (IBAction) Cancel: (id) sender @@ -5539,4 +5631,12 @@ id theRecord, theValue; [controller release]; } +/** + * Shows queue window. + */ +- (IBAction) showQueueWindow:(id)sender +{ + [fQueueController showQueueWindow:sender]; +} + @end diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index d19965038..c813db235 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -42,7 +42,7 @@ showNewScan = id; showPicturePanel = id; showPreferencesWindow = id; - showQueuePanel = id; + showQueueWindow = id; showScanPanel = id; subtitleSelectionChanged = id; tableViewSelected = id; @@ -131,8 +131,6 @@ fPresetsActionMenu = NSMenu; fPresetsAdd = NSButton; fPresetsDelete = NSButton; - fQueueController = QueueController; - fQueuePanel = NSPanel; fQueueStatus = NSTextField; fRipIndicator = NSProgressIndicator; fScanController = ScanController; diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index 9d4ffd2b4..d9eb9f92d 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -11,7 +11,7 @@ 2436 307 361 192 68 0 0 1440 878 29 - 631 290 368 44 0 0 1440 878 + 772 342 368 44 0 0 1680 1028 IBFramework Version 446.1 @@ -25,11 +25,6 @@ IBOldestOS 4 - IBOpenObjects - - 21 - 29 - IBSystem Version 8R2218 IBUserGuides diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib index 36f13e59f..acacaf066 100644 Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/macosx/English.lproj/Queue.nib/classes.nib b/macosx/English.lproj/Queue.nib/classes.nib new file mode 100644 index 000000000..420f84df2 --- /dev/null +++ b/macosx/English.lproj/Queue.nib/classes.nib @@ -0,0 +1,370 @@ +{ + IBClasses = ( + { + ACTIONS = { + Cancel = id; + Pause = id; + Rip = id; + X264AdvancedOptionsChanged = id; + X264AdvancedOptionsSet = id; + X264AdvancedOptionsSetCurrentSettings = id; + X264AdvancedOptionsStandardizeOptString = id; + addAllAudioTracksToPopUp = id; + addFactoryPresets = id; + addToQueue = id; + addUserPreset = id; + audioTrackMixdownChanged = id; + audioTrackPopUpChanged = id; + browseFile = id; + calculateBitrate = id; + calculatePictureSizing = id; + chapterPopUpChanged = id; + closeAddPresetPanel = id; + codecsPopUpChanged = id; + customSettingUsed = id; + deleteFactoryPresets = id; + deletePreset = id; + encoderPopUpChanged = id; + formatPopUpChanged = id; + insertPreset = id; + openForums = id; + openHomepage = id; + openMainWindow = id; + openUserGuide = id; + qualitySliderChanged = id; + revertPictureSizeToMax = id; + selectDefaultPreset = id; + setDefaultPreset = id; + setEnabledStateOfAudioMixdownControls = id; + showAddPresetPanel = id; + showDebugOutputPanel = id; + showGrowlDoneNotification = id; + showNewScan = id; + showPicturePanel = id; + showPreferencesWindow = id; + showQueuePanel = id; + showScanPanel = id; + subtitleSelectionChanged = id; + tableViewSelected = id; + titlePopUpChanged = id; + twoPassCheckboxChanged = id; + videoFrameRateChanged = id; + videoMatrixChanged = id; + }; + CLASS = HBController; + LANGUAGE = ObjC; + OUTLETS = { + fAddPresetPanel = NSPanel; + fAudBitrateField = NSTextField; + fAudBitratePopUp = NSPopUpButton; + fAudLang1Field = NSTextField; + fAudLang1PopUp = NSPopUpButton; + fAudLang2Field = NSTextField; + fAudLang2PopUp = NSPopUpButton; + fAudRateField = NSTextField; + fAudRatePopUp = NSPopUpButton; + fAudTrack1MixLabel = NSTextField; + fAudTrack1MixPopUp = NSPopUpButton; + fAudTrack2MixLabel = NSTextField; + fAudTrack2MixPopUp = NSPopUpButton; + fChapterTable = NSTableView; + fCreateChapterMarkers = NSButton; + fDisplayX264Options = NSTextField; + fDisplayX264OptionsLabel = NSTextField; + fDstBrowseButton = NSButton; + fDstCodecsField = NSTextField; + fDstCodecsPopUp = NSPopUpButton; + fDstFile1Field = NSTextField; + fDstFile2Field = NSTextField; + fDstFormatField = NSTextField; + fDstFormatPopUp = NSPopUpButton; + fDstMpgLargeFileCheck = NSButton; + fMenuActivityWindowShow = NSMenuItem; + fMenuAddToQueue = NSMenuItem; + fMenuBarFileMenu = NSMenu; + fMenuBarWindowMenu = NSMenu; + fMenuOpenSource = NSMenuItem; + fMenuPauseEncode = NSMenuItem; + fMenuPicturePanelShow = NSMenuItem; + fMenuPresetsDrawerToggle = NSMenuItem; + fMenuQueuePanelShow = NSMenuItem; + fMenuStartEncode = NSMenuItem; + fPicLabelAnamorphic = NSTextField; + fPicLabelAr = NSTextField; + fPicLabelDeinter = NSTextField; + fPicLabelOutp = NSTextField; + fPicLabelOutputX = NSTextField; + fPicLabelPAROutp = NSTextField; + fPicLabelPAROutputX = NSTextField; + fPicLabelSettings = NSTextField; + fPicLabelSrc = NSTextField; + fPicLabelSrcX = NSTextField; + fPicSettingARkeep = NSTextField; + fPicSettingARkeepDsply = NSTextField; + fPicSettingAutoCrop = NSTextField; + fPicSettingAutoCropDsply = NSTextField; + fPicSettingAutoCropLabel = NSTextField; + fPicSettingDeinterlace = NSTextField; + fPicSettingDeinterlaceDsply = NSTextField; + fPicSettingDenoise = NSTextField; + fPicSettingDenoiseDsply = NSTextField; + fPicSettingDenoiseLabel = NSTextField; + fPicSettingDetelecine = NSTextField; + fPicSettingDetelecineLabel = NSTextField; + fPicSettingHeight = NSTextField; + fPicSettingPAR = NSTextField; + fPicSettingPARDsply = NSTextField; + fPicSettingPARHeight = NSTextField; + fPicSettingPARWidth = NSTextField; + fPicSettingWidth = NSTextField; + fPicSrcHeight = NSTextField; + fPicSrcWidth = NSTextField; + fPictureButton = NSButton; + fPictureController = PictureController; + fPicturePanel = NSPanel; + fPresetDrawer = NSDrawer; + fPresetNewDesc = NSTextField; + fPresetNewName = NSTextField; + fPresetNewPicSettingsPopUp = NSPopUpButton; + fPresetSelectedDisplay = NSTextField; + fPresetsActionButton = MVMenuButton; + fPresetsActionMenu = NSMenu; + fPresetsAdd = NSButton; + fPresetsDelete = NSButton; + fQueueController = QueueController; + fQueuePanel = NSPanel; + fQueueStatus = NSTextField; + fRipIndicator = NSProgressIndicator; + fScanController = ScanController; + fScanIndicator = NSProgressIndicator; + fScanPanel = NSPanel; + fScanStatus = NSTextField; + fSrcChapterEndPopUp = NSPopUpButton; + fSrcChapterField = NSTextField; + fSrcChapterStartPopUp = NSPopUpButton; + fSrcChapterToField = NSTextField; + fSrcDVD1Field = NSTextField; + fSrcDVD2Field = NSTextField; + fSrcDuration1Field = NSTextField; + fSrcDuration2Field = NSTextField; + fSrcTitleField = NSTextField; + fSrcTitlePopUp = NSPopUpButton; + fStatusField = NSTextField; + fSubField = NSTextField; + fSubForcedCheck = NSButton; + fSubPopUp = NSPopUpButton; + fVidBitrateCell = NSButtonCell; + fVidBitrateField = NSTextField; + fVidConstantCell = NSButtonCell; + fVidEncoderField = NSTextField; + fVidEncoderPopUp = NSPopUpButton; + fVidGrayscaleCheck = NSButton; + fVidQualityField = NSTextField; + fVidQualityMatrix = NSMatrix; + fVidQualitySlider = NSSlider; + fVidRateField = NSTextField; + fVidRatePopUp = NSPopUpButton; + fVidTargetCell = NSButtonCell; + fVidTargetSizeField = NSTextField; + fVidTurboPassCheck = NSButton; + fVidTwoPassCheck = NSButton; + fWindow = NSWindow; + fX264opt8x8dctLabel = NSTextField; + fX264opt8x8dctSwitch = NSButton; + fX264optAlphaDeblockPopUp = NSPopUpButton; + fX264optAnalyseLabel = NSTextField; + fX264optAnalysePopUp = NSPopUpButton; + fX264optBPyramidLabel = NSTextField; + fX264optBPyramidSwitch = NSButton; + fX264optBRDOLabel = NSTextField; + fX264optBRDOSwitch = NSButton; + fX264optBetaDeblockPopUp = NSPopUpButton; + fX264optBframesLabel = NSTextField; + fX264optBframesPopUp = NSPopUpButton; + fX264optBiMELabel = NSTextField; + fX264optBiMESwitch = NSButton; + fX264optCabacLabel = NSTextField; + fX264optCabacSwitch = NSButton; + fX264optDeblockLabel = NSTextField; + fX264optDirectPredLabel = NSTextField; + fX264optDirectPredPopUp = NSPopUpButton; + fX264optMERangeLabel = NSTextField; + fX264optMERangePopUp = NSPopUpButton; + fX264optMixedRefsLabel = NSTextField; + fX264optMixedRefsSwitch = NSButton; + fX264optMotionEstLabel = NSTextField; + fX264optMotionEstPopUp = NSPopUpButton; + fX264optNfpskipLabel = NSTextField; + fX264optNfpskipSwitch = NSButton; + fX264optNodctdcmtLabel = NSTextField; + fX264optNodctdcmtSwitch = NSButton; + fX264optRefLabel = NSTextField; + fX264optRefPopUp = NSPopUpButton; + fX264optSubmeLabel = NSTextField; + fX264optSubmePopUp = NSPopUpButton; + fX264optTrellisLabel = NSTextField; + fX264optTrellisPopUp = NSPopUpButton; + fX264optView = NSView; + fX264optViewTitleLabel = NSTextField; + fX264optWeightBLabel = NSTextField; + fX264optWeightBSwitch = NSButton; + tableView = NSTableView; + }; + SUPERCLASS = NSObject; + }, + {CLASS = HBPictureGLView; LANGUAGE = ObjC; SUPERCLASS = NSOpenGLView; }, + { + ACTIONS = { + cancelCurrentJob = id; + detailChanged = id; + removeSelectedJob = id; + showQueueWindow = id; + toggleStartPause = id; + }; + CLASS = HBQueueController; + LANGUAGE = ObjC; + OUTLETS = { + fCurrentJobPane = NSView; + fDetailCheckbox = NSButton; + fJobDescTextField = NSTextField; + fProgressBar = NSProgressIndicator; + fProgressStatus = NSTextField; + fProgressTimeRemaining = NSTextField; + fQueueCountField = NSTextField; + fQueuePane = NSView; + fQueueWindow = NSWindow; + fStartPauseButton = NSButton; + fTaskView = NSTableView; + }; + SUPERCLASS = NSObject; + }, + { + CLASS = HBTargetSizeField; + LANGUAGE = ObjC; + OUTLETS = { + fRipAudBitPopUp = NSPopUpButton; + fRipCustomField = NSTextField; + fRipFormatPopUp = NSPopUpButton; + fRipLang2PopUp = NSPopUpButton; + }; + SUPERCLASS = NSTextField; + }, + {CLASS = MVMenuButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, + { + ACTIONS = { + ClosePanel = id; + NextPicture = id; + PreviousPicture = id; + SettingsChanged = id; + }; + CLASS = PictureController; + LANGUAGE = ObjC; + OUTLETS = { + fAutoCropMainWindow = NSTextField; + fCropBottomField = NSTextField; + fCropBottomStepper = NSStepper; + fCropLeftField = NSTextField; + fCropLeftStepper = NSStepper; + fCropMatrix = NSMatrix; + fCropRightField = NSTextField; + fCropRightStepper = NSStepper; + fCropTopField = NSTextField; + fCropTopStepper = NSStepper; + fDeinterlaceLevelMainWindow = NSTextField; + fDeinterlacePopUp = NSPopUpButton; + fDenoiseMainWindow = NSTextField; + fDenoisePopUp = NSPopUpButton; + fDetelecineCheck = NSButton; + fDetelecineMainWindow = NSTextField; + fEffectsCheck = NSButton; + fHeightField = NSTextField; + fHeightStepper = NSStepper; + fInfoField = NSTextField; + fNextButton = NSButton; + fPARCheck = NSButton; + fPicSettingARkeep = NSTextField; + fPicSettingDeinterlace = NSTextField; + fPicSettingHeight = NSTextField; + fPicSettingWidth = NSTextField; + fPicSettingsDisplay = NSTextField; + fPicSrcHeight = NSTextField; + fPicSrcWidth = NSTextField; + fPictureGLView = HBPictureGLView; + fPrevButton = NSButton; + fRatioCheck = NSButton; + fVidFrameRatePopUpMainWindow = NSPopUpButton; + fWidthField = NSTextField; + fWidthStepper = NSStepper; + }; + SUPERCLASS = NSObject; + }, + {CLASS = PictureGLView; LANGUAGE = ObjC; SUPERCLASS = NSOpenGLView; }, + { + ACTIONS = {CheckChanged = id; ClosePanel = id; OpenPanel = id; }; + CLASS = PrefsController; + LANGUAGE = ObjC; + OUTLETS = { + fDefAdvancedx264FlagsShow = NSButton; + fDefAdvancedx264FlagsView = NSTextField; + fDefAutoNaming = NSButton; + fDefChapterMarkers = NSButton; + fDefCrf = NSButton; + fDefDeinterlace = NSButton; + fDefPicSizeAutoSetipod = NSButton; + fDefPixelRatio = NSButton; + fDefPresetDrawerShow = NSButton; + fFileExtItunes = NSButton; + fPanel = NSPanel; + fUpdateCheck = NSButton; + fdefaultlanguage = NSComboBox; + }; + SUPERCLASS = NSObject; + }, + { + ACTIONS = {detailChanged = id; removeTask = id; showQueueWindow = id; }; + CLASS = QueueController; + LANGUAGE = ObjC; + OUTLETS = { + fCurrentJobPane = NSView; + fDetailCheckbox = NSButton; + fJobDescTextField = NSTextField; + fProgressBar = NSProgressIndicator; + fProgressStatus = NSTextField; + fProgressTimeRemaining = NSTextField; + fQueueCountField = NSTextField; + fQueuePane = NSView; + fQueueWindow = NSWindow; + fTaskView = NSTableView; + }; + SUPERCLASS = NSObject; + }, + { + CLASS = ScanController; + LANGUAGE = ObjC; + OUTLETS = { + fBrowseButton = NSButton; + fCancelButton = NSButton; + fDetectedCell = NSButtonCell; + fDetectedPopUp = NSPopUpButton; + fFolderCell = NSButtonCell; + fFolderField = NSTextField; + fIndicator = NSProgressIndicator; + fMainMenuAddToQueue = NSMenuItem; + fMainMenuOpenSource = NSMenuItem; + fMainMenuPauseEncode = NSMenuItem; + fMainMenuStartEncode = NSMenuItem; + fMainWindowSrcName = NSTextField; + fMatrix = NSMatrix; + fMenuPicturePanelShow = NSMenuItem; + fMenuQueuePanelShow = NSMenuItem; + fOpenButton = NSButton; + fPanel = NSPanel; + fSelectString = NSTextField; + fStatusField = NSTextField; + fWindow = NSWindow; + }; + SUPERCLASS = NSObject; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/macosx/English.lproj/Queue.nib/info.nib b/macosx/English.lproj/Queue.nib/info.nib new file mode 100644 index 000000000..4bd1dba9d --- /dev/null +++ b/macosx/English.lproj/Queue.nib/info.nib @@ -0,0 +1,28 @@ + + + + + IBDocumentLocation + 483 594 453 434 0 0 1680 1028 + IBFramework Version + 446.1 + IBLockedObjects + + 2382 + + IBLockedTabItems + + 1477 + + IBOldestOS + 4 + IBOpenObjects + + 2576 + + IBSystem Version + 8R2218 + IBUsesTextArchiving + + + diff --git a/macosx/English.lproj/Queue.nib/keyedobjects.nib b/macosx/English.lproj/Queue.nib/keyedobjects.nib new file mode 100644 index 000000000..e0811e93e --- /dev/null +++ b/macosx/English.lproj/Queue.nib/keyedobjects.nib @@ -0,0 +1,3615 @@ + + + + + $archiver + NSKeyedArchiver + $objects + + $null + + $class + + CF$UID + 257 + + NSAccessibilityConnectors + + CF$UID + 254 + + NSAccessibilityOidsKeys + + CF$UID + 255 + + NSAccessibilityOidsValues + + CF$UID + 256 + + NSClassesKeys + + CF$UID + 211 + + NSClassesValues + + CF$UID + 212 + + NSConnections + + CF$UID + 9 + + NSFontManager + + CF$UID + 0 + + NSFramework + + CF$UID + 5 + + NSNamesKeys + + CF$UID + 197 + + NSNamesValues + + CF$UID + 198 + + NSNextOid + 2587 + NSObjectsKeys + + CF$UID + 194 + + NSObjectsValues + + CF$UID + 196 + + NSOidsKeys + + CF$UID + 213 + + NSOidsValues + + CF$UID + 214 + + NSRoot + + CF$UID + 2 + + NSVisibleWindows + + CF$UID + 7 + + + + $class + + CF$UID + 4 + + NSClassName + + CF$UID + 3 + + + HBQueueController + + $classes + + NSCustomObject + NSObject + + $classname + NSCustomObject + + + $class + + CF$UID + 6 + + NS.string + IBCocoaFramework + + + $classes + + NSMutableString + NSString + NSObject + + $classname + NSMutableString + + + $class + + CF$UID + 8 + + NS.objects + + + + $classes + + NSMutableSet + NSSet + NSObject + + $classname + NSMutableSet + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 10 + + + CF$UID + 78 + + + CF$UID + 149 + + + CF$UID + 151 + + + CF$UID + 153 + + + CF$UID + 155 + + + CF$UID + 157 + + + CF$UID + 159 + + + CF$UID + 161 + + + CF$UID + 163 + + + CF$UID + 166 + + + CF$UID + 168 + + + CF$UID + 170 + + + CF$UID + 172 + + + CF$UID + 187 + + + CF$UID + 188 + + + CF$UID + 190 + + + CF$UID + 192 + + + + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 11 + + NSLabel + + CF$UID + 76 + + NSSource + + CF$UID + 2 + + + + $class + + CF$UID + 75 + + NSClassName + + CF$UID + 73 + + NSExtension + + CF$UID + 74 + + NSFrame + + CF$UID + 72 + + NSNextResponder + + CF$UID + 12 + + NSSubviews + + CF$UID + 13 + + NSSuperview + + CF$UID + 12 + + NSvFlags + 10 + + + $class + + CF$UID + 180 + + NSFrame + + CF$UID + 179 + + NSNextResponder + + CF$UID + 0 + + NSSubviews + + CF$UID + 178 + + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 14 + + + CF$UID + 19 + + + CF$UID + 36 + + + CF$UID + 40 + + + CF$UID + 56 + + + CF$UID + 61 + + + + + $class + + CF$UID + 18 + + NSDrawMatrix + + CF$UID + 15 + + NSFrame + + CF$UID + 17 + + NSMaxValue + 100 + NSNextResponder + + CF$UID + 11 + + NSSuperview + + CF$UID + 11 + + NSpiFlags + 10 + NSvFlags + 1290 + + + $class + + CF$UID + 16 + + + + $classes + + NSPSMatrix + NSObject + + $classname + NSPSMatrix + + {{90, 4}, {442, 20}} + + $classes + + NSProgressIndicator + NSView + NSResponder + NSObject + + $classname + NSProgressIndicator + + + $class + + CF$UID + 35 + + NSCell + + CF$UID + 21 + + NSEnabled + + NSFrame + + CF$UID + 20 + + NSNextResponder + + CF$UID + 11 + + NSSuperview + + CF$UID + 11 + + NSvFlags + 268 + + {{89, 28}, {154, 14}} + + $class + + CF$UID + 34 + + NSBackgroundColor + + CF$UID + 26 + + NSCellFlags + 67239424 + NSCellFlags2 + 272629760 + NSContents + + CF$UID + 22 + + NSControlView + + CF$UID + 19 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 31 + + + + + $class + + CF$UID + 25 + + NSName + + CF$UID + 24 + + NSSize + 11 + NSfFlags + 3100 + + LucidaGrande + + $classes + + NSFont + NSObject + + $classname + NSFont + + + $class + + CF$UID + 30 + + NSCatalogName + + CF$UID + 27 + + NSColor + + CF$UID + 29 + + NSColorName + + CF$UID + 28 + + NSColorSpace + 6 + + System + controlColor + + $class + + CF$UID + 30 + + NSColorSpace + 3 + NSWhite + + MC42NjY2NjY2OQA= + + + + $classes + + NSColor + NSObject + + $classname + NSColor + + + $class + + CF$UID + 30 + + NSCatalogName + + CF$UID + 27 + + NSColor + + CF$UID + 33 + + NSColorName + + CF$UID + 32 + + NSColorSpace + 6 + + controlTextColor + + $class + + CF$UID + 30 + + NSColorSpace + 3 + NSWhite + + MAA= + + + + $classes + + NSTextFieldCell + NSActionCell + NSCell + NSObject + + $classname + NSTextFieldCell + + + $classes + + NSTextField + %NSTextField + NSControl + NSView + NSResponder + NSObject + + $classname + NSTextField + + + $class + + CF$UID + 35 + + NSCell + + CF$UID + 38 + + NSEnabled + + NSFrame + + CF$UID + 37 + + NSNextResponder + + CF$UID + 11 + + NSSuperview + + CF$UID + 11 + + NSvFlags + 266 + + {{245, 28}, {288, 14}} + + $class + + CF$UID + 34 + + NSBackgroundColor + + CF$UID + 26 + + NSCellFlags + 67239424 + NSCellFlags2 + 71303168 + NSContents + + CF$UID + 39 + + NSControlView + + CF$UID + 36 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 31 + + + Time Remaining: Calculating... + + $class + + CF$UID + 55 + + NSCell + + CF$UID + 49 + + NSDragTypes + + CF$UID + 41 + + NSEditable + + NSEnabled + + NSFrame + + CF$UID + 48 + + NSNextResponder + + CF$UID + 11 + + NSSuperview + + CF$UID + 11 + + NSvFlags + 268 + + + $class + + CF$UID + 8 + + NS.objects + + + CF$UID + 42 + + + CF$UID + 43 + + + CF$UID + 44 + + + CF$UID + 45 + + + CF$UID + 46 + + + CF$UID + 47 + + + + Apple PDF pasteboard type + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + Apple PICT pasteboard type + NSFilenamesPboardType + Apple PNG pasteboard type + {{20, 92}, {64, 64}} + + $class + + CF$UID + 54 + + NSAlign + 0 + NSAnimates + + NSCellFlags + 130560 + NSCellFlags2 + 33554432 + NSContents + + CF$UID + 50 + + NSScale + 0 + NSStyle + 0 + + + $class + + CF$UID + 53 + + NSClassName + + CF$UID + 51 + + NSResourceName + + CF$UID + 52 + + + NSImage + JobLarge + + $classes + + NSCustomResource + %NSCustomResource + NSObject + + $classname + NSCustomResource + + + $classes + + NSImageCell + %NSImageCell + NSCell + NSObject + + $classname + NSImageCell + + + $classes + + NSImageView + NSControl + NSView + NSResponder + NSObject + + $classname + NSImageView + + + $class + + CF$UID + 35 + + NSCell + + CF$UID + 58 + + NSEnabled + + NSFrame + + CF$UID + 57 + + NSNextResponder + + CF$UID + 11 + + NSSuperview + + CF$UID + 11 + + NSvFlags + 266 + + {{89, 46}, {468, 110}} + + $class + + CF$UID + 34 + + NSBackgroundColor + + CF$UID + 26 + + NSCellFlags + 67239424 + NSCellFlags2 + 272629760 + NSContents + + CF$UID + 59 + + NSControlView + + CF$UID + 56 + + NSSupport + + CF$UID + 60 + + NSTextColor + + CF$UID + 31 + + + No job processing + + $class + + CF$UID + 25 + + NSName + + CF$UID + 24 + + NSSize + 13 + NSfFlags + 1044 + + + $class + + CF$UID + 70 + + NSCell + + CF$UID + 63 + + NSEnabled + + NSFrame + + CF$UID + 62 + + NSNextResponder + + CF$UID + 11 + + NSSuperview + + CF$UID + 11 + + NSvFlags + 265 + + {{538, 8}, {16, 18}} + + $class + + CF$UID + 69 + + NSAlternateContents + + CF$UID + 22 + + NSAlternateImage + + CF$UID + 66 + + NSButtonFlags + 138690815 + NSButtonFlags2 + 34 + NSCellFlags + 67239424 + NSCellFlags2 + 134217728 + NSContents + + CF$UID + 22 + + NSControlView + + CF$UID + 61 + + NSKeyEquivalent + + CF$UID + 68 + + NSNormalImage + + CF$UID + 64 + + NSPeriodicDelay + 200 + NSPeriodicInterval + 25 + NSSupport + + CF$UID + 60 + + + + $class + + CF$UID + 53 + + NSClassName + + CF$UID + 51 + + NSResourceName + + CF$UID + 65 + + + Delete + + $class + + CF$UID + 53 + + NSClassName + + CF$UID + 51 + + NSResourceName + + CF$UID + 67 + + + DeletePressed + + $class + + CF$UID + 6 + + NS.string + + + + $classes + + NSButtonCell + %NSButtonCell + NSActionCell + NSCell + NSObject + + $classname + NSButtonCell + + + $classes + + NSButton + NSControl + NSView + NSResponder + NSObject + + $classname + NSButton + + + $classes + + NSMutableArray + NSArray + NSObject + + $classname + NSMutableArray + + {{0, 257}, {574, 176}} + NSView + NSResponder + + $classes + + NSCustomView + NSView + NSResponder + NSObject + + $classname + NSCustomView + + fCurrentJobPane + + $classes + + NSNibOutletConnector + NSNibConnector + NSObject + + $classname + NSNibOutletConnector + + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 79 + + NSLabel + + CF$UID + 148 + + NSSource + + CF$UID + 2 + + + + $class + + CF$UID + 75 + + NSClassName + + CF$UID + 73 + + NSExtension + + CF$UID + 74 + + NSFrameSize + + CF$UID + 147 + + NSNextResponder + + CF$UID + 12 + + NSSubviews + + CF$UID + 80 + + NSSuperview + + CF$UID + 12 + + NSvFlags + 18 + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 81 + + + CF$UID + 85 + + + CF$UID + 134 + + + CF$UID + 141 + + + + + $class + + CF$UID + 35 + + NSCell + + CF$UID + 83 + + NSEnabled + + NSFrame + + CF$UID + 82 + + NSNextResponder + + CF$UID + 79 + + NSSuperview + + CF$UID + 79 + + NSvFlags + 264 + + {{59, 227}, {253, 14}} + + $class + + CF$UID + 34 + + NSBackgroundColor + + CF$UID + 26 + + NSCellFlags + 67239424 + NSCellFlags2 + 272760832 + NSContents + + CF$UID + 84 + + NSControlView + + CF$UID + 81 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 31 + + + Pending Jobs + + $class + + CF$UID + 133 + + NSContentView + + CF$UID + 87 + + NSFrame + + CF$UID + 132 + + NSHScroller + + CF$UID + 129 + + NSNextKeyView + + CF$UID + 87 + + NSNextResponder + + CF$UID + 79 + + NSScrollAmts + + AAAAAAAAAABBmAAAQZgAAA== + + NSSubviews + + CF$UID + 86 + + NSSuperview + + CF$UID + 79 + + NSVScroller + + CF$UID + 125 + + NSsFlags + 18 + NSvFlags + 274 + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 87 + + + CF$UID + 125 + + + CF$UID + 129 + + + + + $class + + CF$UID + 124 + + NSBGColor + + CF$UID + 112 + + NSDocView + + CF$UID + 89 + + NSFrame + + CF$UID + 123 + + NSNextKeyView + + CF$UID + 89 + + NSNextResponder + + CF$UID + 85 + + NSSubviews + + CF$UID + 88 + + NSSuperview + + CF$UID + 85 + + NScvFlags + 4 + NSvFlags + 2304 + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 89 + + + + + $class + + CF$UID + 122 + + NSBackgroundColor + + CF$UID + 100 + + NSColumnAutoresizingStyle + 1 + NSCornerView + + CF$UID + 91 + + NSDraggingSourceMaskForLocal + 15 + NSDraggingSourceMaskForNonLocal + 0 + NSEnabled + + NSFrameSize + + CF$UID + 90 + + NSGridColor + + CF$UID + 119 + + NSIntercellSpacingHeight + 2 + NSIntercellSpacingWidth + 3 + NSNextResponder + + CF$UID + 87 + + NSRowHeight + 17 + NSSuperview + + CF$UID + 87 + + NSTableColumns + + CF$UID + 94 + + NSTvFlags + 314605568 + NSvFlags + 4352 + + {517, 190} + + $class + + CF$UID + 93 + + NSFrame + + CF$UID + 92 + + NSNextResponder + + CF$UID + 0 + + NSvFlags + 256 + + {{518, 0}, {16, 17}} + + $classes + + _NSCornerView + NSView + NSResponder + NSObject + + $classname + _NSCornerView + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 95 + + + CF$UID + 106 + + + CF$UID + 114 + + + + + $class + + CF$UID + 105 + + NSDataCell + + CF$UID + 104 + + NSHeaderCell + + CF$UID + 97 + + NSIdentifier + + CF$UID + 96 + + NSIsEditable + + NSMaxWidth + 20 + NSMinWidth + 20 + NSTableView + + CF$UID + 89 + + NSWidth + 20 + + icon + + $class + + CF$UID + 103 + + NSBackgroundColor + + CF$UID + 98 + + NSCellFlags + 67239424 + NSCellFlags2 + 134217728 + NSContents + + CF$UID + 22 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 101 + + + + $class + + CF$UID + 30 + + NSCatalogName + + CF$UID + 27 + + NSColor + + CF$UID + 100 + + NSColorName + + CF$UID + 99 + + NSColorSpace + 6 + + headerColor + + $class + + CF$UID + 30 + + NSColorSpace + 3 + NSWhite + + MQA= + + + + $class + + CF$UID + 30 + + NSCatalogName + + CF$UID + 27 + + NSColor + + CF$UID + 33 + + NSColorName + + CF$UID + 102 + + NSColorSpace + 6 + + headerTextColor + + $classes + + NSTableHeaderCell + NSTextFieldCell + NSActionCell + NSCell + NSObject + + $classname + NSTableHeaderCell + + + $class + + CF$UID + 54 + + NSAlign + 1 + NSAnimates + + NSCellFlags + 130560 + NSCellFlags2 + 33554432 + NSScale + 2 + NSStyle + 0 + + + $classes + + NSTableColumn + NSObject + + $classname + NSTableColumn + + + $class + + CF$UID + 105 + + NSDataCell + + CF$UID + 111 + + NSHeaderCell + + CF$UID + 108 + + NSIdentifier + + CF$UID + 107 + + NSIsResizeable + + NSMaxWidth + 9000 + NSMinWidth + 40 + NSResizingMask + 1 + NSTableView + + CF$UID + 89 + + NSWidth + 468 + + desc + + $class + + CF$UID + 103 + + NSBackgroundColor + + CF$UID + 110 + + NSCellFlags + 75628032 + NSCellFlags2 + 0 + NSContents + + CF$UID + 109 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 101 + + + Job + + $class + + CF$UID + 30 + + NSColorSpace + 3 + NSWhite + + MC4zMzMzMzI5OQA= + + + + $class + + CF$UID + 34 + + NSBackgroundColor + + CF$UID + 112 + + NSCellFlags + 337772096 + NSCellFlags2 + 2048 + NSControlView + + CF$UID + 89 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 31 + + + + $class + + CF$UID + 30 + + NSCatalogName + + CF$UID + 27 + + NSColor + + CF$UID + 29 + + NSColorName + + CF$UID + 113 + + NSColorSpace + 6 + + controlBackgroundColor + + $class + + CF$UID + 105 + + NSDataCell + + CF$UID + 117 + + NSHeaderCell + + CF$UID + 116 + + NSIdentifier + + CF$UID + 115 + + NSMaxWidth + 1000 + NSMinWidth + 4 + NSTableView + + CF$UID + 89 + + NSWidth + 20 + + delete + + $class + + CF$UID + 103 + + NSBackgroundColor + + CF$UID + 98 + + NSCellFlags + 67239424 + NSCellFlags2 + 134217728 + NSContents + + CF$UID + 22 + + NSSupport + + CF$UID + 23 + + NSTextColor + + CF$UID + 101 + + + + $class + + CF$UID + 69 + + NSAlternateContents + + CF$UID + 22 + + NSButtonFlags + 135020799 + NSButtonFlags2 + 6 + NSCellFlags + 67239424 + NSCellFlags2 + 134217728 + NSContents + + CF$UID + 22 + + NSControlView + + CF$UID + 89 + + NSKeyEquivalent + + CF$UID + 22 + + NSNormalImage + + CF$UID + 64 + + NSPeriodicDelay + 400 + NSPeriodicInterval + 75 + NSSupport + + CF$UID + 118 + + + + $class + + CF$UID + 25 + + NSName + + CF$UID + 24 + + NSSize + 12 + NSfFlags + 16 + + + $class + + CF$UID + 30 + + NSCatalogName + + CF$UID + 27 + + NSColor + + CF$UID + 121 + + NSColorName + + CF$UID + 120 + + NSColorSpace + 6 + + gridColor + + $class + + CF$UID + 30 + + NSColorSpace + 3 + NSWhite + + MC41AA== + + + + $classes + + NSTableView + %NSTableView + NSControl + NSView + NSResponder + NSObject + + $classname + NSTableView + + {{1, 1}, {517, 190}} + + $classes + + NSClipView + NSView + NSResponder + NSObject + + $classname + NSClipView + + + $class + + CF$UID + 128 + + NSAction + + CF$UID + 127 + + NSFrame + + CF$UID + 126 + + NSNextResponder + + CF$UID + 85 + + NSPercent + 0.93596059083938599 + NSSuperview + + CF$UID + 85 + + NSTarget + + CF$UID + 85 + + NSvFlags + 256 + + {{518, 1}, {15, 190}} + _doScroller: + + $classes + + NSScroller + NSControl + NSView + NSResponder + NSObject + + $classname + NSScroller + + + $class + + CF$UID + 128 + + NSAction + + CF$UID + 131 + + NSFrame + + CF$UID + 130 + + NSNextResponder + + CF$UID + 85 + + NSPercent + 0.88602942228317261 + NSSuperview + + CF$UID + 85 + + NSTarget + + CF$UID + 85 + + NSsFlags + 1 + NSvFlags + -2147483392 + + {{-100, -100}, {482, 11}} + _doScroller: + {{20, 20}, {534, 192}} + + $classes + + NSScrollView + NSView + NSResponder + NSObject + + $classname + NSScrollView + + + $class + + CF$UID + 70 + + NSCell + + CF$UID + 136 + + NSEnabled + + NSFrame + + CF$UID + 135 + + NSNextResponder + + CF$UID + 79 + + NSSuperview + + CF$UID + 79 + + NSvFlags + 265 + + {{471, 226}, {85, 16}} + + $class + + CF$UID + 69 + + NSAlternateContents + + CF$UID + 22 + + NSAlternateImage + + CF$UID + 138 + + NSButtonFlags + 1211912703 + NSButtonFlags2 + 2 + NSCellFlags + 67239424 + NSCellFlags2 + 131072 + NSContents + + CF$UID + 137 + + NSControlView + + CF$UID + 134 + + NSKeyEquivalent + + CF$UID + 22 + + NSPeriodicDelay + 200 + NSPeriodicInterval + 25 + NSSupport + + CF$UID + 23 + + + Show Detail + + $class + + CF$UID + 140 + + NSImageName + + CF$UID + 139 + + + NSSwitch + + $classes + + NSButtonImageSource + NSObject + + $classname + NSButtonImageSource + + + $class + + CF$UID + 70 + + NSCell + + CF$UID + 143 + + NSEnabled + + NSFrame + + CF$UID + 142 + + NSNextResponder + + CF$UID + 79 + + NSSuperview + + CF$UID + 79 + + NSvFlags + 268 + + {{20, 220}, {34, 32}} + + $class + + CF$UID + 69 + + NSAlternateContents + + CF$UID + 22 + + NSButtonFlags + 138690815 + NSButtonFlags2 + 34 + NSCellFlags + 67239424 + NSCellFlags2 + 134217728 + NSContents + + CF$UID + 22 + + NSControlView + + CF$UID + 141 + + NSKeyEquivalent + + CF$UID + 146 + + NSNormalImage + + CF$UID + 144 + + NSPeriodicDelay + 200 + NSPeriodicInterval + 25 + NSSupport + + CF$UID + 60 + + + + $class + + CF$UID + 53 + + NSClassName + + CF$UID + 51 + + NSResourceName + + CF$UID + 145 + + + Play + + $class + + CF$UID + 6 + + NS.string + + + {574, 257} + fQueuePane + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 14 + + NSLabel + + CF$UID + 150 + + NSSource + + CF$UID + 2 + + + fProgressBar + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 134 + + NSLabel + + CF$UID + 152 + + NSSource + + CF$UID + 2 + + + fDetailCheckbox + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 81 + + NSLabel + + CF$UID + 154 + + NSSource + + CF$UID + 2 + + + fQueueCountField + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 89 + + NSLabel + + CF$UID + 156 + + NSSource + + CF$UID + 2 + + + fTaskView + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 36 + + NSLabel + + CF$UID + 158 + + NSSource + + CF$UID + 2 + + + fProgressTimeRemaining + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 19 + + NSLabel + + CF$UID + 160 + + NSSource + + CF$UID + 2 + + + fProgressStatus + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 56 + + NSLabel + + CF$UID + 162 + + NSSource + + CF$UID + 2 + + + fJobDescTextField + + $class + + CF$UID + 165 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 164 + + NSSource + + CF$UID + 117 + + + removeSelectedJob: + + $classes + + NSNibControlConnector + NSNibConnector + NSObject + + $classname + NSNibControlConnector + + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 167 + + NSSource + + CF$UID + 89 + + + dataSource + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 169 + + NSSource + + CF$UID + 89 + + + delegate + + $class + + CF$UID + 165 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 171 + + NSSource + + CF$UID + 134 + + + detailChanged: + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 173 + + NSLabel + + CF$UID + 186 + + NSSource + + CF$UID + 2 + + + + $class + + CF$UID + 185 + + NSFrameAutosaveName + + CF$UID + 184 + + NSMaxSize + + CF$UID + 183 + + NSMinSize + + CF$UID + 182 + + NSScreenRect + + CF$UID + 181 + + NSViewClass + + CF$UID + 177 + + NSWTFlags + 1886912512 + NSWindowBacking + 2 + NSWindowClass + + CF$UID + 176 + + NSWindowRect + + CF$UID + 174 + + NSWindowStyleMask + 14 + NSWindowTitle + + CF$UID + 175 + + NSWindowView + + CF$UID + 12 + + + {{651, 179}, {574, 433}} + Queue - HandBrake + + $class + + CF$UID + 6 + + NS.string + NSWindow + + + $class + + CF$UID + 6 + + NS.string + View + + + $class + + CF$UID + 71 + + NS.objects + + + CF$UID + 11 + + + CF$UID + 79 + + + + {{1, 9}, {574, 433}} + + $classes + + NSView + NSResponder + NSObject + + $classname + NSView + + {{0, 0}, {1680, 1028}} + {525, 362} + {3.40282e+38, 3.40282e+38} + QueueWindow + + $classes + + NSWindowTemplate + NSObject + + $classname + NSWindowTemplate + + fQueueWindow + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 169 + + NSSource + + CF$UID + 173 + + + + $class + + CF$UID + 77 + + NSDestination + + CF$UID + 141 + + NSLabel + + CF$UID + 189 + + NSSource + + CF$UID + 2 + + + fStartPauseButton + + $class + + CF$UID + 165 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 191 + + NSSource + + CF$UID + 141 + + + toggleStartPause: + + $class + + CF$UID + 165 + + NSDestination + + CF$UID + 2 + + NSLabel + + CF$UID + 193 + + NSSource + + CF$UID + 61 + + + cancelCurrentJob: + + $class + + CF$UID + 195 + + NS.objects + + + CF$UID + 134 + + + CF$UID + 85 + + + CF$UID + 114 + + + CF$UID + 14 + + + CF$UID + 141 + + + CF$UID + 173 + + + CF$UID + 106 + + + CF$UID + 11 + + + CF$UID + 104 + + + CF$UID + 79 + + + CF$UID + 12 + + + CF$UID + 40 + + + CF$UID + 81 + + + CF$UID + 117 + + + CF$UID + 56 + + + CF$UID + 36 + + + CF$UID + 89 + + + CF$UID + 19 + + + CF$UID + 95 + + + CF$UID + 61 + + + + + $classes + + NSArray + NSObject + + $classname + NSArray + + + $class + + CF$UID + 195 + + NS.objects + + + CF$UID + 79 + + + CF$UID + 79 + + + CF$UID + 89 + + + CF$UID + 11 + + + CF$UID + 79 + + + CF$UID + 2 + + + CF$UID + 89 + + + CF$UID + 12 + + + CF$UID + 95 + + + CF$UID + 12 + + + CF$UID + 173 + + + CF$UID + 11 + + + CF$UID + 79 + + + CF$UID + 114 + + + CF$UID + 11 + + + CF$UID + 11 + + + CF$UID + 85 + + + CF$UID + 11 + + + CF$UID + 89 + + + CF$UID + 11 + + + + + $class + + CF$UID + 195 + + NS.objects + + + CF$UID + 2 + + + CF$UID + 14 + + + CF$UID + 61 + + + CF$UID + 19 + + + CF$UID + 36 + + + CF$UID + 56 + + + CF$UID + 89 + + + CF$UID + 141 + + + CF$UID + 173 + + + CF$UID + 81 + + + CF$UID + 106 + + + CF$UID + 134 + + + CF$UID + 85 + + + + + $class + + CF$UID + 195 + + NS.objects + + + CF$UID + 199 + + + CF$UID + 200 + + + CF$UID + 201 + + + CF$UID + 202 + + + CF$UID + 203 + + + CF$UID + 204 + + + CF$UID + 205 + + + CF$UID + 201 + + + CF$UID + 206 + + + CF$UID + 207 + + + CF$UID + 208 + + + CF$UID + 209 + + + CF$UID + 210 + + + + + $class + + CF$UID + 6 + + NS.string + File's Owner + + 1 + NSButton + NSTextField1 + NSTextField11 + NSTextField221 + NSTableView + Window + NSTextField2 + NSTableColumn + NSButton4 + NSScrollView1 + + $class + + CF$UID + 195 + + NS.objects + + + + $class + + CF$UID + 195 + + NS.objects + + + + $class + + CF$UID + 195 + + NS.objects + + + CF$UID + 2 + + + CF$UID + 161 + + + CF$UID + 173 + + + CF$UID + 10 + + + CF$UID + 61 + + + CF$UID + 192 + + + CF$UID + 95 + + + CF$UID + 170 + + + CF$UID + 134 + + + CF$UID + 153 + + + CF$UID + 78 + + + CF$UID + 40 + + + CF$UID + 104 + + + CF$UID + 106 + + + CF$UID + 36 + + + CF$UID + 190 + + + CF$UID + 85 + + + CF$UID + 166 + + + CF$UID + 168 + + + CF$UID + 14 + + + CF$UID + 163 + + + CF$UID + 159 + + + CF$UID + 187 + + + CF$UID + 11 + + + CF$UID + 188 + + + CF$UID + 149 + + + CF$UID + 172 + + + CF$UID + 19 + + + CF$UID + 141 + + + CF$UID + 114 + + + CF$UID + 81 + + + CF$UID + 56 + + + CF$UID + 155 + + + CF$UID + 12 + + + CF$UID + 151 + + + CF$UID + 117 + + + CF$UID + 79 + + + CF$UID + 89 + + + CF$UID + 157 + + + + + $class + + CF$UID + 195 + + NS.objects + + + CF$UID + 215 + + + CF$UID + 216 + + + CF$UID + 217 + + + CF$UID + 218 + + + CF$UID + 219 + + + CF$UID + 220 + + + CF$UID + 221 + + + CF$UID + 222 + + + CF$UID + 223 + + + CF$UID + 224 + + + CF$UID + 225 + + + CF$UID + 226 + + + CF$UID + 227 + + + CF$UID + 228 + + + CF$UID + 229 + + + CF$UID + 230 + + + CF$UID + 231 + + + CF$UID + 232 + + + CF$UID + 233 + + + CF$UID + 234 + + + CF$UID + 235 + + + CF$UID + 236 + + + CF$UID + 237 + + + CF$UID + 238 + + + CF$UID + 239 + + + CF$UID + 240 + + + CF$UID + 241 + + + CF$UID + 242 + + + CF$UID + 243 + + + CF$UID + 244 + + + CF$UID + 245 + + + CF$UID + 246 + + + CF$UID + 247 + + + CF$UID + 248 + + + CF$UID + 249 + + + CF$UID + 250 + + + CF$UID + 251 + + + CF$UID + 252 + + + CF$UID + 253 + + + + 1 + 2568 + 2576 + 2560 + 2584 + 2586 + 2553 + 2572 + 2535 + 2564 + 2561 + 2538 + 2559 + 2519 + 2542 + 2583 + 2517 + 2570 + 2571 + 2539 + 2569 + 2567 + 2579 + 2543 + 2581 + 2562 + 2578 + 2541 + 2580 + 2522 + 2511 + 2515 + 2565 + 2577 + 2563 + 2523 + 2547 + 2518 + 2566 + + $class + + CF$UID + 71 + + NS.objects + + + + $class + + CF$UID + 195 + + NS.objects + + + + $class + + CF$UID + 195 + + NS.objects + + + + $classes + + NSIBObjectData + NSObject + + $classname + NSIBObjectData + + + $top + + IB.objectdata + + CF$UID + 1 + + + $version + 100000 + + diff --git a/macosx/HBQueueController.h b/macosx/HBQueueController.h new file mode 100644 index 000000000..4f7cd3fc1 --- /dev/null +++ b/macosx/HBQueueController.h @@ -0,0 +1,62 @@ +/* HBQueueController + + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + + +#include + +#include "hb.h" + +@interface HBQueueController : NSObject +{ + hb_handle_t *fHandle; + NSViewAnimation *fAnimation; + BOOL fCurrentJobHidden; // YES when fCurrentJobPane has been shifted out of view (see showCurrentJobPane) + + // +---------------fQueueWindow----------------+ + // |+-------------fCurrentJobPane-------------+| + // || || + // || || + // || || + // |+-----------------------------------------+| + // |+---------------fQueuePane----------------+| + // || || + // || || + // || || + // || || + // || || + // || || + // || || + // |+-----------------------------------------+| + // +-------------------------------------------+ + + IBOutlet NSWindow *fQueueWindow; + + // fCurrentJobPane - visible only when processing a job + IBOutlet NSView *fCurrentJobPane; + IBOutlet NSTextField *fJobDescTextField; + IBOutlet NSProgressIndicator *fProgressBar; + IBOutlet NSTextField *fProgressStatus; + IBOutlet NSTextField *fProgressTimeRemaining; + + // fQueuePane - always visible; fills entire window when fCurrentJobPane is hidden + IBOutlet NSView *fQueuePane; + IBOutlet NSTableView *fTaskView; + IBOutlet NSButton *fDetailCheckbox; + IBOutlet NSTextField *fQueueCountField; + IBOutlet NSButton *fStartPauseButton; + +} + +- (void)setHandle: (hb_handle_t *)handle; +- (void)updateQueueUI; +- (void)updateCurrentJobUI; +- (IBAction)removeSelectedJob: (id)sender; +- (IBAction)cancelCurrentJob: (id)sender; +- (IBAction)detailChanged: (id)sender; +- (IBAction)showQueueWindow: (id)sender; +- (IBAction)toggleStartPause: (id)sender; + +@end diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm new file mode 100644 index 000000000..c4dfd5e38 --- /dev/null +++ b/macosx/HBQueueController.mm @@ -0,0 +1,841 @@ +/* HBQueueController + + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +#include "HBQueueController.h" + +#if JOB_GROUPS +/** + * Returns the number of jobs groups in the queue. + * @param h Handle to hb_handle_t. + * @return Number of job groups. + */ +static int hb_group_count(hb_handle_t * h) +{ + hb_job_t * job; + int count = 0; + int index = 0; + while( ( job = hb_job( h, index++ ) ) ) + { + if (job->sequence_id == 0) + count++; + } + return count; +} + +/** + * Returns handle to the first job in the i-th group within the job list. + * @param h Handle to hb_handle_t. + * @param i Index of group. + * @returns Handle to hb_job_t of desired job. + */ +static hb_job_t * hb_group(hb_handle_t * h, int i) +{ + hb_job_t * job; + int count = 0; + int index = 0; + while( ( job = hb_job( h, index++ ) ) ) + { + if (job->sequence_id == 0) + { + if (count == i) + return job; + count++; + } + } + return NULL; +} + +/** + * Removes a groups of jobs from the job list. + * @param h Handle to hb_handle_t. + * @param job Handle to the first job in the group. + */ +static void hb_rem_group( hb_handle_t * h, hb_job_t * job ) +{ + // Find job in list + hb_job_t * j; + int index = 0; + while( ( j = hb_job( h, index ) ) ) + { + if (j == job) + { + // Delete this job plus the following ones in the sequence + hb_rem( h, job ); + while( ( j = hb_job( h, index ) ) && (j->sequence_id != 0) ) + hb_rem( h, j ); + return; + } + else + index++; + } +} + +/** + * Returns handle to the next job after the given job. + * @param h Handle to hb_handle_t. + * @param job Handle to the a job in the group. + * @returns Handle to hb_job_t of desired job or NULL if no such job. + */ +static hb_job_t * hb_next_job( hb_handle_t * h, hb_job_t * job ) +{ + hb_job_t * j = NULL; + int index = 0; + while( ( j = hb_job( h, index++ ) ) ) + { + if (j == job) + return hb_job( h, index+1 ); + } + return NULL; +} + +#endif // JOB_GROUPS + +@implementation HBQueueController + +//------------------------------------------------------------------------------------ +// init +//------------------------------------------------------------------------------------ +- (id)init +{ + if (self = [super init]) + { + // Our defaults + [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: + @"NO", @"QueueWindowIsOpen", + @"NO", @"QueueShowsDetail", + nil]]; + } + return self; +} + +//------------------------------------------------------------------------------------ +// dealloc +//------------------------------------------------------------------------------------ +- (void)dealloc +{ + [fAnimation release]; + + // clear the delegate so that windowWillClose is not attempted + if ([fQueueWindow delegate] == self) + [fQueueWindow setDelegate:nil]; + + [super dealloc]; +} + +//------------------------------------------------------------------------------------ +// Receive HB handle +//------------------------------------------------------------------------------------ +- (void)setHandle: (hb_handle_t *)handle +{ + fHandle = handle; +} + +//------------------------------------------------------------------------------------ +// Displays and brings the queue window to the front +//------------------------------------------------------------------------------------ +- (IBAction) showQueueWindow: (id)sender +{ + if (!fQueueWindow) + { + BOOL loadSucceeded = [NSBundle loadNibNamed:@"Queue" owner:self] && fQueueWindow; + NSAssert(loadSucceeded, @"Could not open Queue nib file"); + } + + [self updateQueueUI]; + [self updateCurrentJobUI]; + + [fQueueWindow makeKeyAndOrderFront: self]; + + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"QueueWindowIsOpen"]; +} +//------------------------------------------------------------------------------------ +// Show or hide the current job pane (fCurrentJobPane). +//------------------------------------------------------------------------------------ +- (void) showCurrentJobPane: (BOOL)showPane +{ + if (showPane != fCurrentJobHidden) + return; + + // Things to keep in mind: + // - When the current job pane is shown, it occupies the upper portion of the + // window with the queue occupying the bottom portion of the window. + // - When the current job pane is hidden, it slides up and out of view. + // NSView setHidden is NOT used. The queue pane is resized to occupy the full + // window. + + NSRect windowFrame = [[fCurrentJobPane superview] frame]; + NSRect queueFrame, jobFrame; + if (showPane) + NSDivideRect(windowFrame, &jobFrame, &queueFrame, NSHeight([fCurrentJobPane frame]), NSMaxYEdge); + else + { + queueFrame = windowFrame; + jobFrame = [fCurrentJobPane frame]; + jobFrame.origin.y = NSHeight(windowFrame); + } + + // Move fCurrentJobPane + NSDictionary * dict1 = [NSDictionary dictionaryWithObjectsAndKeys: + fCurrentJobPane, NSViewAnimationTargetKey, + [NSValue valueWithRect:jobFrame], NSViewAnimationEndFrameKey, + nil]; + + // Resize fQueuePane + NSDictionary * dict2 = [NSDictionary dictionaryWithObjectsAndKeys: + fQueuePane, NSViewAnimationTargetKey, + [NSValue valueWithRect:queueFrame], NSViewAnimationEndFrameKey, + nil]; + + if (!fAnimation) + fAnimation = [[NSViewAnimation alloc] initWithViewAnimations:nil]; + + [fAnimation setViewAnimations:[NSArray arrayWithObjects:dict1, dict2, nil]]; + [fAnimation setDuration:0.25]; + [fAnimation setAnimationBlockingMode:NSAnimationBlocking]; // prevent user from resizing the window during an animation + [fAnimation startAnimation]; + fCurrentJobHidden = !showPane; +} + +//------------------------------------------------------------------------------------ +// Enables or disables the display of detail information for each job. +//------------------------------------------------------------------------------------ +- (void)showDetail: (BOOL)showDetail +{ + // clumsy - have to update UI + [fDetailCheckbox setState:showDetail ? NSOnState : NSOffState]; + + [fTaskView setRowHeight:showDetail ? 110.0 : 17.0]; + if ([fTaskView selectedRow] != -1) + [fTaskView scrollRowToVisible:[fTaskView selectedRow]]; +} + +//------------------------------------------------------------------------------------ +// Generates a multi-line text string that includes the job name on the first line +// followed by details of the job on subsequent lines. If the text is to be drawn as +// part of a highlighted cell, set isHighlighted to true. The returned string may +// contain multiple fonts and paragraph formating. +//------------------------------------------------------------------------------------ +- (NSAttributedString *)attributedDescriptionForJob: (hb_job_t *)job + withDetail: (BOOL)detail + withHighlighting: (BOOL)highlighted +{ + NSMutableAttributedString * finalString; // the return value + NSAttributedString* anAttributedString; // a temp string for building up attributed substrings + NSMutableString* aMutableString; // a temp string for non-attributed substrings + hb_title_t * title = job->title; + + NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; + [ps setLineBreakMode:NSLineBreakByClipping]; + + static NSDictionary* detailAttribute = [[NSDictionary dictionaryWithObjectsAndKeys: + [NSFont systemFontOfSize:10.0], NSFontAttributeName, + [NSColor darkGrayColor], NSForegroundColorAttributeName, + ps, NSParagraphStyleAttributeName, + nil] retain]; + static NSDictionary* detailHighlightedAttribute = [[NSDictionary dictionaryWithObjectsAndKeys: + [NSFont systemFontOfSize:10.0], NSFontAttributeName, + [NSColor whiteColor], NSForegroundColorAttributeName, + ps, NSParagraphStyleAttributeName, + nil] retain]; + static NSDictionary* titleAttribute = [[NSDictionary dictionaryWithObject: + [NSFont systemFontOfSize:[NSFont systemFontSize]] forKey:NSFontAttributeName] retain]; + + finalString = [[[NSMutableAttributedString alloc] init] autorelease]; + + // Title, in bold + // Show the name of the source Note: use title->name instead of title->dvd since + // name is just the chosen folder, instead of dvd which is the full path + anAttributedString = [[[NSAttributedString alloc] initWithString:[NSString stringWithUTF8String:title->name] attributes:titleAttribute] autorelease]; + [finalString appendAttributedString:anAttributedString]; + + if (!detail) + return finalString; + + // Other info in plain + aMutableString = [NSMutableString stringWithCapacity:200]; + + +#if JOB_GROUPS + // The subtitle scan doesn't contain all the stuff we need (like x264opts). + // So grab the next job in the group for display purposes. + if (job->pass == -1) + { + // When job is the one currently being processed, then the next in its group + // is the the first job in the queue. + hb_job_t * nextjob; + if (job == hb_current_job(fHandle)) + nextjob = hb_job(fHandle, 0); + else + nextjob = hb_next_job(fHandle, job); + if (nextjob) // Overly cautious in case there is no next job! + job = nextjob; + } +#endif + + NSString * chapterString = (job->chapter_start == job->chapter_end) ? + [NSString stringWithFormat:@"Chapter %d", job->chapter_start] : + [NSString stringWithFormat:@"Chapters %d through %d", job->chapter_start, job->chapter_end]; + + // Scan pass + if (job->pass == -1) + { + [aMutableString appendString:[NSString stringWithFormat: + @"\nTitle %d, %@, Pass: Scan", title->index, chapterString]]; + } + + // Normal pass + else + { +#if JOB_GROUPS + [aMutableString appendString:[NSString stringWithFormat: + @"\nTitle %d, %@, %d-Pass", + title->index, chapterString, MIN( 2, job->pass + 1 )]]; +#else + [aMutableString appendString:[NSString stringWithFormat: + @"\nTitle %d, %@, Pass %d of %d", + title->index, chapterString, MAX( 1, job->pass ), MIN( 2, job->pass + 1 )]]; +#endif + + NSString * jobFormat; + NSString * jobPictureDetail; + NSString * jobVideoDetail; + NSString * jobVideoCodec; + NSString * jobVideoQuality; + NSString * jobAudioDetail; + NSString * jobAudioCodec; + + /* Muxer settings (File Format in the gui) */ + if (job->mux == 65536 || job->mux == 131072 || job->mux == 1048576) + jobFormat = @"MP4"; // HB_MUX_MP4,HB_MUX_PSP,HB_MUX_IPOD + else if (job->mux == 262144) + jobFormat = @"AVI"; // HB_MUX_AVI + else if (job->mux == 524288) + jobFormat = @"OGM"; // HB_MUX_OGM + else if (job->mux == 2097152) + jobFormat = @"MKV"; // HB_MUX_MKV + else + jobFormat = @"unknown"; + + // 2097152 + /* Video Codec settings (Encoder in the gui) */ + if (job->vcodec == 1) + jobVideoCodec = @"FFmpeg"; // HB_VCODEC_FFMPEG + else if (job->vcodec == 2) + jobVideoCodec = @"XviD"; // HB_VCODEC_XVID + else if (job->vcodec == 4) + { + /* Deterimine for sure how we are now setting iPod uuid atom */ + if (job->h264_level) // We are encoding for iPod + jobVideoCodec = @"x264 (H.264 iPod)"; // HB_VCODEC_X264 + else + jobVideoCodec = @"x264 (H.264 Main)"; // HB_VCODEC_X264 + } + else + jobVideoCodec = @"unknown"; + + /* Audio Codecs (Second half of Codecs in the gui) */ + if (job->acodec == 256) + jobAudioCodec = @"AAC"; // HB_ACODEC_FAAC + else if (job->acodec == 512) + jobAudioCodec = @"MP3"; // HB_ACODEC_LAME + else if (job->acodec == 1024) + jobAudioCodec = @"Vorbis"; // HB_ACODEC_VORBIS + else if (job->acodec == 2048) + jobAudioCodec = @"AC3"; // HB_ACODEC_AC3 + else + jobAudioCodec = @"unknown"; + /* Show Basic File info */ + if (job->chapter_markers == 1) + [aMutableString appendString:[NSString stringWithFormat:@"\nFormat: %@ Container, %@ Video + %@ Audio, Chapter Markers", jobFormat, jobVideoCodec, jobAudioCodec]]; + else + [aMutableString appendString:[NSString stringWithFormat:@"\nFormat: %@ Container, %@ Video + %@ Audio", jobFormat, jobVideoCodec, jobAudioCodec]]; + + /*Picture info*/ + /*integers for picture values deinterlace, crop[4], keep_ratio, grayscale, pixel_ratio, pixel_aspect_width, pixel_aspect_height, + maxWidth, maxHeight */ + if (job->pixel_ratio == 1) + { + int titlewidth = title->width - job->crop[2] - job->crop[3]; + int displayparwidth = titlewidth * job->pixel_aspect_width / job->pixel_aspect_height; + int displayparheight = title->height - job->crop[0] - job->crop[1]; + jobPictureDetail = [NSString stringWithFormat:@"Picture: %dx%d (%dx%d Anamorphic)", displayparwidth, displayparheight, job->width, displayparheight]; + } + else + jobPictureDetail = [NSString stringWithFormat:@"Picture: %dx%d", job->width, job->height]; + if (job->keep_ratio == 1) + jobPictureDetail = [jobPictureDetail stringByAppendingString:@" Keep Aspect Ratio"]; + + if (job->grayscale == 1) + jobPictureDetail = [jobPictureDetail stringByAppendingString:@", Grayscale"]; + + if (job->deinterlace == 1) + jobPictureDetail = [jobPictureDetail stringByAppendingString:@", Deinterlace"]; + /* Show Picture info */ + [aMutableString appendString:[NSString stringWithFormat:@"\n%@", jobPictureDetail]]; + + /* Detailed Video info */ + if (job->vquality <= 0 || job->vquality >= 1) + jobVideoQuality =[NSString stringWithFormat:@"%d kbps", job->vbitrate]; + else + { + NSNumber * vidQuality; + vidQuality = [NSNumber numberWithInt:job->vquality * 100]; + /* this is screwed up kind of. Needs to be formatted properly */ + if (job->crf == 1) + jobVideoQuality =[NSString stringWithFormat:@"%@%% CRF", vidQuality]; + else + jobVideoQuality =[NSString stringWithFormat:@"%@%% CQP", vidQuality]; + } + + if (job->vrate_base == 1126125) + { + /* NTSC FILM 23.976 */ + jobVideoDetail = [NSString stringWithFormat:@"Video: %@, %@, 23.976 fps", jobVideoCodec, jobVideoQuality]; + } + else if (job->vrate_base == 900900) + { + /* NTSC 29.97 */ + jobVideoDetail = [NSString stringWithFormat:@"Video: %@, %@, 29.97 fps", jobVideoCodec, jobVideoQuality]; + } + else + { + /* Everything else */ + jobVideoDetail = [NSString stringWithFormat:@"Video: %@, %@, %d fps", jobVideoCodec, jobVideoQuality, job->vrate / job->vrate_base]; + } + + /* Add the video detail string to the job filed in the window */ + [aMutableString appendString:[NSString stringWithFormat:@"\n%@", jobVideoDetail]]; + + /* if there is an x264 option string, lets add it here*/ + /*NOTE: Due to size, lets get this in a tool tip*/ + + if (job->x264opts) + [aMutableString appendString:[NSString stringWithFormat:@"\nx264 Options: %@", [NSString stringWithUTF8String:job->x264opts]]]; + + /* Audio Detail */ + if ([jobAudioCodec isEqualToString: @"AC3"]) + jobAudioDetail = [NSString stringWithFormat:@"Audio: %@, Pass-Through", jobAudioCodec]; + else + jobAudioDetail = [NSString stringWithFormat:@"Audio: %@, %d kbps, %d Hz", jobAudioCodec, job->abitrate, job->arate]; + + /* we now get the audio mixdown info for each of the two gui audio tracks */ + /* lets do it the long way here to get a handle on things. + Hardcoded for two tracks for gui: audio_mixdowns[i] audio_mixdowns[i] */ + int ai; // counter for each audios [] , macgui only allows for two audio tracks currently + for( ai = 0; ai < 2; ai++ ) + { + if (job->audio_mixdowns[ai] == HB_AMIXDOWN_MONO) + jobAudioDetail = [jobAudioDetail stringByAppendingString:[NSString stringWithFormat:@", Track %d: Mono",ai + 1]]; + if (job->audio_mixdowns[ai] == HB_AMIXDOWN_STEREO) + jobAudioDetail = [jobAudioDetail stringByAppendingString:[NSString stringWithFormat:@", Track %d: Stereo",ai + 1]]; + if (job->audio_mixdowns[ai] == HB_AMIXDOWN_DOLBY) + jobAudioDetail = [jobAudioDetail stringByAppendingString:[NSString stringWithFormat:@", Track %d: Dolby Surround",ai + 1]]; + if (job->audio_mixdowns[ai] == HB_AMIXDOWN_DOLBYPLII) + jobAudioDetail = [jobAudioDetail stringByAppendingString:[NSString stringWithFormat:@", Track %d: Dolby Pro Logic II",ai + 1]]; + if (job->audio_mixdowns[ai] == HB_AMIXDOWN_6CH) + jobAudioDetail = [jobAudioDetail stringByAppendingString:[NSString stringWithFormat:@", Track %d: 6-channel discreet",ai + 1]]; + } + + /* Add the Audio detail string to the job filed in the window */ + [aMutableString appendString:[NSString stringWithFormat: @"\n%@", jobAudioDetail]]; + + /*Destination Field */ + [aMutableString appendString:[NSString stringWithFormat:@"\nDestination: %@", [NSString stringWithUTF8String:job->file]]]; + } + + anAttributedString = [[[NSAttributedString alloc] initWithString:aMutableString attributes:highlighted ? detailHighlightedAttribute : detailAttribute] autorelease]; + [finalString appendAttributedString:anAttributedString]; + + + return finalString; +} + +//------------------------------------------------------------------------------------ +// Generate string to display in UI. +//------------------------------------------------------------------------------------ +- (NSString *) progressStatusStringForJob: (hb_job_t *)job state: (hb_state_t *)s +{ + if (s->state == HB_STATE_WORKING) + { + if (job->pass == -1) + return NSLocalizedString( @"Analyzing subtitles", nil ); + if (job->pass == 1) + return NSLocalizedString( @"Analyzing video", nil ); + else if ((job->pass == 0) || (job->pass == 2)) + return NSLocalizedString( @"Encoding movie", nil ); + } + else if (s->state == HB_STATE_MUXING) + { + return NSLocalizedString( @"Muxing", nil ); + } + else if (s->state == HB_STATE_PAUSED) + { + return NSLocalizedString( @"Paused", nil ); + } + else if (s->state == HB_STATE_WORKDONE) + { + return NSLocalizedString( @"Done", nil ); + } + + return @""; +} + +//------------------------------------------------------------------------------------ +// Generate string to display in UI. +//------------------------------------------------------------------------------------ +- (NSString *) progressTimeRemainingStringForJob: (hb_job_t *)job state: (hb_state_t *)s +{ + if (s->state == HB_STATE_WORKING) + { + #define p s->param.working + if( p.seconds > -1 ) + { + float estHours = (p.hours + (p.minutes / 60.0)); + float estMinutes = (p.minutes + (p.seconds / 60.0)); + + if (estHours > 1.5) + return [NSString stringWithFormat:NSLocalizedString( @"Time remaining: About %d hours", nil ), lrintf(estHours)]; + else if (estHours > 0.983) // 59 minutes + return NSLocalizedString( @"Time remaining: About 1 hour", nil ); + else if (estMinutes > 1.5) + return [NSString stringWithFormat:NSLocalizedString( @"Time remaining: About %d minutes", nil ), lrintf(estMinutes)]; + else if (estMinutes > 0.983) // 59 seconds + return NSLocalizedString( @"Time remaining: About 1 minute", nil ); + else if (p.seconds <= 5) + return NSLocalizedString( @"Time remaining: Less than 5 seconds", nil ); + else if (p.seconds <= 10) + return NSLocalizedString( @"Time remaining: Less than 10 seconds", nil ); + else + return NSLocalizedString( @"Time remaining: Less than 1 minute", nil ); + } + else + return NSLocalizedString( @"Time remaining: Calculating...", nil ); + #undef p + } + + return @""; +} + +//------------------------------------------------------------------------------------ +// Refresh progress bar (fProgressBar) from current state. +//------------------------------------------------------------------------------------ +- (void) updateProgressBarWithState: (hb_state_t *)s +{ + if (s->state == HB_STATE_WORKING) + { + #define p s->param.working + [fProgressBar setIndeterminate:NO]; +#if JOB_GROUPS + float progress_total = 100.0 * ( p.progress + p.job_cur - 1 ) / p.job_count; +#else + float progress_total = 100.0 * p.progress; +#endif + [fProgressBar setDoubleValue:progress_total]; + #undef p + } + + else if (s->state == HB_STATE_MUXING) + { + #define p s->param.muxing + [fProgressBar setIndeterminate:YES]; + [fProgressBar startAnimation:nil]; + #undef p + } + + else if (s->state == HB_STATE_WORKDONE) + { + [fProgressBar setIndeterminate:NO]; + [fProgressBar setDoubleValue:0.0]; + } +} + +//------------------------------------------------------------------------------------ +// Refresh start/pause button (fStartPauseButton) from current state. +//------------------------------------------------------------------------------------ +- (void) updateStartPauseButton +{ + if (!fHandle) return; + + hb_state_t s; + hb_get_state2 (fHandle, &s); + + if (s.state == HB_STATE_PAUSED) + { + [fStartPauseButton setEnabled:YES]; +// [fStartPauseButton setTitle:NSLocalizedString(@"Resume", nil)]; + [fStartPauseButton setImage:[NSImage imageNamed: @"Play"]]; + } + + else if ((s.state == HB_STATE_WORKING) || (s.state == HB_STATE_MUXING)) + { + [fStartPauseButton setEnabled:YES]; +// [fStartPauseButton setTitle:NSLocalizedString(@"Pause", nil)]; + [fStartPauseButton setImage:[NSImage imageNamed: @"Pause"]]; + } + + else if (hb_count(fHandle) > 0) + { + [fStartPauseButton setEnabled:YES]; +// [fStartPauseButton setTitle:NSLocalizedString(@"Start", nil)]; + [fStartPauseButton setImage:[NSImage imageNamed: @"Play"]]; + } + + else + { + [fStartPauseButton setEnabled:NO]; +// [fStartPauseButton setTitle:NSLocalizedString(@"Start", nil)]; + [fStartPauseButton setImage:[NSImage imageNamed: @"Play"]]; + } +} + +//------------------------------------------------------------------------------------ +// Refresh queue count text field (fQueueCountField). +//------------------------------------------------------------------------------------ +- (void)updateQueueCountField +{ + NSString * msg; +#if JOB_GROUPS + int jobCount = fHandle ? hb_group_count(fHandle) : 0; +#else + int jobCount = fHandle ? hb_count(fHandle) : 0; +#endif + if (jobCount == 1) + msg = NSLocalizedString(@"1 pending job", nil); + else + msg = [NSString stringWithFormat:NSLocalizedString(@"%d pending jobs", nil), jobCount]; + [fQueueCountField setStringValue:msg]; +} + +//------------------------------------------------------------------------------------ +// Refresh the UI in the current job pane. Should be called whenever the current job +// being processed has changed or when progress has changed. +//------------------------------------------------------------------------------------ +- (void)updateCurrentJobUI +{ + hb_state_t s; + hb_job_t * job = nil; + + if (fHandle) + { + hb_get_state( fHandle, &s ); + job = hb_current_job(fHandle); + } + + if (job) + { + [fJobDescTextField setAttributedStringValue:[self attributedDescriptionForJob:job withDetail:YES withHighlighting:NO]]; + + [self showCurrentJobPane:YES]; + [fProgressStatus setStringValue:[self progressStatusStringForJob:job state:&s]]; + [fProgressTimeRemaining setStringValue:[self progressTimeRemainingStringForJob:job state:&s]]; + [self updateProgressBarWithState:&s]; + } + else + { + [fJobDescTextField setStringValue:NSLocalizedString(@"No job processing", nil)]; + + [self showCurrentJobPane:NO]; + [fProgressBar stopAnimation:nil]; // just in case in was animating + } +} + +//------------------------------------------------------------------------------------ +// Refresh the UI in the queue pane. Should be called whenever the content of HB's job +// list has changed so that HBQueueController can sync up. +//------------------------------------------------------------------------------------ +- (void)updateQueueUI +{ + [fTaskView noteNumberOfRowsChanged]; + [fTaskView reloadData]; + + [self updateQueueCountField]; + [self updateStartPauseButton]; +} + +//------------------------------------------------------------------------------------ +// Deletes the selected job from HB and the queue UI +//------------------------------------------------------------------------------------ +- (IBAction)removeSelectedJob: (id)sender +{ + if (!fHandle) return; + + int row = [sender selectedRow]; + if (row != -1) + { +#if JOB_GROUPS + hb_rem_group( fHandle, hb_group( fHandle, row ) ); +#else + hb_rem( fHandle, hb_job( fHandle, row ) ); +#endif + [self updateQueueUI]; + } +} + +//------------------------------------------------------------------------------------ +// Prompts user if the want to cancel encoding of current job. If so, hb_stop gets +// called. +//------------------------------------------------------------------------------------ +- (IBAction)cancelCurrentJob: (id)sender +{ + if (!fHandle) return; + + hb_job_t * job = hb_current_job(fHandle); + if (!job) return; + + // If command key is down, don't prompt + BOOL hasCmdKeyMask = ([[NSApp currentEvent] modifierFlags] & NSCommandKeyMask) != 0; + if (hasCmdKeyMask) + hb_stop(fHandle); + else + { + NSString * alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Do you want to stop processing of %@?", nil), + [NSString stringWithUTF8String:job->title->name]]; + + NSBeginCriticalAlertSheet( + alertTitle, + NSLocalizedString(@"Stop Processing", nil), NSLocalizedString(@"Keep Processing", nil), nil, fQueueWindow, self, + @selector(cancelCurrentJob:returnCode:contextInfo:), nil, nil, + NSLocalizedString(@"Your movie will be lost if you don't continue processing.", nil), + [NSString stringWithUTF8String:job->title->name]); + + // cancelCurrentJob:returnCode:contextInfo: will be called when the dialog is dismissed + } +} + +- (void) cancelCurrentJob: (NSWindow *)sheet returnCode: (int)returnCode contextInfo: (void *)contextInfo +{ + if (returnCode == NSAlertDefaultReturn) + hb_stop(fHandle); +} + +//------------------------------------------------------------------------------------ +// Enables or disables the display of detail information for each job based on the +// current value of the fDetailCheckbox control. +//------------------------------------------------------------------------------------ +- (IBAction)detailChanged: (id)sender +{ + BOOL detail = [fDetailCheckbox state] == NSOnState; + [[NSUserDefaults standardUserDefaults] setBool:detail forKey:@"QueueShowsDetail"]; + + [self showDetail:detail]; +} + +//------------------------------------------------------------------------------------ +// Toggles the processing of jobs on or off epending on the current state +//------------------------------------------------------------------------------------ +- (IBAction)toggleStartPause: (id)sender +{ + if (!fHandle) return; + + hb_state_t s; + hb_get_state2 (fHandle, &s); + + if (s.state == HB_STATE_PAUSED) + hb_resume (fHandle); + else if ((s.state == HB_STATE_WORKING) || (s.state == HB_STATE_MUXING)) + hb_pause (fHandle); +#if JOB_GROUPS + else if (hb_group_count(fHandle) > 0) +#else + else if (hb_count(fHandle) > 0) +#endif + hb_start (fHandle); +} + +//------------------------------------------------------------------------------------ +// awakeFromNib +//------------------------------------------------------------------------------------ +- (void)awakeFromNib +{ + if (![fQueueWindow setFrameUsingName:@"Queue"]) + [fQueueWindow center]; + [fQueueWindow setFrameAutosaveName: @"Queue"]; + + // Show/hide UI elements + [self showDetail:[[NSUserDefaults standardUserDefaults] boolForKey:@"QueueShowsDetail"]]; + [self showCurrentJobPane:NO]; +} + + +//------------------------------------------------------------------------------------ +// windowWillClose +//------------------------------------------------------------------------------------ +- (void)windowWillClose:(NSNotification *)aNotification +{ + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"QueueWindowIsOpen"]; +} + +//------------------------------------------------------------------------------------ +// NSTableView delegate +//------------------------------------------------------------------------------------ +- (int)numberOfRowsInTableView: (NSTableView *)aTableView +{ +#if JOB_GROUPS + return fHandle ? hb_group_count(fHandle) : 0; +#else + return fHandle ? hb_count(fHandle) : 0; +#endif +} + +//------------------------------------------------------------------------------------ +// NSTableView delegate +//------------------------------------------------------------------------------------ +- (id)tableView: (NSTableView *)aTableView + objectValueForTableColumn: (NSTableColumn *)aTableColumn + row: (int)rowIndex +{ + if (!fHandle) + return @""; // fatal error! + + hb_job_t * job; +#if JOB_GROUPS + job = hb_group(fHandle, rowIndex); +#else + job = hb_job(fHandle, rowIndex); +#endif + if (!job) + return @""; // fatal error! + + if ([[aTableColumn identifier] isEqualToString:@"desc"]) + { + BOOL highlighted = [aTableView isRowSelected:rowIndex] && [[aTableView window] isKeyWindow] && ([[aTableView window] firstResponder] == aTableView); + BOOL showDetail = [fDetailCheckbox state] == NSOnState; + return [self attributedDescriptionForJob:job withDetail:showDetail withHighlighting:highlighted]; + } + + else if ([[aTableColumn identifier] isEqualToString:@"delete"]) + return @""; + + else if ([[aTableColumn identifier] isEqualToString:@"icon"]) + return [NSImage imageNamed:@"JobSmall"]; + + return @""; +} + +//------------------------------------------------------------------------------------ +// NSTableView delegate +//------------------------------------------------------------------------------------ +- (void)tableView: (NSTableView *)aTableView + willDisplayCell: (id)aCell + forTableColumn: (NSTableColumn *)aTableColumn + row: (int)rowIndex +{ + if ([[aTableColumn identifier] isEqualToString:@"delete"]) + { + BOOL highlighted = [aTableView isRowSelected:rowIndex] && [[aTableView window] isKeyWindow] && ([[aTableView window] firstResponder] == aTableView); + if (highlighted) + { + [aCell setImage:[NSImage imageNamed:@"DeleteHighlight"]]; + [aCell setAlternateImage:[NSImage imageNamed:@"DeleteHighlightPressed"]]; + } + else + { + [aCell setImage:[NSImage imageNamed:@"Delete"]]; + } + } +} + +@end diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index fe3dbdc39..06cf508a1 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -88,14 +88,12 @@ 4DD93F8F082036E8008E1322 /* Controller.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DF3C8CB052889CD00A80101 /* Controller.h */; }; 4DD93F90082036E8008E1322 /* PictureGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D85758F052B78E300C39CA9 /* PictureGLView.h */; }; 4DD93F92082036E8008E1322 /* PictureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D1FD381073D19CE00E46515 /* PictureController.h */; }; - 4DD93F93082036E8008E1322 /* QueueController.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DD27BA507C0065C0023D231 /* QueueController.h */; }; 4DD93F96082036E8008E1322 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; 4DD93F97082036E8008E1322 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 4DD93F9A082036E8008E1322 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; settings = {ATTRIBUTES = (); }; }; 4DD93F9B082036E8008E1322 /* Controller.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4DF3C8CC052889CD00A80101 /* Controller.mm */; }; 4DD93F9C082036E8008E1322 /* PictureGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4D85758E052B78E300C39CA9 /* PictureGLView.mm */; }; 4DD93F9E082036E8008E1322 /* PictureController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4D1FD382073D19CE00E46515 /* PictureController.mm */; }; - 4DD93F9F082036E8008E1322 /* QueueController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4DD27BA607C0065C0023D231 /* QueueController.mm */; }; 4DD93FA2082036E8008E1322 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 4DD93FA3082036E8008E1322 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DEB2024052B055F00C39CA9 /* IOKit.framework */; }; 4DD93FA4082036E8008E1322 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DDE9724052B7B2B00C39CA9 /* OpenGL.framework */; }; @@ -128,6 +126,15 @@ A2DFC6770C61980700E66E89 /* MVMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A2DFC6760C61980700E66E89 /* MVMenuButton.m */; }; B48359A80C82960500E04440 /* lang.c in Sources */ = {isa = PBXBuildFile; fileRef = B48359A70C82960500E04440 /* lang.c */; }; D4D49FED0C83355600F01215 /* lang.c in Sources */ = {isa = PBXBuildFile; fileRef = B48359A70C82960500E04440 /* lang.c */; }; + E3003C7F0C88505D0072F2A8 /* DeleteHighlightPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = E3003C7E0C88505D0072F2A8 /* DeleteHighlightPressed.png */; }; + E3003CB50C8852B70072F2A8 /* DeletePressed.png in Resources */ = {isa = PBXBuildFile; fileRef = E3003CB40C8852B70072F2A8 /* DeletePressed.png */; }; + E37C89410C83988F00C1B919 /* DeleteHighlight.png in Resources */ = {isa = PBXBuildFile; fileRef = E37C893D0C83988F00C1B919 /* DeleteHighlight.png */; }; + E37C89420C83988F00C1B919 /* Delete.png in Resources */ = {isa = PBXBuildFile; fileRef = E37C893E0C83988F00C1B919 /* Delete.png */; }; + E37C89430C83988F00C1B919 /* JobSmall.png in Resources */ = {isa = PBXBuildFile; fileRef = E37C893F0C83988F00C1B919 /* JobSmall.png */; }; + E37C89440C83988F00C1B919 /* JobLarge.png in Resources */ = {isa = PBXBuildFile; fileRef = E37C89400C83988F00C1B919 /* JobLarge.png */; }; + E37C89470C83989F00C1B919 /* HBQueueController.mm in Sources */ = {isa = PBXBuildFile; fileRef = E37C89450C83989F00C1B919 /* HBQueueController.mm */; }; + E37C89480C83989F00C1B919 /* HBQueueController.h in Headers */ = {isa = PBXBuildFile; fileRef = E37C89460C83989F00C1B919 /* HBQueueController.h */; }; + E37C894F0C8398CF00C1B919 /* Queue.nib in Resources */ = {isa = PBXBuildFile; fileRef = E37C894D0C8398CF00C1B919 /* Queue.nib */; }; EAA526930C3B25D200944FF2 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = EAA526920C3B25D200944FF2 /* stream.c */; }; EAA526940C3B25D200944FF2 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = EAA526920C3B25D200944FF2 /* stream.c */; }; FC8519500C59A02C0073812C /* denoise.c in Sources */ = {isa = PBXBuildFile; fileRef = FC85194C0C59A02C0073812C /* denoise.c */; }; @@ -236,8 +243,6 @@ 4D3ECC2609A4917000B2E45F /* WhiteBox.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = WhiteBox.m; sourceTree = ""; }; 4D85758E052B78E300C39CA9 /* PictureGLView.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = PictureGLView.mm; sourceTree = ""; }; 4D85758F052B78E300C39CA9 /* PictureGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PictureGLView.h; sourceTree = ""; }; - 4DD27BA507C0065C0023D231 /* QueueController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = QueueController.h; sourceTree = ""; }; - 4DD27BA607C0065C0023D231 /* QueueController.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = QueueController.mm; sourceTree = ""; }; 4DDE9724052B7B2B00C39CA9 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 4DEB2024052B055F00C39CA9 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 4DF3C8CB052889CD00A80101 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = ""; }; @@ -269,6 +274,15 @@ A2DFC6740C6197C600E66E89 /* MVMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MVMenuButton.h; sourceTree = ""; }; A2DFC6760C61980700E66E89 /* MVMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MVMenuButton.m; sourceTree = ""; }; B48359A70C82960500E04440 /* lang.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lang.c; path = ../libhb/lang.c; sourceTree = SOURCE_ROOT; }; + E3003C7E0C88505D0072F2A8 /* DeleteHighlightPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DeleteHighlightPressed.png; sourceTree = ""; }; + E3003CB40C8852B70072F2A8 /* DeletePressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DeletePressed.png; sourceTree = ""; }; + E37C893D0C83988F00C1B919 /* DeleteHighlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DeleteHighlight.png; sourceTree = ""; }; + E37C893E0C83988F00C1B919 /* Delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Delete.png; sourceTree = ""; }; + E37C893F0C83988F00C1B919 /* JobSmall.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = JobSmall.png; sourceTree = ""; }; + E37C89400C83988F00C1B919 /* JobLarge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = JobLarge.png; sourceTree = ""; }; + E37C89450C83989F00C1B919 /* HBQueueController.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = HBQueueController.mm; sourceTree = ""; }; + E37C89460C83989F00C1B919 /* HBQueueController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HBQueueController.h; sourceTree = ""; }; + E37C894E0C8398CF00C1B919 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Queue.nib; sourceTree = ""; }; EAA526920C3B25D200944FF2 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = stream.c; path = ../libhb/stream.c; sourceTree = SOURCE_ROOT; }; FC85194C0C59A02C0073812C /* denoise.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = denoise.c; path = ../libhb/denoise.c; sourceTree = SOURCE_ROOT; }; FC85194D0C59A02C0073812C /* deinterlace.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = deinterlace.c; path = ../libhb/deinterlace.c; sourceTree = SOURCE_ROOT; }; @@ -369,6 +383,7 @@ 2538860A0BFE0B730064E995 /* OutputPanel.nib */, 25DE1FAB0C1699E500F01FC8 /* Preferences.nib */, 4D1EA3000993B13700FDC1A2 /* Express.nib */, + E37C894D0C8398CF00C1B919 /* Queue.nib */, ); name = Resources; sourceTree = ""; @@ -452,8 +467,6 @@ 4DF3C8CC052889CD00A80101 /* Controller.mm */, 4D85758E052B78E300C39CA9 /* PictureGLView.mm */, 4D85758F052B78E300C39CA9 /* PictureGLView.h */, - 4DD27BA507C0065C0023D231 /* QueueController.h */, - 4DD27BA607C0065C0023D231 /* QueueController.mm */, 4D3ECC2509A4917000B2E45F /* WhiteBox.h */, 4D3ECC2609A4917000B2E45F /* WhiteBox.m */, 593034E90BBA39A100172349 /* ChapterTitles.h */, @@ -466,6 +479,8 @@ 253886160BFE0C160064E995 /* HBOutputPanelController.m */, 25DE1FB40C169A0C00F01FC8 /* HBPreferencesController.h */, 25DE1FB50C169A0C00F01FC8 /* HBPreferencesController.m */, + E37C89460C83989F00C1B919 /* HBQueueController.h */, + E37C89450C83989F00C1B919 /* HBQueueController.mm */, ); name = "HandBrake Sources"; sourceTree = ""; @@ -495,6 +510,12 @@ A273E04B0C57B39A00493A45 /* Play.tiff */, A273E04C0C57B39A00493A45 /* Stop.tiff */, A273E04D0C57B39A00493A45 /* Terminal.tiff */, + E37C893E0C83988F00C1B919 /* Delete.png */, + E3003CB40C8852B70072F2A8 /* DeletePressed.png */, + E37C893D0C83988F00C1B919 /* DeleteHighlight.png */, + E3003C7E0C88505D0072F2A8 /* DeleteHighlightPressed.png */, + E37C89400C83988F00C1B919 /* JobLarge.png */, + E37C893F0C83988F00C1B919 /* JobSmall.png */, ); path = icons; sourceTree = ""; @@ -525,11 +546,11 @@ 4DD93F8F082036E8008E1322 /* Controller.h in Headers */, 4DD93F90082036E8008E1322 /* PictureGLView.h in Headers */, 4DD93F92082036E8008E1322 /* PictureController.h in Headers */, - 4DD93F93082036E8008E1322 /* QueueController.h in Headers */, A2A1EC310C76C35E00827E0D /* HBDVDDetector.h in Headers */, 253886010BFE0A5B0064E995 /* HBOutputRedirect.h in Headers */, 253886170BFE0C160064E995 /* HBOutputPanelController.h in Headers */, 25DE1FB60C169A0C00F01FC8 /* HBPreferencesController.h in Headers */, + E37C89480C83989F00C1B919 /* HBQueueController.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -676,6 +697,13 @@ A28468680C5A43D900EF9A98 /* Disc.tiff in Resources */, A2DFC66E0C6196D900E66E89 /* actionWidget.png in Resources */, A2DFC66F0C6196D900E66E89 /* actionWidgetPressed.png in Resources */, + E37C89410C83988F00C1B919 /* DeleteHighlight.png in Resources */, + E37C89420C83988F00C1B919 /* Delete.png in Resources */, + E37C89430C83988F00C1B919 /* JobSmall.png in Resources */, + E37C89440C83988F00C1B919 /* JobLarge.png in Resources */, + E37C894F0C8398CF00C1B919 /* Queue.nib in Resources */, + E3003C7F0C88505D0072F2A8 /* DeleteHighlightPressed.png in Resources */, + E3003CB50C8852B70072F2A8 /* DeletePressed.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -799,12 +827,12 @@ 4DD93F9B082036E8008E1322 /* Controller.mm in Sources */, 4DD93F9C082036E8008E1322 /* PictureGLView.mm in Sources */, 4DD93F9E082036E8008E1322 /* PictureController.mm in Sources */, - 4DD93F9F082036E8008E1322 /* QueueController.mm in Sources */, A2A1EC3A0C76C58400827E0D /* HBDVDDetector.m in Sources */, 253886020BFE0A5B0064E995 /* HBOutputRedirect.m in Sources */, 253886180BFE0C160064E995 /* HBOutputPanelController.m in Sources */, 25DE1FB70C169A0C00F01FC8 /* HBPreferencesController.m in Sources */, A2DFC6770C61980700E66E89 /* MVMenuButton.m in Sources */, + E37C89470C83989F00C1B919 /* HBQueueController.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -861,6 +889,14 @@ name = MainMenu.nib; sourceTree = ""; }; + E37C894D0C8398CF00C1B919 /* Queue.nib */ = { + isa = PBXVariantGroup; + children = ( + E37C894E0C8398CF00C1B919 /* English */, + ); + name = Queue.nib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -1274,6 +1310,7 @@ ppc, i386, ); + GCC_PREPROCESSOR_DEFINITIONS = "JOB_GROUPS=1"; MACOSX_DEPLOYMENT_TARGET = 10.3; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; @@ -1288,7 +1325,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = s; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../contrib/include"; @@ -1505,7 +1542,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = s; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; HEADER_SEARCH_PATHS = ../libhb; @@ -1654,7 +1691,6 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = s; GCC_TREAT_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = ( ../libhb, @@ -1814,6 +1850,7 @@ GCC_DEBUGGING_SYMBOLS = default; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "JOB_GROUPS=1"; MACOSX_DEPLOYMENT_TARGET = 10.3; PREBINDING = NO; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; @@ -1824,6 +1861,7 @@ 4D4E7BC6087804870051572B /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_PREPROCESSOR_DEFINITIONS = "JOB_GROUPS=1"; MACOSX_DEPLOYMENT_TARGET = 10.3; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; @@ -1832,6 +1870,7 @@ 4D4E7BC7087804870051572B /* Default */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_PREPROCESSOR_DEFINITIONS = "JOB_GROUPS=1"; MACOSX_DEPLOYMENT_TARGET = 10.3; SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; }; diff --git a/macosx/icons/Delete.png b/macosx/icons/Delete.png new file mode 100644 index 000000000..1568f0610 Binary files /dev/null and b/macosx/icons/Delete.png differ diff --git a/macosx/icons/DeleteHighlight.png b/macosx/icons/DeleteHighlight.png new file mode 100644 index 000000000..a24df6bc1 Binary files /dev/null and b/macosx/icons/DeleteHighlight.png differ diff --git a/macosx/icons/DeleteHighlightPressed.png b/macosx/icons/DeleteHighlightPressed.png new file mode 100644 index 000000000..0873028ae Binary files /dev/null and b/macosx/icons/DeleteHighlightPressed.png differ diff --git a/macosx/icons/DeletePressed.png b/macosx/icons/DeletePressed.png new file mode 100644 index 000000000..f4995c4c8 Binary files /dev/null and b/macosx/icons/DeletePressed.png differ diff --git a/macosx/icons/JobLarge.png b/macosx/icons/JobLarge.png new file mode 100644 index 000000000..5b9c18f83 Binary files /dev/null and b/macosx/icons/JobLarge.png differ diff --git a/macosx/icons/JobSmall.png b/macosx/icons/JobSmall.png new file mode 100644 index 000000000..9467aefd8 Binary files /dev/null and b/macosx/icons/JobSmall.png differ -- cgit v1.2.3