using System.Threading;\r
using Handbrake.EncodeQueue;\r
using System.Net;\r
+using Handbrake.Model;\r
\r
namespace Handbrake.Functions\r
{\r
{\r
if (csv.Trim() != "")\r
{\r
+ csv = csv.Replace("\\,", "<!comma!>");\r
string[] contents = csv.Split(',');\r
int chapter;\r
int.TryParse(contents[0], out chapter);\r
- chapterMap.Add(chapter, contents[1]);\r
+ chapterMap.Add(chapter, contents[1].Replace("<!comma!>", ","));\r
}\r
csv = sr.ReadLine();\r
}\r
/// Function which generates the filename and path automatically based on \r
/// the Source Name, DVD title and DVD Chapters\r
/// </summary>\r
- public static string AutoName(frmMain mainWindow) //ComboBox drpDvdtitle, string chapter_start, string chatper_end, string source, string dest, int format, Boolean chapters)\r
+ public static string AutoName(frmMain mainWindow)\r
{\r
string AutoNamePath = string.Empty;\r
if (mainWindow.drp_dvdtitle.Text != "Automatic")\r
}\r
\r
/// <summary>\r
- /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern.\r
- /// </summary>\r
- private class UpdateCheckResult : IAsyncResult\r
- {\r
- public UpdateCheckResult(object asyncState, UpdateCheckInformation info)\r
- {\r
- AsyncState = asyncState;\r
- Result = info;\r
- }\r
-\r
- /// <summary>\r
- /// Gets whether the check was executed in debug mode.\r
- /// </summary>\r
- public object AsyncState { get; private set; }\r
-\r
- /// <summary>\r
- /// Gets the result of the update check.\r
- /// </summary>\r
- public UpdateCheckInformation Result { get; private set; }\r
-\r
- public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } }\r
- public bool CompletedSynchronously { get { throw new NotImplementedException(); } }\r
- public bool IsCompleted { get { throw new NotImplementedException(); } }\r
- }\r
-\r
- /// <summary>\r
/// Map languages and their iso639_2 value into a IDictionary\r
/// </summary>\r
/// <returns></returns>\r
return languageMap;\r
}\r
\r
+ /// <summary>\r
+ /// Get a list of available DVD drives which are ready and contain DVD content.\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ public static List<DriveInformation> GetDrives()\r
+ {\r
+ List<DriveInformation> drives = new List<DriveInformation>();\r
+ DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();\r
+ foreach (DriveInfo curDrive in theCollectionOfDrives)\r
+ {\r
+ if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady && File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))\r
+ {\r
+ drives.Add(new DriveInformation\r
+ {\r
+ VolumeLabel = curDrive.VolumeLabel,\r
+ RootDirectory = curDrive.RootDirectory + "VIDEO_TS"\r
+ });\r
+ }\r
+ }\r
+ return drives;\r
+ }\r
}\r
-}\r
+}
\ No newline at end of file