diff options
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs | 65 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs | 65 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/DriveDetectService.cs | 48 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 15 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/AdvancedView.xaml | 11 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/Styles/Styles.xaml | 17 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/VideoView.xaml | 2 |
10 files changed, 199 insertions, 27 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs index 0e65a3502..b78ca5ad8 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Audio.cs @@ -112,5 +112,70 @@ namespace HandBrake.ApplicationServices.Parsing return string.Format("{0} {1} ({2}) ({3})", this.TrackNumber, this.Language, this.Format, this.Description);
}
+
+ /// <summary>
+ /// The equals.
+ /// </summary>
+ /// <param name="other">
+ /// The other.
+ /// </param>
+ /// <returns>
+ /// The System.Boolean.
+ /// </returns>
+ public bool Equals(Audio other)
+ {
+ if (ReferenceEquals(null, other))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+ return other.TrackNumber == this.TrackNumber && object.Equals(other.Language, this.Language) && object.Equals(other.LanguageCode, this.LanguageCode) && object.Equals(other.Format, this.Format);
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
+ /// </returns>
+ /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
+ if (obj.GetType() != typeof(Audio))
+ {
+ return false;
+ }
+ return Equals((Audio)obj);
+ }
+
+ /// <summary>
+ /// Serves as a hash function for a particular type.
+ /// </summary>
+ /// <returns>
+ /// A hash code for the current <see cref="T:System.Object"/>.
+ /// </returns>
+ /// <filterpriority>2</filterpriority>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int result = this.TrackNumber;
+ result = (result * 397) ^ (this.Language != null ? this.Language.GetHashCode() : 0);
+ result = (result * 397) ^ (this.LanguageCode != null ? this.LanguageCode.GetHashCode() : 0);
+ result = (result * 397) ^ (this.Format != null ? this.Format.GetHashCode() : 0);
+ return result;
+ }
+ }
}
}
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs index 6548f3aaf..20deeae1b 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Subtitle.cs @@ -175,5 +175,70 @@ namespace HandBrake.ApplicationServices.Parsing {
return this.SubtitleType == SubtitleType.ForeignAudioSearch ? "Foreign Audio Scan" : string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.TypeString);
}
+
+ /// <summary>
+ /// The equals.
+ /// </summary>
+ /// <param name="other">
+ /// The other.
+ /// </param>
+ /// <returns>
+ /// The System.Boolean.
+ /// </returns>
+ public bool Equals(Subtitle other)
+ {
+ if (ReferenceEquals(null, other))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, other))
+ {
+ return true;
+ }
+ return other.TrackNumber == this.TrackNumber && object.Equals(other.Language, this.Language) && object.Equals(other.LanguageCode, this.LanguageCode) && object.Equals(other.SubtitleType, this.SubtitleType);
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+ /// </summary>
+ /// <returns>
+ /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
+ /// </returns>
+ /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
+ if (obj.GetType() != typeof(Subtitle))
+ {
+ return false;
+ }
+ return Equals((Subtitle)obj);
+ }
+
+ /// <summary>
+ /// Serves as a hash function for a particular type.
+ /// </summary>
+ /// <returns>
+ /// A hash code for the current <see cref="T:System.Object"/>.
+ /// </returns>
+ /// <filterpriority>2</filterpriority>
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int result = this.TrackNumber;
+ result = (result * 397) ^ (this.Language != null ? this.Language.GetHashCode() : 0);
+ result = (result * 397) ^ (this.LanguageCode != null ? this.LanguageCode.GetHashCode() : 0);
+ result = (result * 397) ^ this.SubtitleType.GetHashCode();
+ return result;
+ }
+ }
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/DriveDetectService.cs b/win/CS/HandBrakeWPF/Services/DriveDetectService.cs index 7f1b3f9b9..3a4ef5113 100644 --- a/win/CS/HandBrakeWPF/Services/DriveDetectService.cs +++ b/win/CS/HandBrakeWPF/Services/DriveDetectService.cs @@ -11,6 +11,7 @@ namespace HandBrakeWPF.Services {
using System;
using System.Management;
+ using System.Threading;
using HandBrakeWPF.Services.Interfaces;
@@ -37,28 +38,32 @@ namespace HandBrakeWPF.Services /// </param>
public void StartDetection(Action action)
{
- this.detectionAction = action;
+ ThreadPool.QueueUserWorkItem(
+ delegate
+ {
+ this.detectionAction = action;
- var options = new ConnectionOptions { EnablePrivileges = true };
- var scope = new ManagementScope(@"root\CIMV2", options);
+ var options = new ConnectionOptions { EnablePrivileges = true };
+ var scope = new ManagementScope(@"root\CIMV2", options);
- try
- {
- var query = new WqlEventQuery
- {
- EventClassName = "__InstanceModificationEvent",
- WithinInterval = TimeSpan.FromSeconds(1),
- Condition = @"TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 5" // DriveType - 5: CDROM
- };
+ try
+ {
+ var query = new WqlEventQuery
+ {
+ EventClassName = "__InstanceModificationEvent",
+ WithinInterval = TimeSpan.FromSeconds(1),
+ Condition = @"TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 5" // DriveType - 5: CDROM
+ };
- this.watcher = new ManagementEventWatcher(scope, query);
- this.watcher.EventArrived += this.WatcherEventArrived;
- this.watcher.Start();
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
+ this.watcher = new ManagementEventWatcher(scope, query);
+ this.watcher.EventArrived += this.WatcherEventArrived;
+ this.watcher.Start();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e.Message);
+ }
+ });
}
/// <summary>
@@ -66,7 +71,10 @@ namespace HandBrakeWPF.Services /// </summary>
public void Close()
{
- this.watcher.Stop();
+ if (watcher != null)
+ {
+ this.watcher.Stop();
+ }
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index aea8461bc..c1df4b8be 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1114,6 +1114,21 @@ namespace HandBrakeWPF.ViewModels MessageBoxImage.Information);
}
+ /// <summary>
+ /// The debug scan log.
+ /// </summary>
+ public void DebugScanLog()
+ {
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog();
+
+ dialog.ShowDialog();
+
+ if (File.Exists(dialog.FileName))
+ {
+ this.scanService.DebugScanLog(dialog.FileName);
+ }
+ }
+
#endregion
#region Main Window Public Methods
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index 5950bc448..d5e949809 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -262,6 +262,7 @@ namespace HandBrakeWPF.ViewModels {
this.Task = task;
this.NotifyOfPropertyChange(() => this.Task.SubtitleTracks);
+ this.NotifyOfPropertyChange(() => this.Task);
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml index bea0cb814..e30a0fcd2 100644 --- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml +++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml @@ -18,13 +18,15 @@ <Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
+ <Setter Property="Margin" Value="0,2,0,2" />
</Style>
<Style x:Key="LongToolTip" TargetType="TextBlock">
<Setter Property="Width" Value="400" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
- </UserControl.Resources>
+
+ </UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -274,13 +276,10 @@ <ColumnDefinition Width="*" MinWidth="100" />
</Grid.ColumnDefinitions>
- <Label Grid.Row="0"
- Grid.Column="0"
- Content="Adaptive B-Frames:"
+ <Label Content="Adaptive B-Frames:"
Style="{StaticResource AdvancedLabel}"
Visibility="{Binding BFramesOptionsVisible,
- Converter={StaticResource VisibilityConverter}}"
- />
+ Converter={StaticResource VisibilityConverter}}" Height="26" VerticalAlignment="Top" />
<ComboBox Grid.Row="0"
Grid.Column="1"
Width="120"
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 5f6fe7f14..5515fbbe8 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -128,6 +128,7 @@ <MenuItem Header="Debug" Foreground="Transparent" >
<MenuItem Header="Show CLI Equiv" Micro:Message.Attach="[Event Click] = [Action ShowCliQuery]" />
+ <MenuItem Header="Debug Scan Log" Micro:Message.Attach="[Event Click] = [Action DebugScanLog]" />
</MenuItem>
</Menu>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml index 9aba2a3fe..b6f3cc9eb 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml @@ -13,6 +13,7 @@ SnapsToDevicePixels="True"
UseLayoutRounding="True"
WindowStartupLocation="CenterScreen"
+ TextOptions.TextFormattingMode="Display"
>
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
diff --git a/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml b/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml index 1bdb2e727..9c3f001c8 100644 --- a/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml +++ b/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml @@ -15,6 +15,23 @@ </Setter>
</Style>
+ <Style TargetType="{x:Type ComboBox}">
+ <Setter Property="Height" Value="22"/>
+ <Setter Property="Margin" Value="0,2,0,2" />
+ </Style>
+
+ <Style TargetType="{x:Type TextBlock}">
+ <Setter Property="VerticalAlignment" Value="Center"/>
+ </Style>
+
+ <Style TargetType="{x:Type Button}">
+ <Setter Property="Height" Value="22"/>
+ </Style>
+
+ <Style TargetType="{x:Type RadioButton}">
+ <Setter Property="Margin" Value="0,0,0,8" />
+ </Style>
+
<SolidColorBrush x:Key="GlyphBrush" Color="#444"/>
</ResourceDictionary>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 8b6d8cff3..27f2a2f30 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -50,7 +50,7 @@ </StackPanel>
<StackPanel Orientation="Horizontal">
- <TextBlock Text="Framerate (FPS):" Width="100"/>
+ <TextBlock Text="Framerate (FPS):" VerticalAlignment="Top" Margin="0,5,0,0" Width="100"/>
<StackPanel Orientation="Vertical">
<ComboBox Width="120" ItemsSource="{Binding Framerates}" SelectedItem="{Binding SelectedFramerate}" />
<RadioButton Content="Constant Framerate" IsChecked="{Binding IsConstantFramerate}" Margin="0,10,0,0" />
|