OSDN Git Service

Pri: Add preference for the default audio stream
author(no author) <(no author)@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 2 Jan 2007 08:05:32 +0000 (08:05 +0000)
committer(no author) <(no author)@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 2 Jan 2007 08:05:32 +0000 (08:05 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@81 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm

index 3516771..e182acd 100644 (file)
@@ -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];
 }