From 4c3f7059899019644cc33ccb99954acb828b5ae4 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b64f7644-9d1e-0410-96f1-a4d463321fa5> Date: Tue, 2 Jan 2007 08:05:32 +0000 Subject: [PATCH] Pri: Add preference for the default audio stream git-svn-id: svn://localhost/HandBrake/trunk@81 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 35167715..e182acdf 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -785,6 +785,11 @@ static int FormatSettings[3][4] = /* Update lang popups */ hb_audio_t * audio; + // PRI CHANGES 02/12/06 + NSString * audiotmppri; + NSString * audiosearchpri=[[NSUserDefaults standardUserDefaults] stringForKey:@"DefaultLanguage"]; + int indxpri=0; + // End of pri changes 02/12/06 [fAudLang1PopUp removeAllItems]; [fAudLang2PopUp removeAllItems]; [fAudLang1PopUp addItemWithTitle: _( @"None" )]; @@ -792,6 +797,14 @@ static int FormatSettings[3][4] = for( int i = 0; i < hb_list_count( title->list_audio ); i++ ) { audio = (hb_audio_t *) hb_list_item( title->list_audio, i ); + // PRI CHANGES 02/12/06 + audiotmppri=(NSString *) [NSString stringWithCString: audio->lang]; + // Try to find the desired default language + if ([audiotmppri hasPrefix:audiosearchpri] && indxpri==0) + { + indxpri=i+1; + } + // End of pri changes 02/12/06 [[fAudLang1PopUp menu] addItemWithTitle: [NSString stringWithCString: audio->lang] @@ -800,7 +813,10 @@ static int FormatSettings[3][4] = [NSString stringWithCString: audio->lang] action: NULL keyEquivalent: @""]; } - [fAudLang1PopUp selectItemAtIndex: 1]; + // PRI CHANGES 02/12/06 + if (indxpri==0) { indxpri=1; } + [fAudLang1PopUp selectItemAtIndex: indxpri]; + // End of pri changes 02/12/06 [fAudLang2PopUp selectItemAtIndex: 0]; } -- 2.11.0