From 24203717648fcdeff506ac6aea100d746f7b487c Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 17 May 2014 21:27:20 +0000 Subject: [PATCH] WinGui: Give the preview window a presence on the picture settings tab. Added some initial code to manage the window size. (Note, this is not complete or DPI aware yet) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6197 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrake.ApplicationServices.csproj | 14 ++++++ .../HandBrakeInterop/HandBrakeInterop.csproj | 22 +++++++++ .../HandBrake.Server/HandBrake.Server.csproj | 15 ++++++ win/CS/HandBrake10.sln | 38 ++++++++++++++- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 18 ++++++++ .../Properties/Resources.Designer.cs | 27 +++++++++++ win/CS/HandBrakeWPF/Properties/Resources.resx | 9 ++++ .../ViewModels/PictureSettingsViewModel.cs | 2 +- .../ViewModels/StaticPreviewViewModel.cs | 37 +++++++++++++++ .../Views/PictureSettingsView.xaml | 46 ++++++++++++------- .../HandBrakeWPF/Views/StaticPreviewView.xaml | 11 +++-- 11 files changed, 216 insertions(+), 23 deletions(-) diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 6ba1e302d..39596c222 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -44,6 +44,20 @@ pdbonly true + + true + bin\x86\Debug31\ + DEBUG;TRACE + x86 + MinimumRecommendedRules.ruleset + + + true + bin\x64\Debug31\ + TRACE;DEBUG + x64 + MinimumRecommendedRules.ruleset + False diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj index d86da1833..720f64395 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj @@ -100,6 +100,28 @@ false false + + true + bin\x64\Debug31\ + TRACE;DEBUG;X64 + full + x64 + prompt + AllRules.ruleset + false + false + + + true + bin\x86\Debug31\ + DEBUG;TRACE + full + x86 + prompt + AllRules.ruleset + false + false + 3.0 diff --git a/win/CS/HandBrake.Server/HandBrake.Server.csproj b/win/CS/HandBrake.Server/HandBrake.Server.csproj index b27f798d6..7e202d4c2 100644 --- a/win/CS/HandBrake.Server/HandBrake.Server.csproj +++ b/win/CS/HandBrake.Server/HandBrake.Server.csproj @@ -41,6 +41,21 @@ x64 bin\Release\ + + true + bin\x86\Debug31\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + true + bin\x64\Debug31\ + x64 + MinimumRecommendedRules.ruleset + diff --git a/win/CS/HandBrake10.sln b/win/CS/HandBrake10.sln index 4878465ae..4af3e5007 100644 --- a/win/CS/HandBrake10.sln +++ b/win/CS/HandBrake10.sln @@ -1,6 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30110.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.ApplicationServices", "HandBrake.ApplicationServices\HandBrake.ApplicationServices.csproj", "{087A2BA8-BAC2-4577-A46F-07FF9D420016}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrakeWPF", "HandBrakeWPF\HandBrakeWPF.csproj", "{DADE66CB-0E12-4959-ADE5-0ACD31D27C59}" @@ -20,6 +22,10 @@ Global Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Debug32|Any CPU = Debug32|Any CPU + Debug32|Mixed Platforms = Debug32|Mixed Platforms + Debug32|x64 = Debug32|x64 + Debug32|x86 = Debug32|x86 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms Release|x64 = Release|x64 @@ -33,6 +39,13 @@ Global {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|x64.Build.0 = Debug|x64 {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|x86.ActiveCfg = Debug|x86 {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|x86.Build.0 = Debug|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|Any CPU.ActiveCfg = Debug32|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|Mixed Platforms.ActiveCfg = Debug32|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|Mixed Platforms.Build.0 = Debug32|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|x64.ActiveCfg = Debug32|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|x64.Build.0 = Debug32|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|x86.ActiveCfg = Debug32|x86 + {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug32|x86.Build.0 = Debug32|x86 {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.ActiveCfg = Release|x86 {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Mixed Platforms.ActiveCfg = Release|x86 {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Mixed Platforms.Build.0 = Release|x86 @@ -47,6 +60,13 @@ Global {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug|x64.Build.0 = Debug|x64 {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug|x86.ActiveCfg = Debug|x86 {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug|x86.Build.0 = Debug|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|Any CPU.ActiveCfg = Debug32|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|Mixed Platforms.ActiveCfg = Debug32|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|Mixed Platforms.Build.0 = Debug32|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|x64.ActiveCfg = Debug32|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|x64.Build.0 = Debug32|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|x86.ActiveCfg = Debug32|x86 + {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Debug32|x86.Build.0 = Debug32|x86 {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Release|Any CPU.ActiveCfg = Release|x86 {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Release|Mixed Platforms.ActiveCfg = Release|x86 {DADE66CB-0E12-4959-ADE5-0ACD31D27C59}.Release|Mixed Platforms.Build.0 = Release|x86 @@ -61,6 +81,13 @@ Global {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug|x64.Build.0 = Debug|x64 {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug|x86.ActiveCfg = Debug|x86 {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug|x86.Build.0 = Debug|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|Any CPU.ActiveCfg = Debug32|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|Mixed Platforms.ActiveCfg = Debug32|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|Mixed Platforms.Build.0 = Debug32|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|x64.ActiveCfg = Debug32|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|x64.Build.0 = Debug32|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|x86.ActiveCfg = Debug32|x86 + {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Debug32|x86.Build.0 = Debug32|x86 {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Release|Any CPU.ActiveCfg = Release|x86 {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Release|Mixed Platforms.ActiveCfg = Release|x86 {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}.Release|Mixed Platforms.Build.0 = Release|x86 @@ -75,6 +102,13 @@ Global {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug|x64.Build.0 = Debug|x64 {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug|x86.ActiveCfg = Debug|x86 {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug|x86.Build.0 = Debug|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|Any CPU.ActiveCfg = Debug32|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|Mixed Platforms.ActiveCfg = Debug32|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|Mixed Platforms.Build.0 = Debug32|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|x64.ActiveCfg = Debug32|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|x64.Build.0 = Debug32|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|x86.ActiveCfg = Debug32|x86 + {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Debug32|x86.Build.0 = Debug32|x86 {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Release|Any CPU.ActiveCfg = Release|x86 {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Release|Mixed Platforms.ActiveCfg = Release|x86 {36847BA0-6814-41E1-B1C3-1D9D874418E9}.Release|Mixed Platforms.Build.0 = Release|x86 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 @@ x64 prompt + + true + bin\x86\Debug31\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + true + bin\x64\Debug31\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + ..\libraries\caliburn\Caliburn.Micro.dll 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 @@ -689,6 +689,15 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Output: {0}. + /// + public static string PictureSettings_OutputResolution { + get { + return ResourceManager.GetString("PictureSettings_OutputResolution", resourceCulture); + } + } + /// /// Looks up a localized string similar to Preset Version. /// @@ -746,6 +755,24 @@ namespace HandBrakeWPF.Properties { } } + /// + /// Looks up a localized string similar to Still Preview. + /// + public static string Preview { + get { + return ResourceManager.GetString("Preview", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Still Preview (Scaled). + /// + public static string Preview_Scaled { + get { + return ResourceManager.GetString("Preview_Scaled", resourceCulture); + } + } + /// /// Looks up a localized string similar to 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? The entered destination contained illegal characters. You must fix the path and filename before continuing. + + Still Preview + + + Still Preview (Scaled) + + + Output: {0} + \ 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 /// public class StaticPreviewViewModel : ViewModelBase, IStaticPreviewViewModel { + /* + * TODO + * - Screen needs to be made DPI Aware + * - Integrate Video Preview panel. + */ + #region Fields /// @@ -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 + /// + /// The update preview frame. + /// + /// + /// The task. + /// public void UpdatePreviewFrame(EncodeTask task) { this.Task = task; this.UpdatePreviewFrame(); this.DisplayName = "Picture Preview"; + this.Title = Properties.Resources.Preview; } /// @@ -193,6 +208,28 @@ namespace HandBrakeWPF.ViewModels this.PreviewImage = image; } } + + /// + /// The preview size changed. + /// + /// + /// The ea. + /// + 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 @@ + + + + + - + - + + + + +