summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs26
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs6
-rw-r--r--win/CS/frmMain.cs35
3 files changed, 40 insertions, 27 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
index 19a98c3f5..1d2e4d3af 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
@@ -42,7 +42,7 @@ namespace HandBrake.ApplicationServices.Utilities
string qualityMode = string.Empty;
#region Get a List of Audio Track Objects
- XmlNode audioListDict = root.ChildNodes[2].ChildNodes[0].FirstChild.ChildNodes[1];
+ XmlNode audioListDict = root.ChildNodes[2].ChildNodes[0].FirstChild.ChildNodes[13];
ObservableCollection<AudioTrack> audioTracks = new ObservableCollection<AudioTrack>();
for (int i = 0; i < audioListDict.ChildNodes.Count; i++)
@@ -76,7 +76,7 @@ namespace HandBrake.ApplicationServices.Utilities
track.DRC = double.Parse(value);
break;
case "AudioTrackGainSlider":
- track.Gain = int.Parse(value);
+ track.Gain = int.Parse(value.Replace("0.0", "0"));
break;
}
}
@@ -90,7 +90,7 @@ namespace HandBrake.ApplicationServices.Utilities
XmlNode presetSettings = root.ChildNodes[2].ChildNodes[0].FirstChild;
// Start from 2 to avoid the audio settings which we don't need.
- for (int i = 2; i < presetSettings.ChildNodes.Count; i += 2)
+ for (int i = 0; i < presetSettings.ChildNodes.Count; i += 2)
{
string key = presetSettings.ChildNodes[i].InnerText;
string value = presetSettings.ChildNodes[i + 1].InnerText;
@@ -321,6 +321,26 @@ namespace HandBrake.ApplicationServices.Utilities
case "UsesPictureSettings":
parsed.UsesPictureSettings = value == "1";
break;
+
+ // Allowed Passthru
+ case "AudioAllowAACPass":
+ parsed.AllowedPassthruOptions.AudioAllowAACPass = value == "1";
+ break;
+ case "AudioAllowAC3Pass":
+ parsed.AllowedPassthruOptions.AudioAllowAC3Pass = value == "1";
+ break;
+ case "AudioAllowDTSHDPass":
+ parsed.AllowedPassthruOptions.AudioAllowDTSHDPass = value == "1";
+ break;
+ case "AudioAllowDTSPass":
+ parsed.AllowedPassthruOptions.AudioAllowDTSPass = value == "1";
+ break;
+ case "AudioAllowMP3Pass":
+ parsed.AllowedPassthruOptions.AudioAllowMP3Pass = value == "1";
+ break;
+ case "AudioEncoderFallback":
+ parsed.AllowedPassthruOptions.AudioEncoderFallback = EnumHelper<AudioEncoder>.GetValue(value);
+ break;
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index 2f3d2b557..67717ecab 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -269,7 +269,11 @@ namespace HandBrake.ApplicationServices.Utilities
query += string.Format(" --pixel-aspect {0}:{1}", task.PixelAspectX, task.PixelAspectY);
break;
}
- query += " --modulus " + task.Modulus;
+
+ if (task.Modulus.HasValue)
+ {
+ query += " --modulus " + task.Modulus;
+ }
return query;
}
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs
index cc2445367..4e7862d99 100644
--- a/win/CS/frmMain.cs
+++ b/win/CS/frmMain.cs
@@ -828,20 +828,10 @@ namespace Handbrake
/// </summary>
private void ImportPreset()
{
- if (this.selectedTitle == null)
- {
- MessageBox.Show(
- "Please scan a source before trying to import a preset.",
- "Error",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error);
- return;
- }
-
if (openPreset.ShowDialog() == DialogResult.OK)
{
EncodeTask parsed = PlistPresetHandler.Import(openPreset.FileName);
- PresetLoader.LoadPreset(this, parsed);
+
if (presetHandler.CheckIfPresetExists(parsed.PresetName))
{
if (!presetHandler.CanUpdatePreset(parsed.PresetName))
@@ -861,27 +851,26 @@ namespace Handbrake
if (result == DialogResult.Yes)
{
Preset preset = new Preset
- {
- Name = parsed.PresetName,
- Query = QueryGenerator.GenerateFullQuery(this).Query,
- CropSettings = parsed.UsesPictureSettings,
- Task = parsed,
- AudioPassthruSettings = new AllowedPassthru(false), // TODO at a future point, support this.
- };
+ {
+ Name = parsed.PresetName,
+ Query = QueryGeneratorUtility.GenerateQuery(parsed),
+ CropSettings = parsed.UsesPictureSettings,
+ Description = string.Empty,
+ AudioPassthruSettings = parsed.AllowedPassthruOptions
+ };
presetHandler.Update(preset);
}
}
else
{
-
- Preset preset = new Preset
+ Preset preset = new Preset
{
Name = parsed.PresetName,
- Query = QueryGenerator.GenerateFullQuery(this).Query,
+ Query = QueryGeneratorUtility.GenerateQuery(parsed),
CropSettings = parsed.UsesPictureSettings,
- Task = parsed,
- AudioPassthruSettings = new AllowedPassthru(false), // TODO at a future point, support this.
+ Description = string.Empty,
+ AudioPassthruSettings = parsed.AllowedPassthruOptions
};
if (presetHandler.Add(preset))