diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 18 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 27 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | 37 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml | 46 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml | 11 |
7 files changed, 129 insertions, 21 deletions
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index adad1827a..2250b4fc5 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -71,6 +71,24 @@ <PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug32|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x86\Debug31\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug32|x64' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug31\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Caliburn.Micro">
<HintPath>..\libraries\caliburn\Caliburn.Micro.dll</HintPath>
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 384cfbc01..adb1478dd 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -690,6 +690,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Output: {0}.
+ /// </summary>
+ public static string PictureSettings_OutputResolution {
+ get {
+ return ResourceManager.GetString("PictureSettings_OutputResolution", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Preset Version.
/// </summary>
public static string Preset_OldVersion_Header {
@@ -747,6 +756,24 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Still Preview.
+ /// </summary>
+ public static string Preview {
+ get {
+ return ResourceManager.GetString("Preview", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Still Preview (Scaled).
+ /// </summary>
+ public static string Preview_Scaled {
+ get {
+ return ResourceManager.GetString("Preview_Scaled", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Question.
/// </summary>
public static string Question {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index ec7809d9e..2d7dbc438 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -507,4 +507,13 @@ Do you wish to proceed?</value> <data name="Main_InvalidDestination" xml:space="preserve">
<value>The entered destination contained illegal characters. You must fix the path and filename before continuing.</value>
</data>
+ <data name="Preview" xml:space="preserve">
+ <value>Still Preview</value>
+ </data>
+ <data name="Preview_Scaled" xml:space="preserve">
+ <value>Still Preview (Scaled)</value>
+ </data>
+ <data name="PictureSettings_OutputResolution" xml:space="preserve">
+ <value>Output: {0}</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index c051b0aad..b10c0f292 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -1049,7 +1049,7 @@ namespace HandBrakeWPF.ViewModels double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);
this.DisplaySize = this.sourceResolution.IsEmpty
- ? string.Empty
+ ? string.Format(Properties.Resources.PictureSettings_OutputResolution, "None")
: string.Format("Output: {0}x{1}, Anamorphic: {2}x{3}", result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);
}
else
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index fd683fc2a..279cc6fc8 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -10,6 +10,7 @@ namespace HandBrakeWPF.ViewModels
{
using System;
+ using System.Windows;
using System.Windows.Media.Imaging;
using HandBrake.ApplicationServices.Model;
@@ -22,6 +23,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public class StaticPreviewViewModel : ViewModelBase, IStaticPreviewViewModel
{
+ /*
+ * TODO
+ * - Screen needs to be made DPI Aware
+ * - Integrate Video Preview panel.
+ */
+
#region Fields
/// <summary>
@@ -63,6 +70,7 @@ namespace HandBrakeWPF.ViewModels {
this.scanService = scanService;
this.selectedPreviewImage = 1;
+ this.Title = Properties.Resources.Preview;
}
#endregion
@@ -172,11 +180,18 @@ namespace HandBrakeWPF.ViewModels #region Public Methods and Operators
+ /// <summary>
+ /// The update preview frame.
+ /// </summary>
+ /// <param name="task">
+ /// The task.
+ /// </param>
public void UpdatePreviewFrame(EncodeTask task)
{
this.Task = task;
this.UpdatePreviewFrame();
this.DisplayName = "Picture Preview";
+ this.Title = Properties.Resources.Preview;
}
/// <summary>
@@ -193,6 +208,28 @@ namespace HandBrakeWPF.ViewModels this.PreviewImage = image;
}
}
+
+ /// <summary>
+ /// The preview size changed.
+ /// </summary>
+ /// <param name="ea">
+ /// The ea.
+ /// </param>
+ public void PreviewSizeChanged(SizeChangedEventArgs ea)
+ {
+ Rect workArea = SystemParameters.WorkArea;
+ if (ea.NewSize.Width > workArea.Width)
+ {
+ this.Width = (int)Math.Round(workArea.Width, 0) - 20;
+ this.Title = Properties.Resources.Preview_Scaled;
+ }
+
+ if (ea.NewSize.Height > workArea.Height)
+ {
+ this.Height = (int)Math.Round(workArea.Height, 0) - 20;
+ this.Title = Properties.Resources.Preview_Scaled;
+ }
+ }
#endregion
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml index a39719959..1458d1dea 100644 --- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml @@ -29,8 +29,13 @@ <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
<!-- Size Panel-->
- <StackPanel Name="SizePanel" Orientation="Vertical" VerticalAlignment="Top" Grid.Column="0" >
+ <StackPanel Name="SizePanel" Orientation="Vertical" VerticalAlignment="Top" Grid.Column="0" Grid.Row="0" Grid.RowSpan="1" >
<Label Content="Size" FontWeight="Bold" />
<!-- Row 1-->
@@ -99,24 +104,10 @@ IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5" />
</Grid>
- <!-- Row 5-->
- <Grid Margin="5,15,5,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
-
- <Label Content="{Binding DisplaySize}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
- Visibility="{Binding ShowDisplaySize, Converter={StaticResource boolToVisConverter}}" />
- </Grid>
</StackPanel>
<!-- Crop Panel -->
- <StackPanel Name="CropPanel" Margin="50,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Column="1">
+ <StackPanel Name="CropPanel" Margin="15,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="0" Grid.RowSpan="2" Grid.Column="1">
<Label Content="Cropping" FontWeight="Bold" />
<RadioButton Content="Automatic" IsChecked="{Binding IsCustomCrop, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="10,0,0,0"/>
<RadioButton Content="Custom" IsChecked="{Binding IsCustomCrop}" Margin="10,5,0,0" />
@@ -158,6 +149,29 @@ </Grid>
</StackPanel>
+
+ <!-- Preview Panel -->
+ <StackPanel Name="PreviewPanel" Margin="0,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0">
+ <Label Content="Output" FontWeight="Bold" />
+
+ <Grid Margin="5,0,0,0">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Label Content="{Binding DisplaySize}" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="0,0,0,5"
+ Visibility="{Binding ShowDisplaySize, Converter={StaticResource boolToVisConverter}}" />
+
+ <Button Content="Preview" Grid.Row="1" Margin="5,0,0,0"
+ cal:Message.Attach="[Event Click] = [Action PreviewImage]" HorizontalAlignment="Left" />
+ </Grid>
+
+ </StackPanel>
</Grid>
</Border>
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml index 080d10ea8..ae044945c 100644 --- a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml +++ b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml @@ -2,12 +2,15 @@ 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:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
mc:Ignorable="d" SizeToContent="WidthAndHeight"
TextOptions.TextFormattingMode="Display"
- Title="Still Preview">
+ WindowStartupLocation="CenterScreen"
+ cal:Message.Attach="[Event SizeChanged] = [Action PreviewSizeChanged($eventArgs)]"
+ Title="{Binding Title}">
<Grid>
-
+
<Image Source="{Binding PreviewImage}" MaxWidth="{Binding Width}" MaxHeight="{Binding Height}" />
<Slider Maximum="{Binding TotalPreviews}" Minimum="0"
Value="{Binding SelectedPreviewImage}"
@@ -15,6 +18,6 @@ HorizontalAlignment="Center"
Margin="0,0,0,20" Width="150"
Background="Transparent"
- />
+ />
</Grid>
</Window>
|