summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <sr55.hb@outlook.com>2011-12-20 20:42:07 +0000
committersr55 <sr55.hb@outlook.com>2011-12-20 20:42:07 +0000
commit4d0e5554c2e8d0a9fced4c1e3e1662aa677ff748 (patch)
tree140caef970e82488612ad31507588f7c65167dcb
parent7ebaeeb31c1eba5f86a79d9ae9946822e50232a9 (diff)
WinGui: Some Audio Panel refactoring and an additional method to the scan service to allow scan logs to be more easily debugged.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4377 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/Controls/AudioPanel.cs19
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs29
4 files changed, 58 insertions, 12 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 0f46ed1c1..61b908299 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -174,6 +174,7 @@ namespace Handbrake.Controls
this.audioTracks.Add(track);
}
+ // It's a Preset, if the TrackNumber is 0, so allow the Automatic Track Selection to run after we've setup the presets audio settings.
if (tracks.Count == 0 || tracks[0].ScannedTrack.TrackNumber == 0)
{
this.AutomaticTrackSelection();
@@ -203,14 +204,14 @@ namespace Handbrake.Controls
}
// Setup the Audio track source dropdown with the new audio tracks.
- // this.ScannedTracks.Clear();
this.drp_audioTrack.SelectedItem = null;
- this.ScannedTracks = new BindingList<Audio>(selectedTitle.AudioTracks.ToList());
- drp_audioTrack.DataSource = this.ScannedTracks;
+ foreach (Audio track in selectedTitle.AudioTracks)
+ {
+ this.ScannedTracks.Add(track);
+ }
drp_audioTrack.SelectedItem = this.ScannedTracks.FirstOrDefault();
- this.drp_audioTrack.Refresh();
-
+
// Add any tracks the preset has, if there is a preset and no audio tracks in the list currently
if (audioList.Rows.Count == 0 && preset != null)
{
@@ -255,7 +256,6 @@ namespace Handbrake.Controls
AudioTrack track = audioList.SelectedRows[0].DataBoundItem as AudioTrack;
if (track == null)
{
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false;
return;
}
@@ -283,14 +283,11 @@ namespace Handbrake.Controls
// Configure the widgets with values
if (drp_audioEncoder.Text.Contains("Passthru"))
{
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false;
track.Gain = 0;
track.DRC = 0;
}
- else
- {
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;
- }
+
+ this.RefreshEnabledControls();
if (drp_audioEncoder.Text.Contains("Flac"))
{
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
index fbbebfe27..b992dc8eb 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
@@ -86,5 +86,13 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
/// Kill the scan
/// </summary>
void Stop();
+
+ /// <summary>
+ /// Take a Scan Log file, and process it as if it were from the CLI.
+ /// </summary>
+ /// <param name="path">
+ /// The path to the log file.
+ /// </param>
+ void DebugScanLog(string path);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
index 033f16018..2a5726ef0 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
@@ -151,6 +151,20 @@ namespace HandBrake.ApplicationServices.Services
instance.StopScan();
}
+ /// <summary>
+ /// Debug a Scan Log (Only Available for CLI Mode, not LIBHB)
+ /// </summary>
+ /// <param name="path">
+ /// The path.
+ /// </param>
+ /// <exception cref="NotImplementedException">
+ /// (Only Available for CLI Mode, not LIBHB)
+ /// </exception>
+ public void DebugScanLog(string path)
+ {
+ throw new NotImplementedException("Only Available when using the CLI mode. Not LibHB");
+ }
+
#endregion
#region Private Methods
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
index 781aa40ec..b3470d63e 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
@@ -13,6 +13,7 @@ namespace HandBrake.ApplicationServices.Services
using System.Windows.Forms;
using HandBrake.ApplicationServices.EventArgs;
+ using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
@@ -147,6 +148,32 @@ namespace HandBrake.ApplicationServices.Services
// We don't really need to notify the user of any errors here.
}
}
+
+ /// <summary>
+ /// Take a Scan Log file, and process it as if it were from the CLI.
+ /// </summary>
+ /// <param name="path">
+ /// The path to the log file.
+ /// </param>
+ public void DebugScanLog(string path)
+ {
+ try
+ {
+ StreamReader parseLog = new StreamReader(path);
+ this.readData = new Parser(parseLog.BaseStream);
+ this.SouceData = Source.Parse(this.readData);
+ this.SouceData.ScanPath = path;
+
+ if (this.ScanCompleted != null)
+ {
+ this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty));
+ }
+ }
+ catch (Exception e)
+ {
+ throw new GeneralApplicationException("Debug Run Failed", string.Empty, e);
+ }
+ }
#endregion
#region Private Methods
@@ -268,7 +295,7 @@ namespace HandBrake.ApplicationServices.Services
this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()"));
}
}
-
+
/// <summary>
/// Fire an event when the scan process progresses
/// </summary>