summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/VideoView.xaml
blob: bc6e1881ec8c0c1b45188e627320f313c27eadab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<UserControl x:Class="HandBrakeWPF.Views.VideoView"
             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:Converters="clr-namespace:HandBrakeWPF.Converters"
             xmlns:Video="clr-namespace:HandBrakeWPF.Converters.Video"
             xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
             xmlns:cal="http://www.caliburnproject.org"
             mc:Ignorable="d" >

    <UserControl.Resources>
        <Converters:BooleanConverter x:Key="boolConverter" />
        <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
        <Converters:EnumComboConverter x:Key="enumComboConverter" />
        <Converters:InverseBooleanConverter x:Key="inverseConverter" />
        <Video:VideoEncoderConverter x:Key="videoEncoderConverter" />
    </UserControl.Resources>

    <Grid Margin="10,5,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>


        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <StackPanel Orientation="Vertical" Grid.Column="0" >

                <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_Video}" FontWeight="Bold" Margin="0,0,0,10"/>

                <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_Codec}" Width="100" />

                    <ComboBox Width="120" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Encoders}" >
                        <ComboBox.SelectedItem>
                            <MultiBinding Converter="{StaticResource videoEncoderConverter}">
                                <Binding Path="SelectedVideoEncoder" />
                            </MultiBinding>
                        </ComboBox.SelectedItem>
                        <ComboBox.ItemsSource>
                            <MultiBinding Converter="{StaticResource videoEncoderConverter}">
                                <Binding Path="VideoEncoders"/>
                                <Binding Path="Task" />
                            </MultiBinding>
                        </ComboBox.ItemsSource>
                    </ComboBox>

                </StackPanel>

                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_Framerate}" VerticalAlignment="Top" Margin="0,5,0,0" Width="100"/>
                    <StackPanel Orientation="Vertical">
                        <ComboBox Width="120" ItemsSource="{Binding Framerates}" SelectedItem="{Binding SelectedFramerate}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Framerate}"  />

                        <StackPanel Orientation="Vertical" >
                            <RadioButton Content="{x:Static Properties:ResourcesUI.VideoView_ConstantFramerate}" IsChecked="{Binding IsConstantFramerate}" Margin="0,5,0,0"
                                         ToolTip="{x:Static Properties:ResourcesTooltips.Video_ConstantFramerate}" />
                            <RadioButton Content="{x:Static Properties:ResourcesUI.VideoView_VariableFramerate}" IsChecked="{Binding IsVariableFramerate}" Margin="0,5,0,0" 
                                     Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_VariableFramerate}"  />
                            <RadioButton Content="{x:Static Properties:ResourcesUI.VideoView_PeakFramerate}" IsChecked="{Binding IsPeakFramerate}" Margin="0,5,0,0"
                                     Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_PeakFramerate}"  />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </StackPanel>


            <StackPanel Orientation="Vertical" Grid.Column="1">
                <TextBlock Text="Quality" FontWeight="Bold" Margin="0,0,0,10"/>

                <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
                    <RadioButton Content="{x:Static Properties:ResourcesUI.VideoView_ConstantQuality}" IsChecked="{Binding IsConstantQuantity}"  Margin="0,0,10,0"
                                 ToolTip="{x:Static Properties:ResourcesTooltips.Video_Quality}" />
                    <TextBlock Text="{Binding DisplayRF}" MinWidth="30" />
                    <TextBlock Text="{Binding Rfqp}" FontWeight="Bold" Margin="5,0,0,0" />

                    <TextBlock Text="{x:Static Properties:Resources.Video_LosslessWarning}" Visibility="{Binding IsLossless, Converter={StaticResource boolToVisConverter}}" 
                           Margin="10,0,0,0" ToolTip="{x:Static Properties:Resources.Video_LosslessWarningTooltip}" FontWeight="Bold" />
                </StackPanel>

                <Slider Width="280" Value="{Binding RF, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left"  Maximum="{Binding QualityMax}" Minimum="{Binding QualityMin}"
                        IsEnabled="{Binding IsConstantQuantity}" Margin="20,0,0,10"
                        ToolTip="{x:Static Properties:ResourcesTooltips.Video_Quality}" Style="{StaticResource LongToolTipHolder}" 
                        IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" />

                <Grid Margin="20,0,0,15" Width="280" HorizontalAlignment="Left">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{x:Static Properties:Resources.Video_LowQuality}" />
                    <TextBlock Text="{Binding HighQualityLabel}" HorizontalAlignment="Right" Grid.Column="1" />
                </Grid>

                <StackPanel Orientation="Horizontal" Margin="0,0,0,6">
                    <RadioButton Content="{x:Static Properties:ResourcesUI.VideoView_AverageBitrate}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_AvgBitrate}" 
                                 IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0"/>
                    <TextBox Width="75" Text="{Binding VideoBitrate, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
                             ToolTip="{x:Static Properties:ResourcesTooltips.Video_AvgBitrate}" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin="30,0,0,0" Visibility="{Binding DisplayNonQSVControls, Converter={StaticResource boolToVisConverter}}">
                    <CheckBox Content="{x:Static Properties:ResourcesUI.VideoView_2Pass}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
                              IsChecked="{Binding TwoPass}" Margin="0,0,10,0" ToolTip="{x:Static Properties:ResourcesTooltips.Video_TwoPass}"  />
                    <CheckBox Content="{x:Static Properties:ResourcesUI.VideoView_TurboFirstPass}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
                              IsChecked="{Binding TurboFirstPass}" Visibility="{Binding DisplayTurboFirstPass, Converter={StaticResource boolToVisConverter}}"
                              ToolTip="{x:Static Properties:ResourcesTooltips.Video_TurboFirstPass}" />
                </StackPanel>

            </StackPanel>

            <!-- H264 settings -->
            <Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="0,5,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_OptimiseVideo}" Margin="0,0,0,0" Grid.Row="0"  Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />

                <CheckBox Content="{x:Static Properties:ResourcesUI.VideoView_UseAdvancedTab}" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}" Margin="0,5,0,0"
                          Visibility="{Binding IsAdvancedTabOptionEnabled, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
                          ToolTip="{x:Static Properties:ResourcesTooltips.Video_AdvancedOptions}" />

                <Grid Grid.Row="2" Margin="0,8,0,0" IsEnabled="{Binding UseAdvancedTab, Converter={StaticResource inverseConverter}}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>



                    <!-- Row 1 -->
                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderPreset}" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}" />
                    <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}">
                        <Slider Minimum="0" Maximum="{Binding VideoPresetMaxValue}" Width="150" Value="{Binding VideoPresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}" 
                            IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Presets}" 
                            Style="{StaticResource LongToolTipHolder}"  />
                        <TextBlock Text="{Binding VideoPreset.DisplayName}" Margin="5,0,0,0" />
                    </StackPanel>

                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncodeTune}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0"
                               Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"/>
                    <ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,10,5,0" Height="22"
                              ItemsSource="{Binding VideoTunes}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoTune}"
                              ToolTip="{x:Static Properties:ResourcesTooltips.Video_EncoderTune}"  Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"
                              Style="{StaticResource LongToolTipHolder}" />
                    <CheckBox IsChecked="{Binding FastDecode}" Content="{x:Static Properties:ResourcesUI.VideoView_FastDecode}" Grid.Row="2" Grid.Column="2" Margin="10,10,10,0" VerticalAlignment="Center"
                              ToolTip="{x:Static Properties:ResourcesTooltips.Video_FastDecode}"  Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"/>

          
                    <!-- Row 2-->
                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderProfile}" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayProfileControl, Converter={StaticResource boolToVisConverter}}"/>
                    <ComboBox Width="100" Grid.Row="3" Grid.Column="1" Margin="5,10,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayProfileControl, Converter={StaticResource boolToVisConverter}}"
                          ItemsSource="{Binding VideoProfiles}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoProfile}"
                          Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Profile}"  />

                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_EncoderLevel}" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}" />
                    <ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}"
                          ItemsSource="{Binding VideoLevels}"  DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoLevel}"
                          Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_Level}" />

                    <!-- Row 3 -->
                    <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_ExtraOptions}" Grid.Row="4" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    <TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinWidth="200" Width="365" HorizontalAlignment="Left" TextWrapping="WrapWithOverflow"
                             Height="30" MaxLines="3" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" Margin="5,10,0,0" VerticalAlignment="Center"
                             ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}" >
                        <TextBox.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Copy Full Query" cal:Message.Attach="[Event Click] = [Action CopyQuery]"  />
                            </ContextMenu>
                        </TextBox.ContextMenu>
                    </TextBox>


                </Grid>
            </Grid>


        </Grid>

    </Grid>
</UserControl>