summaryrefslogtreecommitdiffstats
path: root/win/C#
diff options
context:
space:
mode:
authorsr55 <[email protected]>2007-12-19 22:10:27 +0000
committersr55 <[email protected]>2007-12-19 22:10:27 +0000
commit5757d7c7295572f8dd8f078dcceddf8728e075f3 (patch)
tree10cd21ca48ae8f148fbe12aa5be3f17c1e47ef3a /win/C#
parent9edd509f7e84d131107f523219032f221a355e56 (diff)
WinGui:
- Some code clean up + removal of old unused code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1137 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r--win/C#/Functions/CLI.cs23
-rw-r--r--win/C#/Functions/RssReader.cs95
-rw-r--r--win/C#/Parsing/AudioTrack.cs1
-rw-r--r--win/C#/Parsing/Chapter.cs1
-rw-r--r--win/C#/Parsing/DVD.cs7
-rw-r--r--win/C#/Parsing/Parser.cs29
-rw-r--r--win/C#/Parsing/Subtitle.cs1
-rw-r--r--win/C#/Parsing/Title.cs1
-rw-r--r--win/C#/Properties/Settings.Designer.cs2
-rw-r--r--win/C#/Properties/Settings.settings2
-rw-r--r--win/C#/app.config2
-rw-r--r--win/C#/frmMain.cs5
12 files changed, 39 insertions, 130 deletions
diff --git a/win/C#/Functions/CLI.cs b/win/C#/Functions/CLI.cs
index 259a98c3a..b0b79d32f 100644
--- a/win/C#/Functions/CLI.cs
+++ b/win/C#/Functions/CLI.cs
@@ -60,28 +60,5 @@ namespace Handbrake.Functions
}
return hbProc;
}
-
- public void killCLI()
- {
- try
- {
- hbProc.Kill();
- }
- catch (Exception)
- {
- // No need to do anything. Chances are the process was already dead.
- }
- }
-
- public void closeCLI()
- {
- hbProc.Close();
- hbProc.Dispose();
- }
-
- public void setNull()
- {
- hbProc = new Process();
- }
}
}
diff --git a/win/C#/Functions/RssReader.cs b/win/C#/Functions/RssReader.cs
index 36d105d8d..ce8dd568b 100644
--- a/win/C#/Functions/RssReader.cs
+++ b/win/C#/Functions/RssReader.cs
@@ -55,11 +55,14 @@ namespace Handbrake.Functions
return latestTitle;
}
+ private string hb_versionInfo;
+ private string hb_version;
+ private string hb_build;
+ private string hb_file;
- public string versionInfo()
+ public void getInfo()
{
readRss();
- string vinfo = "";
for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
{
if (nodeChannel.ChildNodes[6].Name == "item")
@@ -68,79 +71,49 @@ namespace Handbrake.Functions
t = readRss();
if (nodeItem["title"].InnerText == t)
{
- vinfo = nodeItem["description"].InnerText;
- break;
- }
- }
- }
+ // Get the Version Information
+ hb_versionInfo = nodeItem["description"].InnerText;
- return vinfo;
- }
-
- public string version()
- {
- readRss();
- string vinfo = "";
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[6].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- string t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
+ // Get the version
string input = nodeItem.InnerXml;
Match ver = Regex.Match(input, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");
- vinfo = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");
+ hb_version = ver.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");
+
+ // Get the build number
+ input = nodeItem.InnerXml;
+ ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");
+ hb_build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");
+
+ // Get the update file
+ hb_file = nodeItem["windows"].InnerText;
- break;
}
}
}
- return vinfo;
+ }
+
+ public string versionInfo()
+ {
+ getInfo();
+ return hb_versionInfo;
+ }
+
+ public string version()
+ {
+ getInfo();
+ return hb_version;
}
public string build()
{
- readRss();
- string vinfo = "";
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[6].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- string t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
- string input = nodeItem.InnerXml;
- Match ver = Regex.Match(input, @"sparkle:version=""([0-9]*)\""");
- vinfo = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");
- break;
- }
- }
- }
- return vinfo;
+ getInfo();
+ return hb_build;
}
public string downloadFile()
{
- readRss();
- string file = "";
- for (int i = 0; i < nodeChannel.ChildNodes.Count; i++)
- {
- if (nodeChannel.ChildNodes[6].Name == "item")
- {
- nodeItem = nodeChannel.ChildNodes[0];
- t = readRss();
- if (nodeItem["title"].InnerText == t)
- {
- file = nodeItem["windows"].InnerText;
- break;
- }
- }
- }
-
- return file;
- }
+ getInfo();
+ return hb_file;
+ }
}
} \ No newline at end of file
diff --git a/win/C#/Parsing/AudioTrack.cs b/win/C#/Parsing/AudioTrack.cs
index 22861b9e6..95d9f307e 100644
--- a/win/C#/Parsing/AudioTrack.cs
+++ b/win/C#/Parsing/AudioTrack.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.IO;
using System.Text.RegularExpressions;
diff --git a/win/C#/Parsing/Chapter.cs b/win/C#/Parsing/Chapter.cs
index 6496354c9..caea54bb5 100644
--- a/win/C#/Parsing/Chapter.cs
+++ b/win/C#/Parsing/Chapter.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.IO;
using System.Text.RegularExpressions;
diff --git a/win/C#/Parsing/DVD.cs b/win/C#/Parsing/DVD.cs
index 62a40d81b..f0982a47c 100644
--- a/win/C#/Parsing/DVD.cs
+++ b/win/C#/Parsing/DVD.cs
@@ -1,14 +1,7 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.IO;
-using System.Threading;
-using System.Diagnostics;
namespace Handbrake.Parsing
{
diff --git a/win/C#/Parsing/Parser.cs b/win/C#/Parsing/Parser.cs
index b3edc89d9..799e8a303 100644
--- a/win/C#/Parsing/Parser.cs
+++ b/win/C#/Parsing/Parser.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
@@ -23,18 +22,6 @@ namespace Handbrake.Parsing
public delegate void ScanProgressEventHandler(object Sender, int CurrentTitle, int TitleCount);
/// <summary>
- /// A delegate to handle encode progress updates
- /// </summary>
- /// <param name="Sender">The object which raised the event</param>
- /// <param name="CurrentTask">The current task being processed from the queue</param>
- /// <param name="TaskCount">The total number of tasks in queue</param>
- /// <param name="PercentComplete">The percentage this task is complete</param>
- /// <param name="CurrentFps">The current encoding fps</param>
- /// <param name="AverageFps">The average encoding fps for this task</param>
- /// <param name="TimeRemaining">The estimated time remaining for this task to complete</param>
- public delegate void EncodeProgressEventHandler(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining);
-
- /// <summary>
/// A simple wrapper around a StreamReader to keep track of the entire output from a cli process
/// </summary>
internal class Parser : StreamReader
@@ -66,7 +53,6 @@ namespace Handbrake.Parsing
/// </summary>
public event ScanProgressEventHandler OnScanProgress;
- public event EncodeProgressEventHandler OnEncodeProgress;
/// <summary>
/// Default constructor for this object
@@ -93,21 +79,6 @@ namespace Handbrake.Parsing
{
OnScanProgress(this, int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
}
- m = Regex.Match(tmp, @"^Encoding: task ([0-9]*) of ([0-9]*), ([0-9]*\.[0-9]*) %( \(([0-9]*\.[0-9]*) fps, avg ([0-9]*\.[0-9]*) fps, ETA ([0-9]{2})h([0-9]{2})m([0-9]{2})s\))?");
- if (m.Success && OnEncodeProgress != null)
- {
- int currentTask = int.Parse(m.Groups[1].Value);
- int totalTasks = int.Parse(m.Groups[2].Value);
- float percent = float.Parse(m.Groups[3].Value, Functions.CLI.Culture);
- float currentFps = m.Groups[5].Value == string.Empty ? 0.0F : float.Parse(m.Groups[5].Value, Functions.CLI.Culture);
- float avgFps = m.Groups[6].Value == string.Empty ? 0.0F : float.Parse(m.Groups[6].Value, Functions.CLI.Culture);
- TimeSpan remaining = TimeSpan.Zero;
- if (m.Groups[7].Value != string.Empty)
- {
- remaining = TimeSpan.Parse(m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value);
- }
- OnEncodeProgress(this, currentTask, totalTasks, percent, currentFps, avgFps, remaining);
- }
}
catch (Exception exc)
{
diff --git a/win/C#/Parsing/Subtitle.cs b/win/C#/Parsing/Subtitle.cs
index 8fb889f8f..6d83d2613 100644
--- a/win/C#/Parsing/Subtitle.cs
+++ b/win/C#/Parsing/Subtitle.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.IO;
using System.Text.RegularExpressions;
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs
index 744e5b619..b1f02d9c6 100644
--- a/win/C#/Parsing/Title.cs
+++ b/win/C#/Parsing/Title.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs
index 9fea5a39b..7c112d8a6 100644
--- a/win/C#/Properties/Settings.Designer.cs
+++ b/win/C#/Properties/Settings.Designer.cs
@@ -158,7 +158,7 @@ namespace Handbrake.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("1101")]
+ [global::System.Configuration.DefaultSettingValueAttribute("1000")]
public int build {
get {
return ((int)(this["build"]));
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings
index 40cb829cb..2479d16ab 100644
--- a/win/C#/Properties/Settings.settings
+++ b/win/C#/Properties/Settings.settings
@@ -36,7 +36,7 @@
<Value Profile="(Default)" />
</Setting>
<Setting Name="build" Type="System.Int32" Scope="User">
- <Value Profile="(Default)">1101</Value>
+ <Value Profile="(Default)">1000</Value>
</Setting>
<Setting Name="skipversion" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
diff --git a/win/C#/app.config b/win/C#/app.config
index 1b1b5194b..e019fd4a1 100644
--- a/win/C#/app.config
+++ b/win/C#/app.config
@@ -41,7 +41,7 @@
<value />
</setting>
<setting name="build" serializeAs="String">
- <value>1101</value>
+ <value>1000</value>
</setting>
<setting name="skipversion" serializeAs="String">
<value>0</value>
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 407d00be7..863fb62e6 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -14,7 +14,6 @@ using System.Runtime.InteropServices;
using System.Globalization;
using System.Text.RegularExpressions;
-
namespace Handbrake
{
public partial class frmMain : Form
@@ -1207,8 +1206,6 @@ namespace Handbrake
public string GenerateTheQuery()
{
-
-
// Source tab
#region source
string source = text_source.Text;
@@ -1859,6 +1856,7 @@ namespace Handbrake
this.thisDVD = dvd;
}
+ // Automatic File Naming
public void autoName()
{
if (Properties.Settings.Default.autoNaming == "Checked")
@@ -1921,6 +1919,7 @@ namespace Handbrake
}
}
+ // Chapter Marker Tab
private void chapterNaming()
{
try