summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-04-12 20:42:17 +0000
committersr55 <[email protected]>2012-04-12 20:42:17 +0000
commit62ee548526fb578b9027ef0d9deac02e509872f8 (patch)
treec14d4687c3a0346950726051249abd91d90e370c
parent8dfb6d1874dbdac2754882b62e1e023af0c515a5 (diff)
WinGui: (WPF) Audio Panel Auto Passthru implementation.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4597 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs15
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs8
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml16
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml13
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml.cs6
5 files changed, 54 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index b8485be40..e2d71b354 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -87,6 +87,17 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public EncodeTask Task { get; set; }
+ /// <summary>
+ /// Gets a value indicating whether ShowPassthruOptions.
+ /// </summary>
+ public bool ShowPassthruOptions
+ {
+ get
+ {
+ return this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);
+ }
+ }
+
#endregion
#region Public Methods
@@ -129,11 +140,13 @@ namespace HandBrakeWPF.ViewModels
public void SetPreset(Preset preset, EncodeTask task)
{
this.Task = task;
- this.NotifyOfPropertyChange(() => this.Task);
+
if (preset != null && preset.Task != null)
{
this.AddTracksFromPreset(preset);
+ this.Task.AllowedPassthruOptions = new AllowedPassthru(preset.Task.AllowedPassthruOptions);
}
+ this.NotifyOfPropertyChange(() => this.Task);
this.Task.AllowedPassthruOptions.IsEnabled =
this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index ad60af389..55b53ffa1 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1151,6 +1151,14 @@ namespace HandBrakeWPF.ViewModels
this.SelectedPreset = e.NewValue as Preset;
}
+ /// <summary>
+ /// Show Release Notes
+ /// </summary>
+ public void ReleaseNotes()
+ {
+ Process.Start("https://forum.handbrake.fr/viewtopic.php?f=11&t=23843");
+ }
+
#endregion
#region Private Methods
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index a27c02085..450d463e5 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -11,6 +11,7 @@
<UserControl.Resources>
<Conveters:EnumComboConverter x:Key="enumComboConverter" />
+ <Conveters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
@@ -24,9 +25,24 @@
<Grid Grid.Row="1" Margin="10,5,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
+ <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}}"/>
+ </StackPanel>
+
</Grid>
<ListBox Grid.Row="2" ItemsSource="{Binding Task.AudioTracks}"
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 15e01502a..347b85dac 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -16,8 +16,8 @@
</i:EventTrigger>
</i:Interaction.Triggers>
- <Window.Resources>
-
+ <Window.Resources>
+
<Style TargetType="Button">
<Setter Property="Foreground" Value="DarkOrange" />
<Setter Property="FontWeight" Value="Bold" />
@@ -121,7 +121,7 @@
<Label Content="Source" Margin="8,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</MenuItem.Header>
-
+
</MenuItem>
</Menu>
@@ -331,6 +331,13 @@
<!-- Status Bar -->
<StatusBar Padding="0" Margin="0" Grid.Row="6" Height="32" Grid.ColumnSpan="2" VerticalAlignment="Bottom" >
<Label Content="{Binding Path=StatusLabel}" FontSize="11" Padding="0,0,0,5" VerticalAlignment="Center" />
+
+ <TextBlock VerticalAlignment="Top" HorizontalAlignment="Right" Padding="0,0,0,5" FontSize="11" FontWeight="Bold">
+ <Hyperlink NavigateUri="http://forum.handbrake.fr/viewtopic.php?f=11&amp;t=23843" RequestNavigate="Hyperlink_RequestNavigate">
+ BETA WPF UI Release Notes
+ </Hyperlink>
+ </TextBlock>
+
</StatusBar>
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
index 165e74923..163a3d807 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
@@ -9,6 +9,7 @@
namespace HandBrakeWPF.Views
{
+ using System.Diagnostics;
using System.Windows;
/// <summary>
@@ -23,5 +24,10 @@ namespace HandBrakeWPF.Views
{
InitializeComponent();
}
+
+ private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
+ {
+ Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
+ }
}
}