summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-02-16 18:39:29 +0000
committersr55 <[email protected]>2014-02-16 18:39:29 +0000
commitd4327b0f304b99a7650b12622b48e6145794ab65 (patch)
treef0c0912f10a487d077ad36277f67f84889f176e2 /win/CS/HandBrakeWPF/Views
parent4c18d60bcd318aae2c39b3d898e96ce0470c7277 (diff)
WinGui: Initial work to refactor the Audio and Subtitle behavioural based automatic track selections. This is not quite complete yet but close enough for gathering feedback.
- Simplified UI design that's now available on the "Subtitle" and "Audio" tabs rather than the Options screen. The settings are no longer part of the app preferences. They are now per-preset. Build in presets default to None. - Selected Languages can now be set independently for Audio and Video. - Preferred Language is now part of the Selected Languages list. - Warning: Import/Export of presets still to be implemented. Design may yet change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6036 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml202
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml105
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml106
3 files changed, 249 insertions, 164 deletions
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index 0b9dd5a8d..a2d303cca 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -12,6 +12,7 @@
xmlns:dropButton="clr-namespace:HandBrakeWPF.Controls.DropButton"
xmlns:splitButton="clr-namespace:HandBrakeWPF.Controls.SplitButton"
xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
+ xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"
d:DesignHeight="170"
d:DesignWidth="616"
mc:Ignorable="d"
@@ -23,8 +24,9 @@
<Conveters:BooleanToHiddenVisibilityConverter x:Key="boolToHiddenVisConverter" />
<Audio:AudioBitrateConverter x:Key="audioBitrateConverter" />
<Audio:AudioEncoderConverter x:Key="audioEncoderConverter" />
+ <Audio:AudioBehaviourConverter x:Key="audioBehaviourConverter" />
</UserControl.Resources>
-
+
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -32,18 +34,38 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+
+ <!-- Row 0 -->
<TextBlock Grid.Row="0"
Margin="10,5,0,0"
FontWeight="Bold"
- Text="Audio Tracks" />
+ VerticalAlignment="Top"
+ Text="{Binding PanelTitle}" />
- <Grid Grid.Row="1" Margin="10,5,10,0">
+ <Grid Grid.Row="0" Grid.Column="1" Margin="0,5,10,0">
+ <Border cal:Message.Attach="[Event MouseDown] = [Action ShowAudioDefaults]">
+ <StackPanel Orientation="Horizontal">
+ <Image Source="../Views/Images/Advanced.png" Width="20" />
+ <TextBlock Text="{Binding SwitchDisplayTitle}" VerticalAlignment="Center" Margin="5,0,0,0" />
+ </StackPanel>
+ </Border>
+ </Grid>
+
+ <!-- Row 1 -->
+
+ <Grid Grid.Row="1" Margin="10,5,10,0" Grid.Column="0"
+ Visibility="{Binding ShowAudioDefaultsPanel, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
-
+
<StackPanel Orientation="Horizontal" Grid.Row="0">
<splitButton:SplitMenuButton Content="Add Track" cal:Message.Attach="[Event Click] = [Action Add]" FontWeight="Bold" Margin="0,0,10,0">
<splitButton:SplitMenuButton.ItemSource>
@@ -52,7 +74,7 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
</splitButton:SplitMenuButton.ItemSource>
</splitButton:SplitMenuButton>
-
+
<Button MinWidth="65"
Margin="0,0,10,0"
cal:Message.Attach="[Event Click] = [Action Clear]"
@@ -60,51 +82,12 @@
</StackPanel>
-
- <StackPanel Grid.Column="2"
- Orientation="Horizontal"
- Visibility="{Binding ShowPassthruOptions,
- Converter={StaticResource boolToVisConverter}}">
- <TextBlock Margin="5,0,5,0" Text="Auto Passthru:" VerticalAlignment="Center" />
- <CheckBox Margin="0,0,5,0"
- Content="MP3" VerticalAlignment="Center"
- IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowMP3Pass}" />
- <CheckBox Margin="0,0,5,0"
- Content="AAC" VerticalAlignment="Center"
- IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAACPass}" />
- <CheckBox Margin="0,0,5,0"
- Content="AC3" VerticalAlignment="Center"
- IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
- <CheckBox Margin="0,0,5,0"
- Content="DTS" VerticalAlignment="Center"
- IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
- <CheckBox Margin="0,0,5,0"
- Content="DTSHD" VerticalAlignment="Center"
- IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSHDPass}" />
- <TextBlock Margin="5,0,5,0" Text="Fallback:" />
-
- <ComboBox 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>
- <ListBox Grid.Row="2"
+ <!-- Row 2 -->
+
+ <ListBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
+ Visibility="{Binding ShowAudioDefaultsPanel, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"
Margin="10,10,10,10"
dd:DragDrop.DropHandler="{Binding}"
dd:DragDrop.IsDragSource="True"
@@ -120,7 +103,7 @@
</Style.Triggers>
</Style>
</ListBox.Style>
-
+
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
@@ -147,7 +130,7 @@
<ListBox.ItemTemplate>
<DataTemplate>
-
+
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -191,7 +174,7 @@
<ComboBox Grid.Column="1" Height="22" Width="100" Margin="5,0,5,0" HorizontalAlignment="Stretch"
ItemsSource="{Binding DataContext.SourceTracks, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
SelectedItem="{Binding ScannedTrack}" />
-
+
<TextBlock Grid.Column="2" VerticalAlignment="Center" FontWeight="Bold" Text="Codec" />
<ComboBox Grid.Column="3" Width="100" Height="22" Margin="5,0,5,0">
<ComboBox.SelectedItem>
@@ -213,7 +196,7 @@
SelectedItem="{Binding Bitrate}"
Visibility="{Binding CannotSetBitrate, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
-
+
<!-- Row 2 -->
<TextBlock Grid.Row="0" Grid.Column="6" VerticalAlignment="Center" FontWeight="Bold" Text="Mixdown"
Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
@@ -222,7 +205,7 @@
SelectedItem="{Binding MixDown, Converter={StaticResource enumComboConverter}}"
Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
-
+
<ToggleButton Name="advancedOptionsToggle" VerticalAlignment="Center" Grid.Column="8" Grid.Row="0" Grid.ColumnSpan="2"
Padding="3,0" Height="22" HorizontalAlignment="Left" >
@@ -240,7 +223,7 @@
</Style>
</ToggleButton.Style>
</ToggleButton>
-
+
</Grid>
<!-- Delete -->
@@ -284,7 +267,7 @@
<TextBlock Text="Track Name:" VerticalAlignment="Center" FontWeight="Bold" Margin="5,0,5,0" />
<TextBox Text="{Binding TrackName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="138" Height="22" />
- </StackPanel>
+ </StackPanel>
</Grid>
</Grid>
@@ -292,5 +275,114 @@
</ListBox.ItemTemplate>
</ListBox>
+ <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,10,10,10"
+ Visibility="{Binding ShowAudioDefaultsPanel, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}">
+
+ <Grid Margin="5,0,0,0" >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <!-- Audio -->
+ <TextBlock Text="Track Selection Behaviour:" Grid.Column="0" Grid.Row="0" Margin="0,0,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
+ <ComboBox Name="autoAudioMode" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left"
+ ItemsSource="{Binding AudioBehaviourModeList, Converter={StaticResource audioBehaviourConverter}}"
+ SelectedItem="{Binding AudioBehaviours.SelectedBehaviour, Converter={StaticResource audioBehaviourConverter}}" Width="210" Margin="0,0,5,0" />
+ </Grid>
+
+ <TextBlock Text="Choose Languages:" Margin="5,15,0,5" />
+
+ <Grid Margin="20,5,0,0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Horizontal">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Vertical" Grid.Column="0">
+ <TextBlock Text="Available Languages:" Margin="0,0,0,5"/>
+ <ListBox Name="availableLanguages" ItemsSource="{Binding AvailableLanguages}"
+ helpers:ListBoxHelper.SelectedItems="{Binding SelectedAvailableToMove}"
+ SelectionMode="Extended" Width="140" Height="120" />
+ </StackPanel>
+
+ <DockPanel Grid.Column="1" Margin="10,0,10,0">
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center">
+ <Button Content="Move Right" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveRight]" MaxWidth="90" />
+ <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" MaxWidth="90" />
+ <Button Content="Clear" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageClearAll]" Width="80"/>
+ </StackPanel>
+ </DockPanel>
+
+ <StackPanel Orientation="Vertical" Grid.Column="2">
+ <TextBlock Text="Chosen Languages:" Margin="0,0,0,5"/>
+ <ListBox Name="selectedLangauges" ItemsSource="{Binding AudioBehaviours.SelectedLangauges}"
+ helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}"
+ SelectionMode="Extended" Width="140" Height="120"
+ dd:DragDrop.DropHandler="{Binding}"
+ dd:DragDrop.IsDragSource="True"
+ dd:DragDrop.IsDropTarget="True"/>
+ </StackPanel>
+ </Grid>
+ </StackPanel>
+ </Grid>
+
+ <TextBlock Text="Automatic Passthru Behaviours:" FontWeight="Bold" Margin="0,20,0,5" />
+ <StackPanel Margin="10,5,0,0"
+ Orientation="Horizontal">
+ <TextBlock Margin="5,0,5,0" Text="Allow passthrough of:" VerticalAlignment="Center" />
+ <CheckBox Margin="0,0,5,0"
+ Content="MP3" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowMP3Pass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="AAC" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAACPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="AC3" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="DTS" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="DTSHD" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSHDPass}" />
+
+ <TextBlock Margin="15,0,5,0" Text="Fallback Encoder:" />
+
+ <ComboBox 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>
+
+ </StackPanel>
+
+
</Grid>
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index ad1a20ca4..4f28678c9 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -202,111 +202,6 @@
</StackPanel>
</StackPanel>
- <StackPanel Name="Audio" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.AudioAndSubtitles}}">
-
-
- <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
- <TextBlock Text="Audio and Subtitle Language Handling" FontSize="16" />
- </Border>
- <TextBlock Text="Control the default selection behaviour for audio and subtitle tracks" Margin="0,10,0,10" />
-
- <TextBlock Text="Select your preferred languages" Grid.Column="0" Margin="10,10,0,0" FontSize="14"/>
-
- <Grid Margin="20,10,0,0" >
- <StackPanel Orientation="Horizontal">
- <TextBlock VerticalAlignment="Center" Text="Audio: " />
- <ComboBox Name="primaryAudioLanguage" VerticalAlignment="Center" ItemsSource="{Binding PreferredLanguages}"
- SelectedItem="{Binding SelectedPreferredLangauge}" Width="120" />
- <TextBlock VerticalAlignment="Center" Text="Subtitles: " Margin="10,0,0,0" />
- <ComboBox Name="primarySubtitleLanguage" VerticalAlignment="Center" ItemsSource="{Binding PreferredLanguages}"
- SelectedItem="{Binding SelectedPreferredSubtitleLangauge}" Width="120" />
- </StackPanel>
- </Grid>
-
- <TextBlock Text="Automatic language selection behaviour" Margin="10,20,0,0" FontSize="14"/>
-
- <Grid Margin="20,10,0,0" >
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <!-- Audio -->
- <TextBlock Text="Audio:" Grid.Column="0" Grid.Row="0" Margin="0,0,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
- <ComboBox Name="autoAudioMode" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left"
- ItemsSource="{Binding AddAudioModeOptions}" SelectedIndex="{Binding SelectedAddAudioMode}" Width="120" Margin="0,0,5,0" />
- <CheckBox Content="Add only one audio track per language" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left"
- IsChecked="{Binding AddOnlyOneAudioTrackPerLanguage}" Margin="0,5,0,0" />
-
- <!-- Subtitles -->
- <TextBlock Text="Subtitle:" Grid.Column="2" Grid.Row="0" Margin="0,0,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
- <ComboBox Name="autoSubtitleMode" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Left"
- ItemsSource="{Binding AddSubtitleModeOptions}" SelectedIndex="{Binding SelectedAddSubtitleMode}" Width="120" Margin="0,0,5,0" />
- <CheckBox Content="Add Closed Captions when available" Grid.Column="3" Grid.Row="1" Margin="0,5,0,0"
- HorizontalAlignment="Left" IsChecked="{Binding AddClosedCaptions}"/>
- <CheckBox Content="Add 'Foreign Audio Scan'" Grid.Column="3" Grid.Row="2" Margin="0,5,0,0"
- HorizontalAlignment="Left" IsChecked="{Binding AddForeignAudioScanTrack}"/>
- </Grid>
-
- <TextBlock Text="Additional languages for possible selection" Margin="10,20,0,0" FontSize="14"/>
-
- <Grid Margin="20,20,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <StackPanel Orientation="Horizontal">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <StackPanel Orientation="Vertical" Grid.Column="0">
- <TextBlock Text="Available Languages" Margin="0,0,0,5"/>
- <ListBox Name="availableLanguages" ItemsSource="{Binding AvailableLanguages}" Helpers:ListBoxHelper.SelectedItems="{Binding SelectedAvailableToMove}"
- SelectionMode="Extended" Width="140" Height="140"></ListBox>
- </StackPanel>
-
- <DockPanel Grid.Column="1" Margin="10,0,10,0">
- <StackPanel Orientation="Vertical" VerticalAlignment="Center">
- <Button Content="Move Right" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveRight]" MaxWidth="90" />
- <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" MaxWidth="90" />
- <Button Content="Clear" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageClearAll]" Width="80"/>
- </StackPanel>
- </DockPanel>
-
- <StackPanel Orientation="Vertical" Grid.Column="2">
- <TextBlock Text="Chosen Selected Languages" Margin="0,0,0,5"/>
- <ListBox Name="selectedLangauges" ItemsSource="{Binding SelectedLangauges}" Helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}"
- SelectionMode="Extended" Width="140" Height="140"
- dd:DragDrop.DropHandler="{Binding}"
- dd:DragDrop.IsDragSource="True"
- dd:DragDrop.IsDropTarget="True"/>
- </StackPanel>
- </Grid>
- </StackPanel>
- </Grid>
-
- <StackPanel Orientation="Vertical" Margin="0,10,0,0">
- <Label Content="Audio Tab Options" FontSize="14"/>
- <CheckBox IsChecked="{Binding ShowAdvancedPassthruOpts}" Content="Show advanced audio passthru options. (Requires Restart)"
- Margin="20,0,0,0" />
- </StackPanel>
-
- </StackPanel>
-
<StackPanel Name="Hardware" Orientation="Vertical" Margin="10,10,0,0"
Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Video}}">
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index d8e2052ca..3e1db6857 100644
--- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -10,12 +10,15 @@
xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
xmlns:dropButton="clr-namespace:HandBrakeWPF.Controls.DropButton"
xmlns:splitButton="clr-namespace:HandBrakeWPF.Controls.SplitButton"
+ xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"
+ xmlns:subtitles="clr-namespace:HandBrakeWPF.Converters.Subtitles"
d:DesignHeight="153"
d:DesignWidth="319"
mc:Ignorable="d"
x:Name="subTab">
<UserControl.Resources>
<Converters:BooleanToVisibilityConverter x:Key="booleanToVisConverter" />
+ <subtitles:SubtitleBehaviourConverter x:Key="subtitleBehaviourConverter" />
</UserControl.Resources>
<Grid>
@@ -25,12 +28,30 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
- <TextBlock Grid.Row="0"
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <!-- Row 0 -->
+ <TextBlock Grid.Row="0" Grid.Column="0"
Margin="10,5,0,0"
FontWeight="Bold"
- Text="Subtitles" />
+ VerticalAlignment="Top"
+ Text="{Binding PanelTitle}" />
+
+ <Grid Grid.Row="0" Grid.Column="1" Margin="0,5,10,0">
+ <Border cal:Message.Attach="[Event MouseDown] = [Action ShowSubtitleDefaultsPanel]">
+ <StackPanel Orientation="Horizontal">
+ <Image Source="../Views/Images/Advanced.png" Width="20" />
+ <TextBlock Text="{Binding SwitchDisplayTitle}" VerticalAlignment="Center" Margin="5,0,0,0" />
+ </StackPanel>
+ </Border>
+ </Grid>
- <StackPanel Grid.Row="1" Margin="10,5,10,0" Orientation="Horizontal">
+ <!-- Row 1 -->
+ <StackPanel Grid.Row="1" Margin="10,5,10,0" Orientation="Horizontal"
+ Visibility="{Binding ShowDefaultsPanel, Converter={StaticResource booleanToVisConverter}, ConverterParameter=true}" >
<splitButton:SplitMenuButton Content="Add Track" cal:Message.Attach="[Event Click] = [Action Add]" FontWeight="Bold" Margin="0,0,10,0">
<splitButton:SplitMenuButton.ItemSource>
<MenuItem Header="Add New Track" cal:Message.Attach="[Event Click] = [Action Add]" />
@@ -50,7 +71,10 @@
Content="Clear" />
</StackPanel>
- <ListBox Grid.Row="2"
+
+ <!-- Row 2 -->
+ <ListBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
+ Visibility="{Binding ShowDefaultsPanel, Converter={StaticResource booleanToVisConverter}, ConverterParameter=true}"
Margin="10,10,10,10"
dd:DragDrop.DropHandler="{Binding}"
dd:DragDrop.IsDragSource="True"
@@ -237,6 +261,80 @@
</ListBox.ItemTemplate>
</ListBox>
+ <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,10,10,10"
+ Visibility="{Binding ShowDefaultsPanel, Converter={StaticResource booleanToVisConverter}, ConverterParameter=false}">
+
+ <Grid Margin="5,0,0,0" >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <!-- Subtitles -->
+ <TextBlock Text="Track Selection Behaviour:" Grid.Column="2" Grid.Row="0" Margin="0,0,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
+ <ComboBox Name="autoSubtitleMode" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Left"
+ ItemsSource="{Binding SubtitleBehaviourModeList, Converter={StaticResource subtitleBehaviourConverter}}"
+ SelectedItem="{Binding SubtitleBehaviours.SelectedBehaviour, Converter={StaticResource subtitleBehaviourConverter}}" Width="210" Margin="0,0,5,0" />
+ <CheckBox Content="Add Closed Captions when available" Grid.Column="3" Grid.Row="1" Margin="0,5,0,0"
+ HorizontalAlignment="Left" IsChecked="{Binding SubtitleBehaviours.AddClosedCaptions}"/>
+ <CheckBox Content="Add 'Foreign Audio Scan'" Grid.Column="3" Grid.Row="2" Margin="0,5,0,0"
+ HorizontalAlignment="Left" IsChecked="{Binding SubtitleBehaviours.AddForeignAudioScanTrack}"/>
+ </Grid>
+
+ <TextBlock Text="Choose Languages:" Margin="5,15,0,0"/>
+
+ <Grid Margin="20,5,0,0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Horizontal">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Vertical" Grid.Column="0">
+ <TextBlock Text="Available Languages:" Margin="0,0,0,5"/>
+ <ListBox Name="availableLanguages" ItemsSource="{Binding AvailableLanguages}"
+ helpers:ListBoxHelper.SelectedItems="{Binding SelectedAvailableToMove}"
+ SelectionMode="Extended" Width="140" Height="120" />
+ </StackPanel>
+
+ <DockPanel Grid.Column="1" Margin="10,0,10,0">
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center">
+ <Button Content="Move Right" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveRight]" MaxWidth="90" />
+ <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" MaxWidth="90" />
+ <Button Content="Clear" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageClearAll]" Width="80"/>
+ </StackPanel>
+ </DockPanel>
+
+ <StackPanel Orientation="Vertical" Grid.Column="2">
+ <TextBlock Text="Chosen Languages:" Margin="0,0,0,5"/>
+ <ListBox Name="selectedLangauges" ItemsSource="{Binding SubtitleBehaviours.SelectedLangauges}"
+ helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}"
+ SelectionMode="Extended" Width="140" Height="120"
+ dd:DragDrop.DropHandler="{Binding}"
+ dd:DragDrop.IsDragSource="True"
+ dd:DragDrop.IsDropTarget="True"/>
+ </StackPanel>
+ </Grid>
+ </StackPanel>
+ </Grid>
+
+ </StackPanel>
+
</Grid>
</UserControl>