summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/AudioView.xaml
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-06-14 09:59:24 +0000
committersr55 <[email protected]>2012-06-14 09:59:24 +0000
commited72f7ae22fd5b3aae3958704c09b2ecbabd4a0c (patch)
tree9f3da3fab144395666fab79232f1bbef3323e864 /win/CS/HandBrakeWPF/Views/AudioView.xaml
parent9be558d961413ee242da53dfc18a7c819b0faf41 (diff)
WinGui: Some layout tweaks by beta-tester
- disabling sizing on windows, where sizing makes no sense; - limit sizing on windows, where sizing in a wrong directions makes problems; - make controls full sizable, where the readability/information will benefit from; - all windows appears now in ScreenCenter; git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4730 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views/AudioView.xaml')
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml275
1 files changed, 204 insertions, 71 deletions
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index 15bf24113..ccc74e5cf 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -1,14 +1,17 @@
<UserControl x:Class="HandBrakeWPF.Views.AudioView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+ xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio"
xmlns:cal="http://www.caliburnproject.org"
- xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation"
xmlns:Conveters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
- xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio" mc:Ignorable="d">
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation"
+ d:DesignHeight="170"
+ d:DesignWidth="616"
+ mc:Ignorable="d">
<UserControl.Resources>
<Conveters:EnumComboConverter x:Key="enumComboConverter" />
@@ -24,7 +27,10 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
- <TextBlock Text="Audio Tracks" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
+ <TextBlock Grid.Row="0"
+ Margin="10,5,0,0"
+ FontWeight="Bold"
+ Text="Audio Tracks" />
<Grid Grid.Row="1" Margin="10,5,10,0">
<Grid.ColumnDefinitions>
@@ -32,30 +38,58 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <Button Content="Add Track" cal:Message.Attach="[Event Click] = [Action Add]" Grid.Column="0" Width="75" Margin="0,0,10,0" />
-
- <StackPanel Orientation="Horizontal" Grid.Column="2" Visibility="{Binding ShowPassthruOptions, Converter={StaticResource boolToVisConverter}}" >
- <TextBlock Text="Auto Passthru:" Margin="5,0,5,0" />
- <CheckBox Content="MP3" Margin="0,0,5,0" IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowMP3Pass}" />
- <CheckBox Content="AAC" Margin="0,0,5,0" IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAACPass}" />
- <CheckBox Content="AC3" Margin="0,0,5,0" IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
- <CheckBox Content="DTS" Margin="0,0,5,0" IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
- <CheckBox Content="DTSHD" Margin="0,0,5,0" IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSHDPass}" />
- <TextBlock Text="Fallback:" Margin="5,0,5,0" />
- <ComboBox Width="100" Grid.Column="3" Margin="10,0,5,0" Height="22"
- ItemsSource="{Binding DataContext.AudioEncoders, Converter={StaticResource enumComboConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding Task.AllowedPassthruOptions.AudioEncoderFallback, Converter={StaticResource enumComboConverter}}"/>
+ <Button Grid.Column="0"
+ Width="75"
+ Margin="0,0,10,0"
+ cal:Message.Attach="[Event Click] = [Action Add]"
+ Content="Add Track" />
+
+ <StackPanel Grid.Column="2"
+ Orientation="Horizontal"
+ Visibility="{Binding ShowPassthruOptions,
+ Converter={StaticResource boolToVisConverter}}">
+ <TextBlock Margin="5,0,5,0" Text="Auto Passthru:" />
+ <CheckBox Margin="0,0,5,0"
+ Content="MP3"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowMP3Pass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="AAC"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAACPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="AC3"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="DTS"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="DTSHD"
+ 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}}" />
</StackPanel>
</Grid>
- <ListBox Grid.Row="2" ItemsSource="{Binding Task.AudioTracks}"
- SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10"
- dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True"
- dd:DragDrop.DropHandler="{Binding}">
+ <ListBox Grid.Row="2"
+ Margin="10,10,10,10"
+ Background="LightGray"
+ dd:DragDrop.DropHandler="{Binding}"
+ dd:DragDrop.IsDragSource="True"
+ dd:DragDrop.IsDropTarget="True"
+ ItemsSource="{Binding Task.AudioTracks}"
+ SelectionMode="Extended">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
- <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
+ <Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Background" Value="WhiteSmoke" />
<Setter Property="Margin" Value="0,0,0,1" />
</Style>
@@ -71,14 +105,18 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <!-- Marker -->
- <Image Source="Images/Movies.png" Width="16" Height="16" Grid.Column="0" Margin="10,0,10,0" />
+ <!-- Marker -->
+ <Image Grid.Column="0"
+ Width="16"
+ Height="16"
+ Margin="10,0,10,0"
+ Source="Images/Movies.png" />
- <!-- Settings -->
+ <!-- Settings -->
<Grid Grid.Column="1" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" MaxWidth="300" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
@@ -95,15 +133,30 @@
<RowDefinition Height="28" />
</Grid.RowDefinitions>
- <!-- Row 1-->
+ <!-- Row 1 -->
- <TextBlock Text="Source" FontWeight="Bold" Grid.Column="0" VerticalAlignment="Center" />
- <ComboBox Width="100" Grid.Column="1" Margin="5,0,5,0" Height="22"
- ItemsSource="{Binding DataContext.SourceTracks, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding ScannedTrack}"/>
+ <TextBlock Grid.Column="0"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="Source" />
+ <ComboBox Grid.Column="1"
+ Height="22"
+ MaxWidth="300"
+ Margin="5,0,5,0"
+ HorizontalAlignment="Stretch"
+ ItemsSource="{Binding DataContext.SourceTracks,
+ RelativeSource={RelativeSource FindAncestor,
+ AncestorType={x:Type UserControl}}}"
+ SelectedItem="{Binding ScannedTrack}" />
- <TextBlock Text="Codec" FontWeight="Bold" Grid.Column="2" VerticalAlignment="Center" />
- <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22">
+ <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>
<MultiBinding Converter="{StaticResource audioEncoderConverter}">
<Binding Path="Encoder" />
@@ -111,52 +164,132 @@
</ComboBox.SelectedItem>
<ComboBox.ItemsSource>
<MultiBinding Converter="{StaticResource audioEncoderConverter}">
- <Binding Path="DataContext.AudioEncoders"
- RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" />
- <Binding Path="DataContext.Task"
- RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" />
+ <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>
- <TextBlock Text="Bitrate" FontWeight="Bold" Grid.Column="4" VerticalAlignment="Center"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <ComboBox Width="70" Grid.Column="5" Margin="5,0,5,0" Height="22"
+ <TextBlock Grid.Column="4"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="Bitrate"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+ <ComboBox Grid.Column="5"
+ Width="70"
+ Height="22"
+ Margin="5,0,5,0"
+ ItemsSource="{Binding TrackReference,
+ Converter={StaticResource audioBitrateConverter}}"
SelectedItem="{Binding Bitrate}"
- ItemsSource="{Binding TrackReference, Converter={StaticResource audioBitrateConverter}}"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
- <TextBlock Text="Samplerate" FontWeight="Bold" Grid.Column="6" VerticalAlignment="Center"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <ComboBox Width="70" Grid.Column="7" Margin="5,0,5,0" Height="22"
- ItemsSource="{Binding DataContext.SampleRates, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
+ <TextBlock Grid.Column="6"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="Samplerate"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+ <ComboBox Grid.Column="7"
+ Width="70"
+ Height="22"
+ Margin="5,0,5,0"
+ ItemsSource="{Binding DataContext.SampleRates,
+ RelativeSource={RelativeSource FindAncestor,
+ AncestorType={x:Type UserControl}}}"
SelectedItem="{Binding SampleRateDisplayValue}"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
-
- <!-- Row 2-->
- <TextBlock Text="Mixdown" FontWeight="Bold" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <ComboBox Width="100" Grid.Column="1" Margin="5,0,5,0" Grid.Row="1" Height="22"
- ItemsSource="{Binding DataContext.AudioMixdowns, Converter={StaticResource enumComboConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding MixDown, Converter={StaticResource enumComboConverter}}"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
-
- <TextBlock Text="DRC" FontWeight="Bold" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <NumericUpDown:NumericUpDown Name="drcNumericCtl" Width="45" Value="{Binding DRC, Mode=TwoWay}" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Left" Margin="5,0,5,0"
- Minimum="0" Maximum="4" DecimalPlace="1" LargeChange="0.1" SmallChange="0.1"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToHiddenVisConverter}, ConverterParameter=true}" />
-
- <TextBlock Text="Gain" FontWeight="Bold" Grid.Column="4" Grid.Row="1" VerticalAlignment="Center"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <NumericUpDown:NumericUpDown Name="gainNumericCtl" Width="45" Value="{Binding Gain, Mode=TwoWay}" Grid.Row="1" Grid.Column="5" HorizontalAlignment="Left" Margin="5,0,5,0"
- Minimum="-20" Maximum="20" DecimalPlace="0" SmallChange="1" LargeChange="1"
- Visibility="{Binding IsPassthru, Converter={StaticResource boolToHiddenVisConverter}, ConverterParameter=true}"/>
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+
+ <!-- Row 2 -->
+ <TextBlock Grid.Row="1"
+ Grid.Column="0"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="Mixdown"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+ <ComboBox Grid.Row="1"
+ Grid.Column="1"
+ Height="22"
+ MaxWidth="300"
+ Margin="5,0,5,0"
+ HorizontalAlignment="Stretch"
+ ItemsSource="{Binding DataContext.AudioMixdowns,
+ Converter={StaticResource enumComboConverter},
+ RelativeSource={RelativeSource FindAncestor,
+ AncestorType={x:Type UserControl}}}"
+ SelectedItem="{Binding MixDown,
+ Converter={StaticResource enumComboConverter}}"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+
+ <TextBlock Grid.Row="1"
+ Grid.Column="2"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="DRC"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+ <NumericUpDown:NumericUpDown Name="drcNumericCtl"
+ Grid.Row="1"
+ Grid.Column="3"
+ Width="45"
+ Margin="5,0,5,0"
+ HorizontalAlignment="Left"
+ DecimalPlace="1"
+ LargeChange="0.1"
+ Maximum="4"
+ Minimum="0"
+ SmallChange="0.1"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToHiddenVisConverter},
+ ConverterParameter=true}"
+ Value="{Binding DRC,
+ Mode=TwoWay}" />
+
+ <TextBlock Grid.Row="1"
+ Grid.Column="4"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="Gain"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
+ <NumericUpDown:NumericUpDown Name="gainNumericCtl"
+ Grid.Row="1"
+ Grid.Column="5"
+ Width="45"
+ Margin="5,0,5,0"
+ HorizontalAlignment="Left"
+ DecimalPlace="0"
+ LargeChange="1"
+ Maximum="20"
+ Minimum="-20"
+ SmallChange="1"
+ Visibility="{Binding IsPassthru,
+ Converter={StaticResource boolToHiddenVisConverter},
+ ConverterParameter=true}"
+ Value="{Binding Gain,
+ Mode=TwoWay}" />
</Grid>
- <!-- Delete -->
- <Image Source="Images/delete.png" Width="16" Height="16" Grid.Column="2" Margin="10,0,10,0">
+ <!-- Delete -->
+ <Image Grid.Column="2"
+ Width="16"
+ Height="16"
+ Margin="10,0,10,0"
+ Source="Images/delete.png">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown">
<cal:ActionMessage MethodName="Remove">