From a82bdb07077d06ef764a25a66eb04ade46fa12ea Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 18 Apr 2010 16:23:40 +0000 Subject: WinGui: - Queue Edit now only scans the title that was added rather than all titles. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3241 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Services/Queue.cs | 5 +++-- win/C#/Services/Scan.cs | 39 +++++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 18 deletions(-) (limited to 'win/C#/Services') diff --git a/win/C#/Services/Queue.cs b/win/C#/Services/Queue.cs index 59b1437d5..525fd7598 100644 --- a/win/C#/Services/Queue.cs +++ b/win/C#/Services/Queue.cs @@ -94,11 +94,12 @@ namespace Handbrake.Services /// /// Custom job /// - public void Add(string query, string source, string destination, bool customJob) + public void Add(string query, int title, string source, string destination, bool customJob) { Job newJob = new Job { - Id = this.nextJobId++, + Id = this.nextJobId++, + Title = title, Query = query, Source = source, Destination = destination, diff --git a/win/C#/Services/Scan.cs b/win/C#/Services/Scan.cs index aae87a0d1..abecfec2b 100644 --- a/win/C#/Services/Scan.cs +++ b/win/C#/Services/Scan.cs @@ -33,7 +33,10 @@ namespace Handbrake.Services /// private StringBuilder logBuffer; - static object locker = new object(); + /// + /// A Lock object + /// + private static object locker = new object(); /// /// The line number thats been read to in the log file @@ -140,30 +143,34 @@ namespace Handbrake.Services ResetLogReader(); string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe"); - string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; + string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + + "\\HandBrake\\logs"; string dvdInfoPath = Path.Combine(logDir, "last_scan_log.txt"); // Make we don't pick up a stale last_encode_log.txt (and that we have rights to the file) if (File.Exists(dvdInfoPath)) File.Delete(dvdInfoPath); - string dvdnav = string.Empty; + string extraArguments = string.Empty; if (Properties.Settings.Default.noDvdNav) - dvdnav = " --no-dvdnav"; + extraArguments = " --no-dvdnav"; + + if (title > 0) + extraArguments += " --scan "; this.hbProc = new Process - { - StartInfo = - { - FileName = handbrakeCLIPath, - Arguments = - String.Format(@" -i ""{0}"" -t{1} {2} -v ", sourcePath, title, dvdnav), - RedirectStandardOutput = true, - RedirectStandardError = true, - UseShellExecute = false, - CreateNoWindow = true - } - }; + { + StartInfo = + { + FileName = handbrakeCLIPath, + Arguments = + String.Format(@" -i ""{0}"" -t{1} {2} -v ", sourcePath, title, extraArguments), + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + } + }; // Start the Scan this.hbProc.Start(); -- cgit v1.2.3