diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs | 68 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueView.xaml | 26 |
5 files changed, 97 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs new file mode 100644 index 000000000..d3440e265 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs @@ -0,0 +1,68 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioQueueDisplayConverter.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Audio Queue Display Converter
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Audio
+{
+ using System;
+ using System.Collections.ObjectModel;
+ using System.Globalization;
+ using System.Text;
+ using System.Windows.Data;
+
+ using HandBrake.ApplicationServices.Functions;
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding;
+
+ /// <summary>
+ /// Audio Queue Display Converter
+ /// </summary>
+ public class AudioQueueDisplayConverter : IValueConverter
+ {
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ /// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ ObservableCollection<AudioTrack> tracks = value as ObservableCollection<AudioTrack>;
+ StringBuilder audioTracks = new StringBuilder();
+ if (tracks != null)
+ {
+ foreach (AudioTrack track in tracks)
+ {
+ if (string.IsNullOrEmpty(audioTracks.ToString()))
+ {
+ audioTracks.Append(EnumHelper<AudioEncoder>.GetDisplay(track.Encoder));
+ }
+ else
+ {
+ audioTracks.Append( "," + EnumHelper<AudioEncoder>.GetDisplay(track.Encoder));
+ }
+ }
+ }
+
+ return audioTracks.ToString();
+ }
+
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ /// <param name="value">The value that is produced by the binding target.</param><param name="targetType">The type to convert to.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 6d5d162b2..7d0270859 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -119,6 +119,7 @@ </Compile>
<Compile Include="Converters\Audio\AudioBitrateConverter.cs" />
<Compile Include="Converters\Audio\AudioEncoderConverter.cs" />
+ <Compile Include="Converters\Audio\AudioQueueDisplayConverter.cs" />
<Compile Include="Converters\BooleanToHiddenVisibilityConverter.cs" />
<Compile Include="Converters\Options\OptionsTabConverter.cs" />
<Compile Include="Converters\Video\VideoEncoderConverter.cs" />
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 156fc1dfa..60272c057 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -785,6 +785,9 @@ namespace HandBrakeWPF.ViewModels this.errorService.ShowMessageBox("HandBrake has determined your built-in presets are out of date... These presets will now be updated.",
"Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);
+ // Queue Recovery
+ QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+
this.SelectedPreset = this.presetService.DefaultPreset;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index b72e093ea..e1c8fccb7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -280,6 +280,7 @@ namespace HandBrakeWPF.ViewModels public void RetryJob(QueueTask task)
{
task.Status = QueueItemStatus.Waiting;
+ this.queueProcessor.QueueManager.BackupQueue(null);
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml index 2fcc8e8c2..e505800fc 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml @@ -8,7 +8,7 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:YourNamespace="clr-namespace:HandBrakeWPF.AttachedProperties"
- Title="{Binding Title}"
+ xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio" Title="{Binding Title}"
Width="600"
Height="400"
MinWidth="600"
@@ -23,6 +23,7 @@ <Converters:FullPathToFileNameConverter x:Key="filePathToFilenameConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
<Converters:QueueStatusToVisibilityConverter x:Key="queueStatusVisConverter" />
+ <Audio:AudioQueueDisplayConverter x:Key="audioTrackDisplayConverter" />
</Window.Resources>
<Grid>
@@ -154,10 +155,31 @@ </ListBox.ContextMenu>
<ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
+ <Style TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Background" Value="WhiteSmoke" />
<Setter Property="Margin" Value="0,0,0,1" />
+ <Setter Property="ToolTip">
+ <Setter.Value>
+ <StackPanel Grid.Column="1"
+ Margin="0,5,0,5"
+ HorizontalAlignment="Stretch">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock FontWeight="Bold" Text="Video" />
+ <TextBlock Text=": " />
+ <TextBlock Text="{Binding Task.VideoEncoder, Converter={StaticResource enumComboConverter}}" />
+ <TextBlock Margin="10,0,0,0" FontWeight="Bold" Text="Audio: " />
+ <TextBlock Text="{Binding Task.AudioTracks, Converter={StaticResource audioTrackDisplayConverter}}" />
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock FontWeight="Bold" Text="Advanced: " />
+ <TextBlock Text="{Binding Task.AdvancedEncoderOptions}" />
+ </StackPanel>
+
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
</Style>
</ListBox.ItemContainerStyle>
|