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