using System.IO;\r
using System.Linq;\r
using System.Windows.Forms;\r
- using Functions;\r
\r
- using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Model.Encoding;\r
-\r
- using Model;\r
+ using HandBrake.ApplicationServices.Utilities;\r
\r
/// <summary>\r
/// The Subtitles Tab\r
{\r
InitializeComponent();\r
\r
- langMap = Main.MapLanguages();\r
+ langMap = LanguageUtilities.MapLanguages();\r
foreach (string key in langMap.Keys)\r
srt_lang.Items.Add(key);\r
\r
using System.Windows.Forms;\r
using System.Xml.Serialization;\r
\r
-\r
+ using HandBrake.ApplicationServices.Extensions;\r
using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Parsing;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
/// </summary>\r
private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List<QueueTask>));\r
\r
- /// <summary>\r
- /// Calculate the duration of the selected title and chapters\r
- /// </summary>\r
- /// <param name="chapterStart">\r
- /// The chapter Start.\r
- /// </param>\r
- /// <param name="chapterEnd">\r
- /// The chapter End.\r
- /// </param>\r
- /// <param name="selectedTitle">\r
- /// The selected Title.\r
- /// </param>\r
- /// <returns>\r
- /// The calculated duration.\r
- /// </returns>\r
- public static TimeSpan CalculateDuration(int chapterStart, int chapterEnd, Title selectedTitle)\r
- {\r
- TimeSpan duration = TimeSpan.FromSeconds(0.0);\r
- chapterStart++;\r
- chapterEnd++;\r
- if (chapterStart != 0 && chapterEnd != 0 && chapterEnd <= selectedTitle.Chapters.Count)\r
- {\r
- for (int i = chapterStart; i <= chapterEnd; i++)\r
- duration += selectedTitle.Chapters[i - 1].Duration;\r
- }\r
-\r
- return duration;\r
- }\r
-\r
/// <summary>\r
/// Set's up the DataGridView on the Chapters tab (frmMain)\r
/// </summary>\r
sourceName = sourceName.Replace("_", " ");\r
\r
if (Properties.Settings.Default.AutoNameTitleCase)\r
- sourceName = TitleCase(sourceName);\r
+ sourceName = sourceName.ToTitleCase();\r
\r
// Get the Selected Title Number\r
string[] titlesplit = mainWindow.drp_dvdtitle.Text.Split(' ');\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
- public static IDictionary<string, string> MapLanguages()\r
- {\r
- IDictionary<string, string> languageMap = new Dictionary<string, string>\r
- {\r
- {"Any", "und"}, \r
- {"Afar", "aar"}, \r
- {"Abkhazian", "abk"}, \r
- {"Afrikaans", "afr"}, \r
- {"Akan", "aka"}, \r
- {"Albanian", "sqi"}, \r
- {"Amharic", "amh"}, \r
- {"Arabic", "ara"}, \r
- {"Aragonese", "arg"}, \r
- {"Armenian", "hye"}, \r
- {"Assamese", "asm"}, \r
- {"Avaric", "ava"}, \r
- {"Avestan", "ave"}, \r
- {"Aymara", "aym"}, \r
- {"Azerbaijani", "aze"}, \r
- {"Bashkir", "bak"}, \r
- {"Bambara", "bam"}, \r
- {"Basque", "eus"}, \r
- {"Belarusian", "bel"}, \r
- {"Bengali", "ben"}, \r
- {"Bihari", "bih"}, \r
- {"Bislama", "bis"}, \r
- {"Bosnian", "bos"}, \r
- {"Breton", "bre"}, \r
- {"Bulgarian", "bul"}, \r
- {"Burmese", "mya"}, \r
- {"Catalan", "cat"}, \r
- {"Chamorro", "cha"}, \r
- {"Chechen", "che"}, \r
- {"Chinese", "zho"}, \r
- {"Church Slavic", "chu"}, \r
- {"Chuvash", "chv"}, \r
- {"Cornish", "cor"}, \r
- {"Corsican", "cos"}, \r
- {"Cree", "cre"}, \r
- {"Czech", "ces"}, \r
- {"Dansk", "dan"}, \r
- {"Divehi", "div"}, \r
- {"Nederlands", "nld"}, \r
- {"Dzongkha", "dzo"}, \r
- {"English", "eng"}, \r
- {"Esperanto", "epo"}, \r
- {"Estonian", "est"}, \r
- {"Ewe", "ewe"}, \r
- {"Faroese", "fao"}, \r
- {"Fijian", "fij"}, \r
- {"Suomi", "fin"}, \r
- {"Francais", "fra"}, \r
- {"Western Frisian", "fry"}, \r
- {"Fulah", "ful"}, \r
- {"Georgian", "kat"}, \r
- {"Deutsch", "deu"}, \r
- {"Gaelic (Scots)", "gla"}, \r
- {"Irish", "gle"}, \r
- {"Galician", "glg"}, \r
- {"Manx", "glv"}, \r
- {"Greek Modern", "ell"}, \r
- {"Guarani", "grn"}, \r
- {"Gujarati", "guj"}, \r
- {"Haitian", "hat"}, \r
- {"Hausa", "hau"}, \r
- {"Hebrew", "heb"}, \r
- {"Herero", "her"}, \r
- {"Hindi", "hin"}, \r
- {"Hiri Motu", "hmo"}, \r
- {"Magyar", "hun"}, \r
- {"Igbo", "ibo"}, \r
- {"Islenska", "isl"}, \r
- {"Ido", "ido"}, \r
- {"Sichuan Yi", "iii"}, \r
- {"Inuktitut", "iku"}, \r
- {"Interlingue", "ile"}, \r
- {"Interlingua", "ina"}, \r
- {"Indonesian", "ind"}, \r
- {"Inupiaq", "ipk"}, \r
- {"Italiano", "ita"}, \r
- {"Javanese", "jav"}, \r
- {"Japanese", "jpn"}, \r
- {"Kalaallisut", "kal"}, \r
- {"Kannada", "kan"}, \r
- {"Kashmiri", "kas"}, \r
- {"Kanuri", "kau"}, \r
- {"Kazakh", "kaz"}, \r
- {"Central Khmer", "khm"}, \r
- {"Kikuyu", "kik"}, \r
- {"Kinyarwanda", "kin"}, \r
- {"Kirghiz", "kir"}, \r
- {"Komi", "kom"}, \r
- {"Kongo", "kon"}, \r
- {"Korean", "kor"}, \r
- {"Kuanyama", "kua"}, \r
- {"Kurdish", "kur"}, \r
- {"Lao", "lao"}, \r
- {"Latin", "lat"}, \r
- {"Latvian", "lav"}, \r
- {"Limburgan", "lim"}, \r
- {"Lingala", "lin"}, \r
- {"Lithuanian", "lit"}, \r
- {"Luxembourgish", "ltz"}, \r
- {"Luba-Katanga", "lub"}, \r
- {"Ganda", "lug"}, \r
- {"Macedonian", "mkd"}, \r
- {"Marshallese", "mah"}, \r
- {"Malayalam", "mal"}, \r
- {"Maori", "mri"}, \r
- {"Marathi", "mar"}, \r
- {"Malay", "msa"}, \r
- {"Malagasy", "mlg"}, \r
- {"Maltese", "mlt"}, \r
- {"Moldavian", "mol"}, \r
- {"Mongolian", "mon"}, \r
- {"Nauru", "nau"}, \r
- {"Navajo", "nav"}, \r
- {"Ndebele, South", "nbl"}, \r
- {"Ndebele, North", "nde"}, \r
- {"Ndonga", "ndo"}, \r
- {"Nepali", "nep"}, \r
- {"Norwegian Nynorsk", "nno"}, \r
- {"Norwegian Bokmål", "nob"}, \r
- {"Norsk", "nor"}, \r
- {"Chichewa; Nyanja", "nya"}, \r
- {"Occitan", "oci"}, \r
- {"Ojibwa", "oji"}, \r
- {"Oriya", "ori"}, \r
- {"Oromo", "orm"}, \r
- {"Ossetian", "oss"}, \r
- {"Panjabi", "pan"}, \r
- {"Persian", "fas"}, \r
- {"Pali", "pli"}, \r
- {"Polish", "pol"}, \r
- {"Portugues", "por"}, \r
- {"Pushto", "pus"}, \r
- {"Quechua", "que"}, \r
- {"Romansh", "roh"}, \r
- {"Romanian", "ron"}, \r
- {"Rundi", "run"}, \r
- {"Russian", "rus"}, \r
- {"Sango", "sag"}, \r
- {"Sanskrit", "san"}, \r
- {"Serbian", "srp"}, \r
- {"Hrvatski", "hrv"}, \r
- {"Sinhala", "sin"}, \r
- {"Slovak", "slk"}, \r
- {"Slovenian", "slv"}, \r
- {"Northern Sami", "sme"}, \r
- {"Samoan", "smo"}, \r
- {"Shona", "sna"}, \r
- {"Sindhi", "snd"}, \r
- {"Somali", "som"}, \r
- {"Sotho Southern", "sot"}, \r
- {"Espanol", "spa"}, \r
- {"Sardinian", "srd"}, \r
- {"Swati", "ssw"}, \r
- {"Sundanese", "sun"}, \r
- {"Swahili", "swa"}, \r
- {"Svenska", "swe"}, \r
- {"Tahitian", "tah"}, \r
- {"Tamil", "tam"}, \r
- {"Tatar", "tat"}, \r
- {"Telugu", "tel"}, \r
- {"Tajik", "tgk"}, \r
- {"Tagalog", "tgl"}, \r
- {"Thai", "tha"}, \r
- {"Tibetan", "bod"}, \r
- {"Tigrinya", "tir"}, \r
- {"Tonga", "ton"}, \r
- {"Tswana", "tsn"}, \r
- {"Tsonga", "tso"}, \r
- {"Turkmen", "tuk"}, \r
- {"Turkish", "tur"}, \r
- {"Twi", "twi"}, \r
- {"Uighur", "uig"}, \r
- {"Ukrainian", "ukr"}, \r
- {"Urdu", "urd"}, \r
- {"Uzbek", "uzb"}, \r
- {"Venda", "ven"}, \r
- {"Vietnamese", "vie"}, \r
- {"Volapük", "vol"}, \r
- {"Welsh", "cym"}, \r
- {"Walloon", "wln"}, \r
- {"Wolof", "wol"}, \r
- {"Xhosa", "xho"}, \r
- {"Yiddish", "yid"}, \r
- {"Yoruba", "yor"}, \r
- {"Zhuang", "zha"}, \r
- {"Zulu", "zul"}\r
- };\r
- return languageMap;\r
- }\r
-\r
- /// <summary>\r
- /// Change a string to Title Case/\r
- /// </summary>\r
- /// <param name="input">\r
- /// The input.\r
- /// </param>\r
- /// <returns>\r
- /// A string in title case.\r
- /// </returns>\r
- public static string TitleCase(string input)\r
- {\r
- string[] tokens = input.Split(' ');\r
- StringBuilder sb = new StringBuilder(input.Length);\r
- foreach (string s in tokens)\r
- {\r
- if (!string.IsNullOrEmpty(s))\r
- {\r
- sb.Append(s[0].ToString().ToUpper());\r
- sb.Append(s.Substring(1).ToLower());\r
- sb.Append(" ");\r
- }\r
- }\r
-\r
- return sb.ToString().Trim();\r
- }\r
-\r
/// <summary>\r
/// Show the Exception Window\r
/// </summary>\r
--- /dev/null
+/* StringExtensions.cs $\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.ApplicationServices.Extensions\r
+{\r
+ using System.Text;\r
+\r
+ public static class StringExtensions\r
+ {\r
+ /// <summary>\r
+ /// Change the input string to title case\r
+ /// </summary>\r
+ /// <param name="input">the input string</param>\r
+ /// <returns>the input string in title case</returns>\r
+ public static string ToTitleCase(this string input)\r
+ {\r
+ string[] tokens = input.Split(' ');\r
+ StringBuilder sb = new StringBuilder(input.Length);\r
+ foreach (string s in tokens)\r
+ {\r
+ if (!string.IsNullOrEmpty(s))\r
+ {\r
+ sb.Append(s[0].ToString().ToUpper());\r
+ sb.Append(s.Substring(1).ToLower());\r
+ sb.Append(" ");\r
+ }\r
+ }\r
+\r
+ return sb.ToString().Trim();\r
+ }\r
+ }\r
+}\r
<Compile Include="EventArgs\QueueProgressEventArgs.cs" />\r
<Compile Include="EventArgs\ScanCompletedEventArgs.cs" />\r
<Compile Include="EventArgs\ScanProgressEventArgs.cs" />\r
+ <Compile Include="Extensions\StringExtensions.cs" />\r
<Compile Include="Functions\Converters.cs" />\r
<Compile Include="Functions\EnumHelper.cs" />\r
<Compile Include="Functions\GrowlCommunicator.cs" />\r
<DesignTime>True</DesignTime>\r
<DependentUpon>Resources.resx</DependentUpon>\r
</Compile>\r
+ <Compile Include="Properties\Settings.Designer.cs">\r
+ <AutoGen>True</AutoGen>\r
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>\r
+ <DependentUpon>Settings.settings</DependentUpon>\r
+ </Compile>\r
<Compile Include="Services\Encode.cs" />\r
<Compile Include="Services\Interfaces\IEncode.cs" />\r
<Compile Include="Services\Interfaces\IQueueManager.cs" />\r
<Compile Include="Services\ScanService.cs" />\r
<Compile Include="Services\UpdateService.cs" />\r
<Compile Include="Utilities\AppcastReader.cs" />\r
+ <Compile Include="Utilities\GeneralUtilities.cs" />\r
+ <Compile Include="Utilities\LanguageUtilities.cs" />\r
<Compile Include="Utilities\PlistUtility.cs" />\r
<Compile Include="Utilities\QueryGeneratorUtility.cs" />\r
<Compile Include="Utilities\QueryParserUtility.cs" />\r
- <Compile Include="Utilities\UtilityService.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="app.config" />\r
</EmbeddedResource>\r
</ItemGroup>\r
<ItemGroup>\r
+ <None Include="Properties\Settings.settings">\r
+ <Generator>SettingsSingleFileGenerator</Generator>\r
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>\r
+ </None>\r
<None Include="Resources\logo64.png" />\r
</ItemGroup>\r
<ItemGroup />\r
return titles.ToArray();\r
}\r
\r
+ /// <summary>\r
+ /// Calcuate the Duration\r
+ /// </summary>\r
+ /// <param name="startPoint">The Start Point (Chapters)</param>\r
+ /// <param name="endPoint">The End Point (Chapters)</param>\r
+ /// <returns>A Timespan</returns>\r
+ public TimeSpan CalculateDuration(int startPoint, int endPoint)\r
+ {\r
+ TimeSpan duration = TimeSpan.FromSeconds(0.0);\r
+ startPoint++;\r
+ endPoint++;\r
+ if (startPoint != 0 && endPoint != 0 && endPoint <= this.Chapters.Count)\r
+ {\r
+ for (int i = startPoint; i <= endPoint; i++)\r
+ duration += this.Chapters[i - 1].Duration;\r
+ }\r
+\r
+ return duration;\r
+ }\r
+\r
/// <summary>\r
/// Override of the ToString method to provide an easy way to use this object in the UI\r
/// </summary>\r
--- /dev/null
+//------------------------------------------------------------------------------\r
+// <auto-generated>\r
+// This code was generated by a tool.\r
+// Runtime Version:4.0.30319.1\r
+//\r
+// Changes to this file may cause incorrect behavior and will be lost if\r
+// the code is regenerated.\r
+// </auto-generated>\r
+//------------------------------------------------------------------------------\r
+\r
+namespace HandBrake.ApplicationServices.Properties {\r
+ \r
+ \r
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]\r
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\r
+ \r
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\r
+ \r
+ public static Settings Default {\r
+ get {\r
+ return defaultInstance;\r
+ }\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version='1.0' encoding='utf-8'?>\r
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">\r
+ <Profiles>\r
+ <Profile Name="(Default)" />\r
+ </Profiles>\r
+</SettingsFile>\r
/// <summary>\r
/// The Log File Header\r
/// </summary>\r
- StringBuilder header = UtilityService.CreateCliLogHeader(null);\r
+ StringBuilder header = GeneralUtilities.CreateCliLogHeader(null);\r
\r
#endregion\r
\r
if (File.Exists(logFile2)) File.Delete(logFile2);\r
\r
fileWriter = new StreamWriter(logFile) { AutoFlush = true };\r
- fileWriter.WriteLine(UtilityService.CreateCliLogHeader(encodeQueueTask));\r
+ fileWriter.WriteLine(GeneralUtilities.CreateCliLogHeader(encodeQueueTask));\r
}\r
catch (Exception)\r
{\r
/// <summary>\r
/// The Log File Header\r
/// </summary>\r
- StringBuilder header = UtilityService.CreateCliLogHeader(null);\r
+ StringBuilder header = GeneralUtilities.CreateCliLogHeader(null);\r
\r
#endregion\r
\r
// Only write the log file to disk if it's less than 100MB.\r
if (this.readData.Buffer.Length < 100000000)\r
{\r
- scanLog.WriteLine(UtilityService.CreateCliLogHeader(null));\r
+ scanLog.WriteLine(GeneralUtilities.CreateCliLogHeader(null));\r
scanLog.Write(this.readData.Buffer);\r
logBuffer.AppendLine(this.readData.Buffer.ToString());\r
}\r
/// <summary>\r
/// A Set of Static Utilites\r
/// </summary>\r
- public class UtilityService\r
+ public class GeneralUtilities\r
{\r
/// <summary>\r
/// The Default Log Directory\r
{\r
return string.Format("[{0}] {1}", DateTime.Now.TimeOfDay, message);\r
}\r
+\r
}\r
}\r
--- /dev/null
+/* LanguageUtilities.cs $\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr/>.\r
+ It may be used under the terms of the GNU General Public License. */\r
+\r
+using System.Collections.Generic;\r
+\r
+namespace HandBrake.ApplicationServices.Utilities\r
+{\r
+ public class LanguageUtilities\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
+ public static IDictionary<string, string> MapLanguages()\r
+ {\r
+ IDictionary<string, string> languageMap = new Dictionary<string, string>\r
+ {\r
+ {"Any", "und"}, \r
+ {"Afar", "aar"}, \r
+ {"Abkhazian", "abk"}, \r
+ {"Afrikaans", "afr"}, \r
+ {"Akan", "aka"}, \r
+ {"Albanian", "sqi"}, \r
+ {"Amharic", "amh"}, \r
+ {"Arabic", "ara"}, \r
+ {"Aragonese", "arg"}, \r
+ {"Armenian", "hye"}, \r
+ {"Assamese", "asm"}, \r
+ {"Avaric", "ava"}, \r
+ {"Avestan", "ave"}, \r
+ {"Aymara", "aym"}, \r
+ {"Azerbaijani", "aze"}, \r
+ {"Bashkir", "bak"}, \r
+ {"Bambara", "bam"}, \r
+ {"Basque", "eus"}, \r
+ {"Belarusian", "bel"}, \r
+ {"Bengali", "ben"}, \r
+ {"Bihari", "bih"}, \r
+ {"Bislama", "bis"}, \r
+ {"Bosnian", "bos"}, \r
+ {"Breton", "bre"}, \r
+ {"Bulgarian", "bul"}, \r
+ {"Burmese", "mya"}, \r
+ {"Catalan", "cat"}, \r
+ {"Chamorro", "cha"}, \r
+ {"Chechen", "che"}, \r
+ {"Chinese", "zho"}, \r
+ {"Church Slavic", "chu"}, \r
+ {"Chuvash", "chv"}, \r
+ {"Cornish", "cor"}, \r
+ {"Corsican", "cos"}, \r
+ {"Cree", "cre"}, \r
+ {"Czech", "ces"}, \r
+ {"Dansk", "dan"}, \r
+ {"Divehi", "div"}, \r
+ {"Nederlands", "nld"}, \r
+ {"Dzongkha", "dzo"}, \r
+ {"English", "eng"}, \r
+ {"Esperanto", "epo"}, \r
+ {"Estonian", "est"}, \r
+ {"Ewe", "ewe"}, \r
+ {"Faroese", "fao"}, \r
+ {"Fijian", "fij"}, \r
+ {"Suomi", "fin"}, \r
+ {"Francais", "fra"}, \r
+ {"Western Frisian", "fry"}, \r
+ {"Fulah", "ful"}, \r
+ {"Georgian", "kat"}, \r
+ {"Deutsch", "deu"}, \r
+ {"Gaelic (Scots)", "gla"}, \r
+ {"Irish", "gle"}, \r
+ {"Galician", "glg"}, \r
+ {"Manx", "glv"}, \r
+ {"Greek Modern", "ell"}, \r
+ {"Guarani", "grn"}, \r
+ {"Gujarati", "guj"}, \r
+ {"Haitian", "hat"}, \r
+ {"Hausa", "hau"}, \r
+ {"Hebrew", "heb"}, \r
+ {"Herero", "her"}, \r
+ {"Hindi", "hin"}, \r
+ {"Hiri Motu", "hmo"}, \r
+ {"Magyar", "hun"}, \r
+ {"Igbo", "ibo"}, \r
+ {"Islenska", "isl"}, \r
+ {"Ido", "ido"}, \r
+ {"Sichuan Yi", "iii"}, \r
+ {"Inuktitut", "iku"}, \r
+ {"Interlingue", "ile"}, \r
+ {"Interlingua", "ina"}, \r
+ {"Indonesian", "ind"}, \r
+ {"Inupiaq", "ipk"}, \r
+ {"Italiano", "ita"}, \r
+ {"Javanese", "jav"}, \r
+ {"Japanese", "jpn"}, \r
+ {"Kalaallisut", "kal"}, \r
+ {"Kannada", "kan"}, \r
+ {"Kashmiri", "kas"}, \r
+ {"Kanuri", "kau"}, \r
+ {"Kazakh", "kaz"}, \r
+ {"Central Khmer", "khm"}, \r
+ {"Kikuyu", "kik"}, \r
+ {"Kinyarwanda", "kin"}, \r
+ {"Kirghiz", "kir"}, \r
+ {"Komi", "kom"}, \r
+ {"Kongo", "kon"}, \r
+ {"Korean", "kor"}, \r
+ {"Kuanyama", "kua"}, \r
+ {"Kurdish", "kur"}, \r
+ {"Lao", "lao"}, \r
+ {"Latin", "lat"}, \r
+ {"Latvian", "lav"}, \r
+ {"Limburgan", "lim"}, \r
+ {"Lingala", "lin"}, \r
+ {"Lithuanian", "lit"}, \r
+ {"Luxembourgish", "ltz"}, \r
+ {"Luba-Katanga", "lub"}, \r
+ {"Ganda", "lug"}, \r
+ {"Macedonian", "mkd"}, \r
+ {"Marshallese", "mah"}, \r
+ {"Malayalam", "mal"}, \r
+ {"Maori", "mri"}, \r
+ {"Marathi", "mar"}, \r
+ {"Malay", "msa"}, \r
+ {"Malagasy", "mlg"}, \r
+ {"Maltese", "mlt"}, \r
+ {"Moldavian", "mol"}, \r
+ {"Mongolian", "mon"}, \r
+ {"Nauru", "nau"}, \r
+ {"Navajo", "nav"}, \r
+ {"Ndebele, South", "nbl"}, \r
+ {"Ndebele, North", "nde"}, \r
+ {"Ndonga", "ndo"}, \r
+ {"Nepali", "nep"}, \r
+ {"Norwegian Nynorsk", "nno"}, \r
+ {"Norwegian Bokmål", "nob"}, \r
+ {"Norsk", "nor"}, \r
+ {"Chichewa; Nyanja", "nya"}, \r
+ {"Occitan", "oci"}, \r
+ {"Ojibwa", "oji"}, \r
+ {"Oriya", "ori"}, \r
+ {"Oromo", "orm"}, \r
+ {"Ossetian", "oss"}, \r
+ {"Panjabi", "pan"}, \r
+ {"Persian", "fas"}, \r
+ {"Pali", "pli"}, \r
+ {"Polish", "pol"}, \r
+ {"Portugues", "por"}, \r
+ {"Pushto", "pus"}, \r
+ {"Quechua", "que"}, \r
+ {"Romansh", "roh"}, \r
+ {"Romanian", "ron"}, \r
+ {"Rundi", "run"}, \r
+ {"Russian", "rus"}, \r
+ {"Sango", "sag"}, \r
+ {"Sanskrit", "san"}, \r
+ {"Serbian", "srp"}, \r
+ {"Hrvatski", "hrv"}, \r
+ {"Sinhala", "sin"}, \r
+ {"Slovak", "slk"}, \r
+ {"Slovenian", "slv"}, \r
+ {"Northern Sami", "sme"}, \r
+ {"Samoan", "smo"}, \r
+ {"Shona", "sna"}, \r
+ {"Sindhi", "snd"}, \r
+ {"Somali", "som"}, \r
+ {"Sotho Southern", "sot"}, \r
+ {"Espanol", "spa"}, \r
+ {"Sardinian", "srd"}, \r
+ {"Swati", "ssw"}, \r
+ {"Sundanese", "sun"}, \r
+ {"Swahili", "swa"}, \r
+ {"Svenska", "swe"}, \r
+ {"Tahitian", "tah"}, \r
+ {"Tamil", "tam"}, \r
+ {"Tatar", "tat"}, \r
+ {"Telugu", "tel"}, \r
+ {"Tajik", "tgk"}, \r
+ {"Tagalog", "tgl"}, \r
+ {"Thai", "tha"}, \r
+ {"Tibetan", "bod"}, \r
+ {"Tigrinya", "tir"}, \r
+ {"Tonga", "ton"}, \r
+ {"Tswana", "tsn"}, \r
+ {"Tsonga", "tso"}, \r
+ {"Turkmen", "tuk"}, \r
+ {"Turkish", "tur"}, \r
+ {"Twi", "twi"}, \r
+ {"Uighur", "uig"}, \r
+ {"Ukrainian", "ukr"}, \r
+ {"Urdu", "urd"}, \r
+ {"Uzbek", "uzb"}, \r
+ {"Venda", "ven"}, \r
+ {"Vietnamese", "vie"}, \r
+ {"Volapük", "vol"}, \r
+ {"Welsh", "cym"}, \r
+ {"Walloon", "wln"}, \r
+ {"Wolof", "wol"}, \r
+ {"Xhosa", "xho"}, \r
+ {"Yiddish", "yid"}, \r
+ {"Yoruba", "yor"}, \r
+ {"Zhuang", "zha"}, \r
+ {"Zulu", "zul"}\r
+ };\r
+ return languageMap;\r
+ }\r
+ }\r
+}\r
// We have a drive, selected as a folder.\r
if (this.sourcePath.EndsWith("\\"))\r
{\r
- drives = UtilityService.GetDrives();\r
+ drives = GeneralUtilities.GetDrives();\r
foreach (DriveInformation item in drives)\r
{\r
if (item.RootDirectory.Contains(this.sourcePath))\r
// Clear the log files in the background\r
if (Settings.Default.clearOldLogs)\r
{\r
- Thread clearLog = new Thread(() => UtilityService.ClearLogFiles(30));\r
+ Thread clearLog = new Thread(() => GeneralUtilities.ClearLogFiles(30));\r
clearLog.Start();\r
}\r
\r
}\r
\r
// Update the Duration\r
- lbl_duration.Text =\r
- Main.CalculateDuration(drop_chapterStart.SelectedIndex, drop_chapterFinish.SelectedIndex, selectedTitle)\r
- .ToString();\r
+ lbl_duration.Text = this.selectedTitle.CalculateDuration(drop_chapterStart.SelectedIndex, drop_chapterFinish.SelectedIndex).ToString();\r
\r
// Run the Autonaming function\r
if (Properties.Settings.Default.autoNaming)\r
return;\r
}\r
\r
- drives = UtilityService.GetDrives();\r
+ drives = GeneralUtilities.GetDrives();\r
\r
List<ToolStripMenuItem> menuItems = new List<ToolStripMenuItem>();\r
foreach (DriveInformation drive in drives)\r
InitializeComponent();\r
mainWindow = mw;\r
\r
- IDictionary<string, string> langList = Main.MapLanguages();\r
+ IDictionary<string, string> langList = LanguageUtilities.MapLanguages();\r
foreach (string item in langList.Keys)\r
drop_preferredLang.Items.Add(item);\r
\r
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);\r
if (result == DialogResult.Yes)\r
{\r
- UtilityService.ClearLogFiles(0);\r
+ GeneralUtilities.ClearLogFiles(0);\r
MessageBox.Show(this, "HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButtons.OK,\r
MessageBoxIcon.Information);\r
}\r