diff options
author | sr55 <[email protected]> | 2012-07-23 16:57:39 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-07-23 16:57:39 +0000 |
commit | 6c8108e0760796e153f62de9b08325f433105bff (patch) | |
tree | f584e99a9ace46b1bce9af6f9136f67375cb1226 /win/CS/HandBrakeWPF | |
parent | daafb500d527e3e5d1a1790bba6dd287c28eedbb (diff) |
WinGui: Fix up the Audio Passthru selection options.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4872 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/AudioView.xaml | 40 |
3 files changed, 34 insertions, 19 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs index ee975f876..061dbd6e8 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs @@ -57,6 +57,16 @@ namespace HandBrakeWPF.Converters.Audio encoders.Remove(AudioEncoder.ffflac);
}
+ if (parameter != null && parameter.ToString() == "True")
+ {
+ encoders.Remove(AudioEncoder.DtsHDPassthrough);
+ encoders.Remove(AudioEncoder.DtsPassthrough);
+ encoders.Remove(AudioEncoder.AacPassthru);
+ encoders.Remove(AudioEncoder.Ac3Passthrough);
+ encoders.Remove(AudioEncoder.Mp3Passthru);
+ encoders.Remove(AudioEncoder.Passthrough);
+ }
+
return EnumHelper<AudioEncoder>.GetEnumDisplayValuesSubset(encoders);
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 5fcfef614..6e1fcd675 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -179,9 +179,6 @@ namespace HandBrakeWPF.ViewModels this.Task.AllowedPassthruOptions = new AllowedPassthru(preset.Task.AllowedPassthruOptions);
}
this.NotifyOfPropertyChange(() => this.Task);
-
- this.Task.AllowedPassthruOptions.IsEnabled =
- this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml index 3741e3c07..a7e03d935 100644 --- a/win/CS/HandBrakeWPF/Views/AudioView.xaml +++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml @@ -48,33 +48,41 @@ Orientation="Horizontal"
Visibility="{Binding ShowPassthruOptions,
Converter={StaticResource boolToVisConverter}}">
- <TextBlock Margin="5,0,5,0" Text="Auto Passthru:" />
+ <TextBlock Margin="5,0,5,0" Text="Auto Passthru:" VerticalAlignment="Center" />
<CheckBox Margin="0,0,5,0"
- Content="MP3"
+ Content="MP3" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowMP3Pass}" />
<CheckBox Margin="0,0,5,0"
- Content="AAC"
+ Content="AAC" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAACPass}" />
<CheckBox Margin="0,0,5,0"
- Content="AC3"
+ Content="AC3" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
<CheckBox Margin="0,0,5,0"
- Content="DTS"
+ Content="DTS" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
<CheckBox Margin="0,0,5,0"
- Content="DTSHD"
+ Content="DTSHD" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSHDPass}" />
<TextBlock Margin="5,0,5,0" Text="Fallback:" />
- <ComboBox Grid.Column="3"
- Width="100"
- Height="22"
- Margin="10,0,5,0"
- ItemsSource="{Binding DataContext.AudioEncoders,
- Converter={StaticResource enumComboConverter},
- RelativeSource={RelativeSource FindAncestor,
- AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding Task.AllowedPassthruOptions.AudioEncoderFallback,
- Converter={StaticResource enumComboConverter}}" />
+
+ <ComboBox Grid.Column="3" VerticalAlignment="Center"
+ Width="100"
+ Height="22"
+ Margin="10,0,5,0">
+ <ComboBox.SelectedItem>
+ <MultiBinding Converter="{StaticResource audioEncoderConverter}">
+ <Binding Path="Task.AllowedPassthruOptions.AudioEncoderFallback" />
+ </MultiBinding>
+ </ComboBox.SelectedItem>
+ <ComboBox.ItemsSource>
+ <MultiBinding Converter="{StaticResource audioEncoderConverter}" ConverterParameter="True">
+ <Binding Path="DataContext.AudioEncoders" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" />
+ <Binding Path="DataContext.Task" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" />
+ </MultiBinding>
+ </ComboBox.ItemsSource>
+ </ComboBox>
+
</StackPanel>
</Grid>
|