]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Wed, 15 Jun 2011 17:45:06 +0000 (17:45 +0000)
committersr55 <sr55.hb@outlook.com>
Wed, 15 Jun 2011 17:45:06 +0000 (17:45 +0000)
- Correctly set the number of previews to generate during Scan
- Fix an issue where the CLI query is not printed to the log window.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4061 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Controls/Filters.resx
win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
win/CS/frmMain.cs

index ff31a6db56e23b5a334f34387830ba5b4bd33eb8..c7e0d4bdf13aadeae1f2c8b103a0232dd12e22d8 100644 (file)
     <value>2.0</value>\r
   </resheader>\r
   <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
   <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
 </root>
\ No newline at end of file
index ca955817563e349d2867715ba770b98ab9808445..978d4c9afe11ba4479f360319e8f4fbabb6d5e39 100644 (file)
@@ -46,7 +46,7 @@ namespace HandBrake.ApplicationServices.Services.Base
         /// <summary>\r
         /// The Log File Header\r
         /// </summary>\r
-        private StringBuilder header = GeneralUtilities.CreateCliLogHeader(null);\r
+        private StringBuilder header = GeneralUtilities.CreateCliLogHeader();\r
 \r
         #endregion\r
 \r
@@ -244,8 +244,11 @@ namespace HandBrake.ApplicationServices.Services.Base
             try\r
             {\r
                 this.logBuffer = new StringBuilder();\r
+                this.logBuffer.AppendLine(String.Format("CLI Query: {0}", encodeQueueTask.Query));\r
+                this.logBuffer.AppendLine(String.Format("User Query: {0}", encodeQueueTask.CustomQuery));\r
+                this.logBuffer.AppendLine();\r
 \r
-                // Clear the current Encode Logs\r
+                // Clear the current Encode Logs)\r
                 if (File.Exists(logFile))\r
                 {\r
                     File.Delete(logFile);\r
@@ -257,7 +260,10 @@ namespace HandBrake.ApplicationServices.Services.Base
                 }\r
 \r
                 this.fileWriter = new StreamWriter(logFile) { AutoFlush = true };\r
-                this.fileWriter.WriteLine(GeneralUtilities.CreateCliLogHeader(encodeQueueTask));\r
+                this.fileWriter.WriteLine(GeneralUtilities.CreateCliLogHeader());\r
+                this.fileWriter.WriteLine(String.Format("CLI Query: {0}", encodeQueueTask.Query));\r
+                this.fileWriter.WriteLine(String.Format("User Query: {0}", encodeQueueTask.CustomQuery));\r
+                this.fileWriter.WriteLine();\r
             }\r
             catch (Exception)\r
             {\r
index 6cbce5273058ca59d22ffcbf5e46bb6c602c8bf9..fbbebfe27d4be816c22600ef88dc7e7b7e6fa271 100644 (file)
@@ -71,9 +71,16 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
         /// Scan a Source Path.\r
         /// Title 0: scan all\r
         /// </summary>\r
-        /// <param name="sourcePath">Path to the file to scan</param>\r
-        /// <param name="title">int title number. 0 for scan all</param>\r
-        void Scan(string sourcePath, int title);\r
+        /// <param name="sourcePath">\r
+        /// Path to the file to scan\r
+        /// </param>\r
+        /// <param name="title">\r
+        /// int title number. 0 for scan all\r
+        /// </param>\r
+        /// <param name="previewCount">\r
+        /// The preview Count.\r
+        /// </param>\r
+        void Scan(string sourcePath, int title, int previewCount);\r
 \r
         /// <summary>\r
         /// Kill the scan\r
index 1d93162a1546c97b8e76d47ff302ccdef7f8b061..5022763eb6eac56d602d13c35e3ce3aff0a3ef92 100644 (file)
@@ -118,11 +118,18 @@ namespace HandBrake.ApplicationServices.Services
         /// Scan a Source Path.\r
         /// Title 0: scan all\r
         /// </summary>\r
-        /// <param name="sourcePath">Path to the file to scan</param>\r
-        /// <param name="title">int title number. 0 for scan all</param>\r
-        public void Scan(string sourcePath, int title)\r
+        /// <param name="sourcePath">\r
+        /// Path to the file to scan\r
+        /// </param>\r
+        /// <param name="title">\r
+        /// int title number. 0 for scan all\r
+        /// </param>\r
+        /// <param name="previewCount">\r
+        /// The preview Count.\r
+        /// </param>\r
+        public void Scan(string sourcePath, int title, int previewCount)\r
         {\r
-            Thread t = new Thread(unused => this.ScanSource(sourcePath, title));\r
+            Thread t = new Thread(unused => this.ScanSource(sourcePath, title, previewCount));\r
             t.Start();\r
         }\r
 \r
@@ -141,12 +148,21 @@ namespace HandBrake.ApplicationServices.Services
         /// <summary>\r
         /// Start a scan for a given source path and title\r
         /// </summary>\r
-        /// <param name="sourcePath">Path to the source file</param>\r
-        /// <param name="title">the title number to look at</param>\r
-        private void ScanSource(object sourcePath, int title)\r
+        /// <param name="sourcePath">\r
+        /// Path to the source file\r
+        /// </param>\r
+        /// <param name="title">\r
+        /// the title number to look at\r
+        /// </param>\r
+        /// <param name="previewCount">\r
+        /// The preview Count.\r
+        /// </param>\r
+        private void ScanSource(object sourcePath, int title, int previewCount)\r
         {\r
             try\r
             {\r
+                // TODO Support Preview Count\r
+\r
                 IsScanning = true;\r
                 if (this.ScanStared != null)\r
                     this.ScanStared(this, new EventArgs());\r
index b4b2c7484f0e6246606933902ce8738e7e67a863..84d2a53d56cbe67e660c66d0169c2676922b6c98 100644 (file)
@@ -42,7 +42,7 @@ namespace HandBrake.ApplicationServices.Services
         /// <summary>\r
         /// The Log File Header\r
         /// </summary>\r
-        StringBuilder header = GeneralUtilities.CreateCliLogHeader(null);\r
+        StringBuilder header = GeneralUtilities.CreateCliLogHeader();\r
 \r
         #endregion\r
 \r
@@ -104,11 +104,18 @@ namespace HandBrake.ApplicationServices.Services
         /// Scan a Source Path.\r
         /// Title 0: scan all\r
         /// </summary>\r
-        /// <param name="sourcePath">Path to the file to scan</param>\r
-        /// <param name="title">int title number. 0 for scan all</param>\r
-        public void Scan(string sourcePath, int title)\r
+        /// <param name="sourcePath">\r
+        /// Path to the file to scan\r
+        /// </param>\r
+        /// <param name="title">\r
+        /// int title number. 0 for scan all\r
+        /// </param>\r
+        /// <param name="previewCount">\r
+        /// The preview Count.\r
+        /// </param>\r
+        public void Scan(string sourcePath, int title, int previewCount)\r
         {\r
-            Thread t = new Thread(unused => this.ScanSource(sourcePath, title));\r
+            Thread t = new Thread(unused => this.ScanSource(sourcePath, title, previewCount));\r
             t.Start();\r
         }\r
 \r
@@ -142,9 +149,16 @@ namespace HandBrake.ApplicationServices.Services
         /// <summary>\r
         /// Start a scan for a given source path and title\r
         /// </summary>\r
-        /// <param name="sourcePath">Path to the source file</param>\r
-        /// <param name="title">the title number to look at</param>\r
-        private void ScanSource(object sourcePath, int title)\r
+        /// <param name="sourcePath">\r
+        /// Path to the source file\r
+        /// </param>\r
+        /// <param name="title">\r
+        /// the title number to look at\r
+        /// </param>\r
+        /// <param name="previewCount">\r
+        /// The preview Count.\r
+        /// </param>\r
+        private void ScanSource(object sourcePath, int title, int previewCount)\r
         {\r
             try\r
             {\r
@@ -170,9 +184,16 @@ namespace HandBrake.ApplicationServices.Services
                 }\r
 \r
                 string extraArguments = string.Empty;\r
+\r
+                if (previewCount != 10)\r
+                {\r
+                    extraArguments += " --previews " + previewCount;\r
+                }\r
+\r
+\r
                 if (Properties.Settings.Default.DisableLibDvdNav)\r
                 {\r
-                    extraArguments = " --no-dvdnav";\r
+                    extraArguments += " --no-dvdnav";\r
                 }\r
 \r
                 if (title > 0)\r
@@ -210,7 +231,7 @@ namespace HandBrake.ApplicationServices.Services
                     // Only write the log file to disk if it's less than 100MB.\r
                     if (this.readData.Buffer.Length < 100000000)\r
                     {\r
-                        scanLog.WriteLine(GeneralUtilities.CreateCliLogHeader(null));\r
+                        scanLog.WriteLine(GeneralUtilities.CreateCliLogHeader());\r
                         scanLog.Write(this.readData.Buffer);\r
                         this.logBuffer.AppendLine(this.readData.Buffer.ToString());\r
                     }\r
index 61aeef1d780cf0b7778418dffcfcaf066ce5254f..0ad9b6a8dab334d1f0658805fb4be8259ba4e67c 100644 (file)
@@ -99,13 +99,10 @@ namespace HandBrake.ApplicationServices.Utilities
         /// <summary>\r
         /// Add the CLI Query to the Log File.\r
         /// </summary>\r
-        /// <param name="encJob">\r
-        /// The Encode Job Object\r
-        /// </param>\r
         /// <returns>\r
         /// The create cli log header.\r
         /// </returns>\r
-        public static StringBuilder CreateCliLogHeader(QueueTask encJob)\r
+        public static StringBuilder CreateCliLogHeader()\r
         {\r
             StringBuilder logHeader = new StringBuilder();\r
 \r
@@ -118,12 +115,6 @@ namespace HandBrake.ApplicationServices.Utilities
             logHeader.AppendLine(String.Format("Install Dir: {0}", Application.StartupPath));\r
             logHeader.AppendLine(String.Format("Data Dir: {0}\n", Application.UserAppDataPath));\r
 \r
-            if (encJob != null)\r
-            {\r
-                logHeader.AppendLine(String.Format("CLI Query: {0}", encJob.Query));\r
-                logHeader.AppendLine(String.Format("User Query: {0}", encJob.CustomQuery));\r
-            }\r
-\r
             logHeader.AppendLine("-------------------------------------------");\r
 \r
             return logHeader;\r
index fb22a8d27d856bb52582dbbc1c917ec143d0a11c..24cc41b5743619f85b753a4b77015bb5e38c5ac0 100644 (file)
@@ -2040,7 +2040,7 @@ namespace Handbrake
             // Start the Scan\r
             try\r
             {\r
-                SourceScan.Scan(sourcePath, title);\r
+                SourceScan.Scan(sourcePath, title, Properties.Settings.Default.previewScanCount);\r
             }\r
             catch (Exception exc)\r
             {\r