diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 51 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/defaultsettings.xml | 10 |
3 files changed, 53 insertions, 9 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 731e7d384..268002957 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -816,7 +816,6 @@ namespace HandBrakeWPF.ViewModels // Create the Queue Task and Start Processing
QueueTask task = new QueueTask(null)
{
- Destination = this.CurrentTask.Destination,
Task = this.CurrentTask,
Query = QueryGeneratorUtility.GenerateQuery(this.CurrentTask),
CustomQuery = false
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 7f7520dc4..295eb3b3b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
+ using System.Globalization;
using Caliburn.Micro;
@@ -310,8 +311,8 @@ namespace HandBrakeWPF.ViewModels this.ShowPeakFramerate = true;
if (this.Task.FramerateMode == FramerateMode.VFR)
{
- this.Task.FramerateMode = FramerateMode.PFR;
- }
+ this.Task.FramerateMode = FramerateMode.PFR;
+ }
this.Task.Framerate = double.Parse(value);
}
@@ -416,9 +417,15 @@ namespace HandBrakeWPF.ViewModels {
return;
}
-
+
this.SelectedVideoEncoder = preset.Task.VideoEncoder;
- this.SelectedFramerate = preset.Task.Framerate.ToString();
+ if (preset.Task.Framerate.HasValue)
+ {
+ this.SelectedFramerate = preset.Task.Framerate.Value.ToString(CultureInfo.InvariantCulture);
+ }
+
+ this.IsConstantQuantity = preset.Task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality;
+
switch (preset.Task.FramerateMode)
{
case FramerateMode.CFR:
@@ -433,9 +440,39 @@ namespace HandBrakeWPF.ViewModels this.ShowPeakFramerate = true;
break;
}
-
- // TODO Compute RF
- this.RF = 20;
+
+ double cqStep = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step);
+ double rfValue = 0;
+ switch (this.SelectedVideoEncoder)
+ {
+ case VideoEncoder.FFMpeg:
+ case VideoEncoder.FFMpeg2:
+ int cq;
+ if (preset.Task.Quality.HasValue)
+ {
+ int.TryParse(preset.Task.Quality.Value.ToString(CultureInfo.InvariantCulture), out cq);
+ this.RF = 32 - cq;
+ }
+ break;
+ case VideoEncoder.X264:
+
+ double multiplier = 1.0 / cqStep;
+ if (preset.Task.Quality.HasValue)
+ {
+ rfValue = preset.Task.Quality.Value * multiplier;
+ }
+
+ this.RF = this.QualityMax - (int)Math.Round(rfValue, 0);
+
+ break;
+
+ case VideoEncoder.Theora:
+ if (preset.Task.Quality.HasValue)
+ {
+ this.RF = (int)preset.Task.Quality.Value;
+ }
+ break;
+ }
this.Task.TwoPass = preset.Task.TwoPass;
this.Task.TurboFirstPass = preset.Task.TurboFirstPass;
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index ce18ff680..6bd00ae0d 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -181,7 +181,7 @@ <string>appcast_x64</string>
</key>
<value>
- <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast_unstable.x86_64.xml</anyType>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast.86_64.xml</anyType>
</value>
</item>
<item>
@@ -432,4 +432,12 @@ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">MinGW i686</anyType>
</value>
</item>
+ <item>
+ <key>
+ <string>ClearCompletedFromQueue</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
+ </value>
+ </item>
</dictionary>
\ No newline at end of file |