summaryrefslogtreecommitdiffstats
path: root/win/C#/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-04-18 16:23:40 +0000
committersr55 <[email protected]>2010-04-18 16:23:40 +0000
commita82bdb07077d06ef764a25a66eb04ade46fa12ea (patch)
tree8b2ddc3f2c1d4b2c2790bd75ba7c73aaf331a6b9 /win/C#/Services
parentf0761065a31f0921c289085f3e41e583640cef65 (diff)
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
Diffstat (limited to 'win/C#/Services')
-rw-r--r--win/C#/Services/Queue.cs5
-rw-r--r--win/C#/Services/Scan.cs39
2 files changed, 26 insertions, 18 deletions
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
/// <param name="customJob">
/// Custom job
/// </param>
- 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
/// </summary>
private StringBuilder logBuffer;
- static object locker = new object();
+ /// <summary>
+ /// A Lock object
+ /// </summary>
+ private static object locker = new object();
/// <summary>
/// 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();