this.audioTracks.Add(track);\r
}\r
\r
+ // 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.\r
if (tracks.Count == 0 || tracks[0].ScannedTrack.TrackNumber == 0)\r
{\r
this.AutomaticTrackSelection();\r
}\r
\r
// Setup the Audio track source dropdown with the new audio tracks.\r
- // this.ScannedTracks.Clear();\r
this.drp_audioTrack.SelectedItem = null;\r
- this.ScannedTracks = new BindingList<Audio>(selectedTitle.AudioTracks.ToList());\r
- drp_audioTrack.DataSource = this.ScannedTracks;\r
+ foreach (Audio track in selectedTitle.AudioTracks)\r
+ {\r
+ this.ScannedTracks.Add(track);\r
+ }\r
\r
drp_audioTrack.SelectedItem = this.ScannedTracks.FirstOrDefault();\r
- this.drp_audioTrack.Refresh();\r
-\r
+ \r
// Add any tracks the preset has, if there is a preset and no audio tracks in the list currently\r
if (audioList.Rows.Count == 0 && preset != null)\r
{\r
AudioTrack track = audioList.SelectedRows[0].DataBoundItem as AudioTrack;\r
if (track == null)\r
{\r
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false;\r
return;\r
}\r
\r
// Configure the widgets with values\r
if (drp_audioEncoder.Text.Contains("Passthru"))\r
{\r
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false;\r
track.Gain = 0;\r
track.DRC = 0;\r
}\r
- else\r
- {\r
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;\r
- }\r
+\r
+ this.RefreshEnabledControls();\r
\r
if (drp_audioEncoder.Text.Contains("Flac"))\r
{\r
/// Kill the scan\r
/// </summary>\r
void Stop();\r
+\r
+ /// <summary>\r
+ /// Take a Scan Log file, and process it as if it were from the CLI.\r
+ /// </summary>\r
+ /// <param name="path">\r
+ /// The path to the log file.\r
+ /// </param>\r
+ void DebugScanLog(string path);\r
}\r
}
\ No newline at end of file
instance.StopScan();\r
}\r
\r
+ /// <summary>\r
+ /// Debug a Scan Log (Only Available for CLI Mode, not LIBHB)\r
+ /// </summary>\r
+ /// <param name="path">\r
+ /// The path.\r
+ /// </param>\r
+ /// <exception cref="NotImplementedException">\r
+ /// (Only Available for CLI Mode, not LIBHB)\r
+ /// </exception>\r
+ public void DebugScanLog(string path)\r
+ {\r
+ throw new NotImplementedException("Only Available when using the CLI mode. Not LibHB");\r
+ }\r
+\r
#endregion\r
\r
#region Private Methods\r
using System.Windows.Forms;\r
\r
using HandBrake.ApplicationServices.EventArgs;\r
+ using HandBrake.ApplicationServices.Exceptions;\r
using HandBrake.ApplicationServices.Parsing;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Utilities;\r
// We don't really need to notify the user of any errors here.\r
}\r
}\r
+\r
+ /// <summary>\r
+ /// Take a Scan Log file, and process it as if it were from the CLI.\r
+ /// </summary>\r
+ /// <param name="path">\r
+ /// The path to the log file.\r
+ /// </param>\r
+ public void DebugScanLog(string path)\r
+ {\r
+ try\r
+ {\r
+ StreamReader parseLog = new StreamReader(path);\r
+ this.readData = new Parser(parseLog.BaseStream);\r
+ this.SouceData = Source.Parse(this.readData);\r
+ this.SouceData.ScanPath = path;\r
+\r
+ if (this.ScanCompleted != null)\r
+ {\r
+ this.ScanCompleted(this, new ScanCompletedEventArgs(true, null, string.Empty));\r
+ }\r
+ }\r
+ catch (Exception e)\r
+ {\r
+ throw new GeneralApplicationException("Debug Run Failed", string.Empty, e);\r
+ }\r
+ }\r
#endregion\r
\r
#region Private Methods\r
this.ScanCompleted(this, new ScanCompletedEventArgs(false, exc, "An Error has occured in ScanService.ScanSource()"));\r
}\r
}\r
-\r
+ \r
/// <summary>\r
/// Fire an event when the scan process progresses\r
/// </summary>\r