From f0ad6d2972a9bbe7fa975591da6474c7980e2857 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 16 Jan 2009 20:55:35 +0000 Subject: WinGui: - Perform source scanning in the main window rather than a separate window. File Menu > Cancel Scan added in case of a scan lockup. - Fixed issue where a preset was loaded twice needlessly. - Support for no audio added. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2089 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmMain/PresetLoader.cs | 18 +++++++++++------- win/C#/frmMain/QueryGenerator.cs | 8 ++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'win/C#/frmMain') diff --git a/win/C#/frmMain/PresetLoader.cs b/win/C#/frmMain/PresetLoader.cs index aa05cc876..ab4561c71 100644 --- a/win/C#/frmMain/PresetLoader.cs +++ b/win/C#/frmMain/PresetLoader.cs @@ -216,13 +216,17 @@ namespace Handbrake mainWindow.lv_audioList.Items.Clear(); // Create a new row for the Audio list based on the currently selected items in the dropdown. - ListViewItem newTrack = new ListViewItem("Automatic"); - newTrack.SubItems.Add(presetQuery.AudioEncoder1); - newTrack.SubItems.Add(presetQuery.AudioTrackMix1); - newTrack.SubItems.Add(presetQuery.AudioSamplerate1); - newTrack.SubItems.Add(presetQuery.AudioBitrate1); - newTrack.SubItems.Add(presetQuery.DRC1.ToString()); - mainWindow.lv_audioList.Items.Add(newTrack); + ListViewItem newTrack; + if (presetQuery.AudioTrack1 != "None") + { + newTrack = new ListViewItem("Automatic"); + newTrack.SubItems.Add(presetQuery.AudioEncoder1); + newTrack.SubItems.Add(presetQuery.AudioTrackMix1); + newTrack.SubItems.Add(presetQuery.AudioSamplerate1); + newTrack.SubItems.Add(presetQuery.AudioBitrate1); + newTrack.SubItems.Add(presetQuery.DRC1.ToString()); + mainWindow.lv_audioList.Items.Add(newTrack); + } if (presetQuery.AudioTrack2 != "None") { diff --git a/win/C#/frmMain/QueryGenerator.cs b/win/C#/frmMain/QueryGenerator.cs index d7a4900fc..f9f84bbd5 100644 --- a/win/C#/frmMain/QueryGenerator.cs +++ b/win/C#/frmMain/QueryGenerator.cs @@ -273,11 +273,14 @@ namespace Handbrake List bitrates = new List(); List drcs = new List(); + // No Audio + if (audioTracks.Items.Count == 0) + query += " -a none "; + // Gather information about each audio track and store them in the declared lists. foreach (ListViewItem row in audioTracks.Items) { // Audio Track (-a) - String track = String.Empty; if (row.Text == "Automatic") tracks.Add("1"); else if (row.Text != "None") @@ -320,7 +323,8 @@ namespace Handbrake else audioItems += "," + item; } - query += " -a " + audioItems; + if (audioItems.Trim() != String.Empty) + query += " -a " + audioItems; firstLoop = true; audioItems = ""; // Reset for another pass. // Audio Codec (-E) -- cgit v1.2.3