summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/English.lproj/Express.nib/classes.nib2
-rw-r--r--macosx/English.lproj/Express.nib/info.nib2
-rw-r--r--macosx/English.lproj/Express.nib/keyedobjects.nibbin34816 -> 35003 bytes
-rw-r--r--macosx/ExpressController.h2
-rw-r--r--macosx/ExpressController.m67
5 files changed, 69 insertions, 4 deletions
diff --git a/macosx/English.lproj/Express.nib/classes.nib b/macosx/English.lproj/Express.nib/classes.nib
index 5498cdf8c..6fd9650d7 100644
--- a/macosx/English.lproj/Express.nib/classes.nib
+++ b/macosx/English.lproj/Express.nib/classes.nib
@@ -39,10 +39,12 @@
LANGUAGE = ObjC;
OUTLETS = {
fConvertAspectPopUp = NSPopUpButton;
+ fConvertAudioPopUp = NSPopUpButton;
fConvertFolderPopUp = NSPopUpButton;
fConvertFormatPopUp = NSPopUpButton;
fConvertIndicator = NSProgressIndicator;
fConvertInfoString = NSTextField;
+ fConvertSubtitlePopUp = NSPopUpButton;
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..078c0be99 100644
--- a/macosx/English.lproj/Express.nib/info.nib
+++ b/macosx/English.lproj/Express.nib/info.nib
@@ -18,6 +18,6 @@
<key>IBFramework Version</key>
<string>443.0</string>
<key>IBSystem Version</key>
- <string>8G1454</string>
+ <string>8I1119</string>
</dict>
</plist>
diff --git a/macosx/English.lproj/Express.nib/keyedobjects.nib b/macosx/English.lproj/Express.nib/keyedobjects.nib
index 960c3e022..59442d000 100644
--- a/macosx/English.lproj/Express.nib/keyedobjects.nib
+++ b/macosx/English.lproj/Express.nib/keyedobjects.nib
Binary files differ
diff --git a/macosx/ExpressController.h b/macosx/ExpressController.h
index 303651b5c..9a2f407c8 100644
--- a/macosx/ExpressController.h
+++ b/macosx/ExpressController.h
@@ -29,6 +29,8 @@
IBOutlet NSPopUpButton * fConvertFolderPopUp;
IBOutlet NSPopUpButton * fConvertFormatPopUp;
IBOutlet NSPopUpButton * fConvertAspectPopUp;
+ IBOutlet NSPopUpButton * fConvertAudioPopUp;
+ IBOutlet NSPopUpButton * fConvertSubtitlePopUp;
IBOutlet NSTextField * fConvertInfoString;
IBOutlet NSProgressIndicator * fConvertIndicator;
NSMutableArray * fConvertCheckArray;
diff --git a/macosx/ExpressController.m b/macosx/ExpressController.m
index 2ffddf56e..f496accdc 100644
--- a/macosx/ExpressController.m
+++ b/macosx/ExpressController.m
@@ -189,7 +189,7 @@
- (void) convertGo: (id) sender
{
- int i;
+ int i, j;
for( i = 0; i < hb_list_count( fList ); i++ )
{
@@ -241,7 +241,47 @@
hb_set_size( job, aspect, pixels );
job->vquality = -1.0;
- job->file = strdup( [[NSString stringWithFormat:
+
+ const char * lang;
+
+ /* Audio selection */
+ hb_audio_t * audio;
+ lang = [[fConvertAudioPopUp titleOfSelectedItem] UTF8String];
+ job->audios[0] = -1;
+ for( j = 0; j < hb_list_count( title->list_audio ); j++ )
+ {
+ /* Choose the first track that matches the language */
+ audio = hb_list_item( title->list_audio, j );
+ if( !strcmp( lang, audio->lang_simple ) )
+ {
+ job->audios[0] = j;
+ break;
+ }
+ }
+ if( job->audios[0] == -1 )
+ {
+ /* If the language isn't available in this title, choose
+ the first track */
+ job->audios[0] = 0;
+ }
+ job->audios[1] = -1;
+
+ /* Subtitle selection */
+ hb_subtitle_t * subtitle;
+ lang = [[fConvertSubtitlePopUp titleOfSelectedItem] UTF8String];
+ job->subtitle = -1;
+ for( j = 0; j < hb_list_count( title->list_subtitle ); j++ )
+ {
+ /* Choose the first track that matches the language */
+ subtitle = hb_list_item( title->list_subtitle, j );
+ if( !strcmp( lang, subtitle->lang ) )
+ {
+ job->subtitle = j;
+ break;
+ }
+ }
+
+ job->file = strdup( [[NSString stringWithFormat:
@"%@/%p - Title %d.mp4", fConvertFolderString, self,
title->index] UTF8String] );
hb_add( fHandle, job );
@@ -355,16 +395,37 @@
- (void) convertShow
{
- int i;
+ int i, j;
fConvertCheckArray = [[NSMutableArray alloc] initWithCapacity:
hb_list_count( fList )];
+ [fConvertAudioPopUp removeAllItems];
+ [fConvertSubtitlePopUp removeAllItems];
+ [fConvertSubtitlePopUp addItemWithTitle: @"None"];
for( i = 0; i < hb_list_count( fList ); i++ )
{
/* Default is to convert titles longer than 30 minutes. */
hb_title_t * title = hb_list_item( fList, i );
[fConvertCheckArray addObject: [NSNumber numberWithBool:
( 60 * title->hours + title->minutes > 30 )]];
+
+ /* Update audio popup */
+ hb_audio_t * audio;
+ for( j = 0; j < hb_list_count( title->list_audio ); j++ )
+ {
+ audio = hb_list_item( title->list_audio, j );
+ [fConvertAudioPopUp addItemWithTitle:
+ [NSString stringWithUTF8String: audio->lang_simple]];
+ }
+
+ /* Update subtitle popup */
+ hb_subtitle_t * subtitle;
+ for( j = 0; j < hb_list_count( title->list_subtitle ); j++ )
+ {
+ subtitle = hb_list_item( title->list_subtitle, j );
+ [fConvertSubtitlePopUp addItemWithTitle:
+ [NSString stringWithUTF8String: subtitle->lang]];
+ }
}
[fConvertTableView reloadData];