diff options
author | handbrake <[email protected]> | 2006-12-31 21:45:39 +0000 |
---|---|---|
committer | handbrake <[email protected]> | 2006-12-31 21:45:39 +0000 |
commit | 44f5572c384ee89f03965dbcc9d39027258f6f60 (patch) | |
tree | e1373b0752b19bc88c99d40fe9e75347b5a2c263 | |
parent | edb4114e462984a73b6fa2d5a16867f56ed0dd22 (diff) |
Fixed HandBrake Scan Panel for Optical Drive
Uses DVD Name instead of drive location
Displays DVD Name in Main window
h.264 defaults to Baseline Level 3
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@76 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/Controller.mm | 28 | ||||
-rw-r--r-- | macosx/ScanController.h | 6 | ||||
-rw-r--r-- | macosx/ScanController.mm | 74 |
3 files changed, 82 insertions, 26 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 10b1231c6..351677154 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -254,6 +254,7 @@ static int FormatSettings[3][4] = - (void) UpdateUI: (NSTimer *) timer { + hb_state_t s; hb_get_state( fHandle, &s ); @@ -286,7 +287,8 @@ static int FormatSettings[3][4] = { title = (hb_title_t *) hb_list_item( list, i ); [fSrcDVD2Field setStringValue: [NSString - stringWithUTF8String: title->dvd]]; + stringWithUTF8String: title->name]]; + [fSrcTitlePopUp addItemWithTitle: [NSString stringWithFormat: @"%d - %02dh%02dm%02ds", title->index, title->hours, title->minutes, @@ -556,18 +558,12 @@ static int FormatSettings[3][4] = } if( job->vcodec & HB_VCODEC_X264 ) { - switch([fVidEncoderPopUp indexOfSelectedItem]) { - case 1: - /* Baseline Level 1.3 - For iPods pre firmware 1.2 */ - job->h264_level = 13; - break; - case 2: - /* Baseline Level 3.0 - For iPods w/ fimware 1.2 */ - job->h264_level = 30; - job->mux = HB_MUX_IPOD; - break; + if ([fVidEncoderPopUp indexOfSelectedItem] < 1 ) + { + /* Just use new Baseline Level 3.0 + Lets Deprecate Baseline Level 1.3*/ + job->h264_level = 30; + job->mux = HB_MUX_IPOD; } job->h264_13 = [fVidEncoderPopUp indexOfSelectedItem]; } @@ -893,9 +889,9 @@ static int FormatSettings[3][4] = { /* MPEG-4 -> H.264 */ [fVidEncoderPopUp removeAllItems]; - [fVidEncoderPopUp addItemWithTitle: @"x264 (Main profile)"]; - [fVidEncoderPopUp addItemWithTitle: @"x264 (Baseline profile level 1.3)"]; - [fVidEncoderPopUp addItemWithTitle: @"x264 (Baseline profile level 3.0)"]; + [fVidEncoderPopUp addItemWithTitle: @"x264 (h.264 Baseline iPod)"]; + [fVidEncoderPopUp addItemWithTitle: @"x264 (h.264 Main)"]; + } else if( ( FormatSettings[format][codecs] & HB_VCODEC_FFMPEG ) ) { diff --git a/macosx/ScanController.h b/macosx/ScanController.h index c5a8de7e0..47a7f6132 100644 --- a/macosx/ScanController.h +++ b/macosx/ScanController.h @@ -7,10 +7,11 @@ #include <Cocoa/Cocoa.h> #include "hb.h" - +@class DriveDetector; @interface ScanController : NSObject { hb_handle_t * fHandle; + hb_list_t * fList; IBOutlet NSWindow * fWindow; IBOutlet NSPanel * fPanel; @@ -25,6 +26,9 @@ IBOutlet NSProgressIndicator * fIndicator; IBOutlet NSButton * fCancelButton; IBOutlet NSButton * fOpenButton; + + DriveDetector * fDriveDetector; + NSDictionary * fDrives; } - (void) TranslateStrings; diff --git a/macosx/ScanController.mm b/macosx/ScanController.mm index e5fe2e70a..92621056b 100644 --- a/macosx/ScanController.mm +++ b/macosx/ScanController.mm @@ -3,17 +3,19 @@ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. It may be used under the terms of the GNU General Public License. */ - +/* These are now called in DriveDetector.h #include <paths.h> #include <IOKit/IOKitLib.h> #include <IOKit/IOBSD.h> #include <IOKit/storage/IOMedia.h> #include <IOKit/storage/IODVDMedia.h> +*/ #include "ScanController.h" #include "DriveDetector.h" #define _(a) NSLocalizedString(a,nil) +#define INSERT_STRING @"Insert a DVD" @implementation ScanController @@ -38,28 +40,70 @@ - (void) Show { + + /* rev63 Drive Detector DriveDetector * driveDetector; driveDetector = [[DriveDetector alloc] initWithCallback: self selector: @selector( UpdatePopup: )]; [driveDetector run]; - + */ + // Taken From IHB for Post rev 63 drive detector + fDriveDetector = [[DriveDetector alloc] initWithCallback: self + selector: @selector( openUpdateDrives: )]; + [fDriveDetector run]; + + // Here down continue with existing HB [NSApp beginSheet: fPanel modalForWindow: fWindow modalDelegate: nil didEndSelector: nil contextInfo: nil]; [NSApp runModalForWindow: fPanel]; [NSApp endSheet: fPanel]; [fPanel orderOut: self]; - [driveDetector stop]; - [driveDetector release]; + //driveDetector stop/release not needed + //[driveDetector stop]; + //[driveDetector release]; } +- (void) openUpdateDrives: (NSDictionary *) drives +{ + if( fDrives ) + { + [fDrives release]; + } + fDrives = [[NSDictionary alloc] initWithDictionary: drives]; + + NSString * device; + NSEnumerator * enumerator = [fDrives keyEnumerator]; + [fDetectedPopUp removeAllItems]; + while( ( device = [enumerator nextObject] ) ) + { + [fDetectedPopUp addItemWithTitle: device]; + } + + if( ![fDetectedPopUp numberOfItems] ) + { + [fDetectedPopUp addItemWithTitle: INSERT_STRING]; + } + [fDetectedPopUp selectItemAtIndex: 0]; + /* May not have any bearing on anything + here as this is from IHB. Need to test + + if( [fMatrix isEnabled] ) + { + [self openEnable: YES]; + */ +} + + +// UpdatePopup Not used for post rev 63 dd +/* - (void) UpdatePopup: (NSArray *) drives { [fDetectedPopUp removeAllItems]; [fDetectedPopUp addItemsWithTitles: drives]; [self MatrixChanged: self]; } - +*/ - (void) EnableUI: (bool) b { [fMatrix setEnabled: b]; @@ -182,14 +226,26 @@ - (IBAction) Open: (id) sender { - NSString * path; + // NSString * path; [self EnableUI: NO]; [fStatusField setStringValue: _( @"Opening..." )]; - path = [fMatrix selectedRow] ? [fFolderField stringValue] : - [fDetectedPopUp titleOfSelectedItem]; - hb_scan( fHandle, [path UTF8String], 0 ); + // From IHB + [fDriveDetector stop]; + + if( [fMatrix selectedRow] ) + { + hb_scan( fHandle, [[fFolderField stringValue] UTF8String], 0 ); + } + else + { + hb_scan( fHandle, [[fDrives objectForKey: [fDetectedPopUp + titleOfSelectedItem]] UTF8String], 0 ); + } + + + } - (IBAction) Cancel: (id) sender |