-
- if ([fAudLang2PopUp indexOfSelectedItem] == 0)
- {
- [fAudLang2PopUp selectItemAtIndex: 1];
- }
- [self audioTrackPopUpChanged: fAudLang2PopUp];
- [fAudTrack2CodecPopUp selectItemWithTitle:[tempObject objectForKey:@"AudioEncoder"]];
- /* check our pref for core audio and use it in place of faac if applicable */
- if ([[NSUserDefaults standardUserDefaults] boolForKey: @"UseCoreAudio"] == YES &&
- [[tempObject objectForKey:@"AudioEncoder"] isEqualToString: @"AAC (faac)"])
- {
- [fAudTrack2CodecPopUp selectItemWithTitle:@"AAC (CoreAudio)"];
- }
- [self audioTrackPopUpChanged: fAudTrack2CodecPopUp];
- [fAudTrack2MixPopUp selectItemWithTitle:[tempObject objectForKey:@"AudioMixdown"]];
- /* check to see if the selections was available, if not, rerun audioTrackPopUpChanged using the codec to just set the default
- * mixdown*/
- if ([fAudTrack2MixPopUp selectedItem] == nil)
- {
- [self audioTrackPopUpChanged: fAudTrack2CodecPopUp];
- }
- [fAudTrack2RatePopUp selectItemWithTitle:[tempObject objectForKey:@"AudioSamplerate"]];
- /* We set the presets bitrate if it is *not* an AC3 track since that uses the input bitrate */
- if (![[tempObject objectForKey:@"AudioEncoder"] isEqualToString:@"AC3 Passthru"])
+ trackLangPopUp = fAudLang2PopUp;
+ mixdownPopUp = fAudTrack2MixPopUp;
+ audiocodecPopUp = fAudTrack2CodecPopUp;
+ sampleratePopUp = fAudTrack2RatePopUp;
+ bitratePopUp = fAudTrack2BitratePopUp;
+ drcSlider = fAudTrack2DrcSlider;
+ }
+ if( i == 3 )
+ {
+ trackLangPopUp = fAudLang3PopUp;
+ mixdownPopUp = fAudTrack3MixPopUp;
+ audiocodecPopUp = fAudTrack3CodecPopUp;
+ sampleratePopUp = fAudTrack3RatePopUp;
+ bitratePopUp = fAudTrack3BitratePopUp;
+ drcSlider = fAudTrack3DrcSlider;
+ }
+ if( i == 4 )
+ {
+ trackLangPopUp = fAudLang4PopUp;
+ mixdownPopUp = fAudTrack4MixPopUp;
+ audiocodecPopUp = fAudTrack4CodecPopUp;
+ sampleratePopUp = fAudTrack4RatePopUp;
+ bitratePopUp = fAudTrack4BitratePopUp;
+ drcSlider = fAudTrack4DrcSlider;
+ }
+
+
+ if ([trackLangPopUp indexOfSelectedItem] == 0)
+ {
+ [trackLangPopUp selectItemAtIndex: 1];
+ }
+ [self audioTrackPopUpChanged: trackLangPopUp];
+ [audiocodecPopUp selectItemWithTitle:[tempObject objectForKey:@"AudioEncoder"]];
+ /* check our pref for core audio and use it in place of faac if applicable */
+ if ([[NSUserDefaults standardUserDefaults] boolForKey: @"UseCoreAudio"] == YES &&
+ [[tempObject objectForKey:@"AudioEncoder"] isEqualToString: @"AAC (faac)"])
+ {
+ [audiocodecPopUp selectItemWithTitle:@"AAC (CoreAudio)"];
+ }
+
+ [self audioTrackPopUpChanged: audiocodecPopUp];
+ [mixdownPopUp selectItemWithTitle:[tempObject objectForKey:@"AudioMixdown"]];
+ /* check to see if the selections was available, if not, rerun audioTrackPopUpChanged using the codec to just set the default
+ * mixdown*/
+ if ([mixdownPopUp selectedItem] == nil)
+ {
+ [self audioTrackPopUpChanged: audiocodecPopUp];
+ }
+ [sampleratePopUp selectItemWithTitle:[tempObject objectForKey:@"AudioSamplerate"]];
+ /* We set the presets bitrate if it is *not* an AC3 track since that uses the input bitrate */
+ if (![[tempObject objectForKey:@"AudioEncoder"] isEqualToString:@"AC3 Passthru"])
+ {
+ [bitratePopUp selectItemWithTitle:[tempObject objectForKey:@"AudioBitrate"]];
+ }
+ [drcSlider setFloatValue:[[tempObject objectForKey:@"AudioTrackDRCSlider"] floatValue]];
+ [self audioDRCSliderChanged: drcSlider];
+
+
+ /* If we are any track greater than 1 check to make sure we have a matching source codec is using ac3 passthru or dts passthru,
+ * if not we will set the track to "None". Track 1 is allowed to mixdown to a suitable DPL2 mix if we cannot passthru */
+
+ if( i > 1 )
+ {
+ /* Check to see if the preset asks for a passhthru track (AC3 or DTS) and verify there is a matching source track if not, set the track to "None". */
+ if (([[tempObject objectForKey:@"AudioEncoder"] isEqualToString:@"AC3 Passthru"] || [[tempObject objectForKey:@"AudioEncoder"] isEqualToString:@"DTS Passthru"]) && [trackLangPopUp indexOfSelectedItem] != 0)