diff options
author | titer <[email protected]> | 2006-03-21 17:15:21 +0000 |
---|---|---|
committer | titer <[email protected]> | 2006-03-21 17:15:21 +0000 |
commit | 730315edc4113269902d908e7c4d41954d5a3d5d (patch) | |
tree | 5516faccaf70bf431c07c843b790aa255f7b90db /macosx | |
parent | a9f5eb56c4ba2f1b4c22bf949a64cb1d21612ab3 (diff) |
Adds presets for iPod/H.264 and iPod/MPEG-4 + small UI fixes
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@47 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/English.lproj/Express.nib/classes.nib | 3 | ||||
-rw-r--r-- | macosx/English.lproj/Express.nib/info.nib | 4 | ||||
-rw-r--r-- | macosx/English.lproj/Express.nib/keyedobjects.nib | bin | 34369 -> 34653 bytes | |||
-rw-r--r-- | macosx/ExpressController.h | 3 | ||||
-rw-r--r-- | macosx/ExpressController.m | 82 |
5 files changed, 65 insertions, 27 deletions
diff --git a/macosx/English.lproj/Express.nib/classes.nib b/macosx/English.lproj/Express.nib/classes.nib index 28084023a..5498cdf8c 100644 --- a/macosx/English.lproj/Express.nib/classes.nib +++ b/macosx/English.lproj/Express.nib/classes.nib @@ -38,8 +38,11 @@ CLASS = ExpressController; LANGUAGE = ObjC; OUTLETS = { + fConvertAspectPopUp = NSPopUpButton; fConvertFolderPopUp = NSPopUpButton; + fConvertFormatPopUp = NSPopUpButton; fConvertIndicator = NSProgressIndicator; + fConvertInfoString = NSTextField; fConvertTableView = NSTableView; fConvertView = NSView; fEmptyView = NSView; diff --git a/macosx/English.lproj/Express.nib/info.nib b/macosx/English.lproj/Express.nib/info.nib index ae8fc644e..b7418f0ef 100644 --- a/macosx/English.lproj/Express.nib/info.nib +++ b/macosx/English.lproj/Express.nib/info.nib @@ -9,7 +9,7 @@ <key>248</key> <string>487 424 408 321 0 0 1440 878 </string> <key>259</key> - <string>487 331 408 508 0 0 1440 878 </string> + <string>417 300 408 508 0 0 1280 832 </string> <key>29</key> <string>33 298 338 44 0 0 1280 832 </string> <key>303</key> @@ -18,6 +18,6 @@ <key>IBFramework Version</key> <string>443.0</string> <key>IBSystem Version</key> - <string>8G1454</string> + <string>8H14</string> </dict> </plist> diff --git a/macosx/English.lproj/Express.nib/keyedobjects.nib b/macosx/English.lproj/Express.nib/keyedobjects.nib Binary files differindex c53053a44..34bee0b64 100644 --- a/macosx/English.lproj/Express.nib/keyedobjects.nib +++ b/macosx/English.lproj/Express.nib/keyedobjects.nib diff --git a/macosx/ExpressController.h b/macosx/ExpressController.h index f4ef02130..303651b5c 100644 --- a/macosx/ExpressController.h +++ b/macosx/ExpressController.h @@ -27,6 +27,9 @@ IBOutlet NSView * fConvertView; IBOutlet NSTableView * fConvertTableView; IBOutlet NSPopUpButton * fConvertFolderPopUp; + IBOutlet NSPopUpButton * fConvertFormatPopUp; + IBOutlet NSPopUpButton * fConvertAspectPopUp; + IBOutlet NSTextField * fConvertInfoString; IBOutlet NSProgressIndicator * fConvertIndicator; NSMutableArray * fConvertCheckArray; NSString * fConvertFolderString; diff --git a/macosx/ExpressController.m b/macosx/ExpressController.m index d32ad3242..0336cd809 100644 --- a/macosx/ExpressController.m +++ b/macosx/ExpressController.m @@ -23,6 +23,8 @@ **********************************************************************/ - (void) awakeFromNib { + NSEnumerator * enumerator; + /* Show the "Open DVD" interface */ fDriveDetector = [[DriveDetector alloc] initWithCallback: self selector: @selector( openUpdateDrives: )]; @@ -33,10 +35,15 @@ [fWindow makeKeyAndOrderFront: nil]; /* NSTableView initializations */ - NSTableColumn * tableColumn = [fConvertTableView - tableColumnWithIdentifier: @"Check"]; - NSButtonCell * buttonCell = [[[NSButtonCell alloc] - initTextCell: @""] autorelease]; + NSButtonCell * buttonCell; + NSTableColumn * tableColumn; + enumerator = [[fConvertTableView tableColumns] objectEnumerator]; + while( ( tableColumn = [enumerator nextObject] ) ) + { + [tableColumn setEditable: NO]; + } + tableColumn = [fConvertTableView tableColumnWithIdentifier: @"Check"]; + buttonCell = [[[NSButtonCell alloc] initTextCell: @""] autorelease]; [buttonCell setEditable: YES]; [buttonCell setButtonType: NSSwitchButton]; [tableColumn setDataCell: buttonCell]; @@ -188,30 +195,32 @@ hb_title_t * title = hb_list_item( fList, i ); hb_job_t * job = title->job; - job->width = 320; - for( ;; ) + int pixels, aspect; + if( [fConvertFormatPopUp indexOfSelectedItem] ) { - /* XXX */ - hb_fix_aspect( job, HB_KEEP_WIDTH ); - if( job->height == 240 ) - { - break; - } - else if( job->height < 240 ) - { - job->crop[2] += 2; - job->crop[3] += 2; - } - else - { - job->crop[0] += 2; - job->crop[1] += 2; - } + job->vcodec = HB_VCODEC_FFMPEG; + job->vbitrate = 1200; + pixels = 230400; + } + else + { + job->vcodec = HB_VCODEC_X264; + job->h264_13 = 1; + job->vbitrate = 600; + pixels = 76800; + } + if( [fConvertAspectPopUp indexOfSelectedItem] ) + { + aspect = -1; } + else + { + aspect = 4 * HB_ASPECT_BASE / 3; + } + + hb_set_size( job, aspect, pixels ); + job->vquality = -1.0; - job->vbitrate = 600; - job->vcodec = HB_VCODEC_X264; - job->h264_13 = 1; job->file = strdup( [[NSString stringWithFormat: @"%@/%p - Title %d.mp4", fConvertFolderString, self, title->index] UTF8String] ); @@ -258,6 +267,7 @@ [fOpenFolderString release]; fOpenFolderString = [[[sheet filenames] objectAtIndex: 0] retain]; [fOpenFolderField setStringValue: [fOpenFolderString lastPathComponent]]; + [self openGo: self]; } - (void) openEnable: (BOOL) b @@ -373,13 +383,35 @@ { #define p s.param.working case HB_STATE_WORKING: + { + NSMutableString * string = [NSMutableString + stringWithFormat: @"Converting: %.1f %%, %.1f fps", + 100.0 * p.progress, p.rate_avg]; + if( p.hours > 0 ) + { + [string appendFormat: @" (%d hours %d mins left)", + p.hours, p.minutes]; + } + else if( p.minutes > 0 ) + { + [string appendFormat: @" (%d mins %d secs left)", + p.minutes, p.seconds]; + } + else if( p.seconds > -1 ) + { + [string appendFormat: @" (%d seconds left)", + p.seconds]; + } + [fConvertInfoString setStringValue: string]; [fConvertIndicator setIndeterminate: NO]; [fConvertIndicator setDoubleValue: 100.0 * p.progress]; break; + } #undef p case HB_STATE_WORKDONE: [timer invalidate]; + [fConvertInfoString setStringValue: @"Done."]; [fConvertIndicator setIndeterminate: NO]; [fConvertIndicator setDoubleValue: 0.0]; break; |