OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / Main.cs
index d2d7ff5..f78d38a 100644 (file)
@@ -240,7 +240,7 @@ namespace Handbrake.Functions
                 // Add the appropriate file extension\r
                 if (mainWindow.drop_format.SelectedIndex == 0)\r
                 {\r
-                    destinationFilename += Properties.Settings.Default.useM4v || mainWindow.Check_ChapterMarkers.Checked ||\r
+                    destinationFilename += Properties.Settings.Default.useM4v == 0 || Properties.Settings.Default.useM4v == 2 || mainWindow.Check_ChapterMarkers.Checked ||\r
                                            mainWindow.AudioSettings.RequiresM4V() || mainWindow.Subtitles.RequiresM4V()\r
                                                ? ".m4v"\r
                                                : ".mp4";\r
@@ -295,7 +295,7 @@ namespace Handbrake.Functions
 \r
             // Get the SHA1 Hash of HandBrakeCLI\r
             byte[] hash;\r
-            using (Stream stream = File.OpenRead("HandBrakeCLI.exe"))\r
+            using (Stream stream = File.OpenRead(Path.Combine(Application.StartupPath, "HandBrakeCLI.exe")))\r
             {\r
                 hash = SHA1.Create().ComputeHash(stream);\r
             }\r
@@ -472,46 +472,6 @@ namespace Handbrake.Functions
         }\r
 \r
         /// <summary>\r
-        ///  Clear all the encode log files.\r
-        /// </summary>\r
-        public static void ClearLogs()\r
-        {\r
-            string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
-            if (Directory.Exists(logDir))\r
-            {\r
-                DirectoryInfo info = new DirectoryInfo(logDir);\r
-                FileInfo[] logFiles = info.GetFiles("*.txt");\r
-                foreach (FileInfo file in logFiles)\r
-                {\r
-                    if (!file.Name.Contains("last_scan_log") && !file.Name.Contains("last_encode_log"))\r
-                        File.Delete(file.FullName);\r
-                }\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Clear old log files x days in the past\r
-        /// </summary>\r
-        public static void ClearOldLogs()\r
-        {\r
-            string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
-            if (Directory.Exists(logDir))\r
-            {\r
-                DirectoryInfo info = new DirectoryInfo(logDir);\r
-                FileInfo[] logFiles = info.GetFiles("*.txt");\r
-\r
-                foreach (FileInfo file in logFiles)\r
-                {\r
-                    if (file.LastWriteTime < DateTime.Now.AddDays(-30))\r
-                    {\r
-                        if (!file.Name.Contains("last_scan_log.txt") && !file.Name.Contains("last_encode_log.txt"))\r
-                            File.Delete(file.FullName);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
         /// Map languages and their iso639_2 value into a IDictionary\r
         /// </summary>\r
         /// <returns>A Dictionary containing the language and iso code</returns>\r
@@ -710,32 +670,6 @@ namespace Handbrake.Functions
         }\r
 \r
         /// <summary>\r
-        /// Get a list of available DVD drives which are ready and contain DVD content.\r
-        /// </summary>\r
-        /// <returns>A List of Drives with their details</returns>\r
-        public static List<DriveInformation> GetDrives()\r
-        {\r
-            List<DriveInformation> drives = new List<DriveInformation>();\r
-            DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();\r
-            int id = 0;\r
-            foreach (DriveInfo curDrive in theCollectionOfDrives)\r
-            {\r
-                if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady &&\r
-                    File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))\r
-                {\r
-                    drives.Add(new DriveInformation\r
-                                   {\r
-                                       Id = id,\r
-                                       VolumeLabel = curDrive.VolumeLabel,\r
-                                       RootDirectory = curDrive.RootDirectory + "VIDEO_TS"\r
-                                   });\r
-                    id++;\r
-                }\r
-            }\r
-            return drives;\r
-        }\r
-\r
-        /// <summary>\r
         /// Change a string to Title Case/\r
         /// </summary>\r
         /// <param name="input">\r