diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/EncodeQueue/EncodeAndQueueHandler.cs | 11 | ||||
-rw-r--r-- | win/C#/frmActivityWindow.cs | 4 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 30 |
3 files changed, 25 insertions, 20 deletions
diff --git a/win/C#/EncodeQueue/EncodeAndQueueHandler.cs b/win/C#/EncodeQueue/EncodeAndQueueHandler.cs index db91e6d90..17db75293 100644 --- a/win/C#/EncodeQueue/EncodeAndQueueHandler.cs +++ b/win/C#/EncodeQueue/EncodeAndQueueHandler.cs @@ -18,7 +18,7 @@ namespace Handbrake.EncodeQueue {
public class EncodeAndQueueHandler
{
- private static XmlSerializer serializer = new XmlSerializer(typeof(List<Job>));
+ private static XmlSerializer serializer;
private List<Job> queue = new List<Job>();
private int nextJobId;
@@ -148,6 +148,8 @@ namespace Handbrake.EncodeQueue {
using (FileStream strm = new FileStream(tempPath, FileMode.Create, FileAccess.Write))
{
+ if (serializer == null)
+ serializer = new XmlSerializer(typeof(List<Job>));
serializer.Serialize(strm, queue);
strm.Close();
strm.Dispose();
@@ -215,6 +217,9 @@ namespace Handbrake.EncodeQueue {
if (strm.Length != 0)
{
+ if (serializer == null)
+ serializer = new XmlSerializer(typeof(List<Job>));
+
List<Job> list = serializer.Deserialize(strm) as List<Job>;
if (list != null)
@@ -325,7 +330,7 @@ namespace Handbrake.EncodeQueue hbProcess.Close();
hbProcess.Dispose();
-
+
isEncoding = false;
//Growl
@@ -383,7 +388,7 @@ namespace Handbrake.EncodeQueue Process[] before = Process.GetProcesses(); // Get a list of running processes before starting.
hbProcess = Process.Start(cliStart);
- processID = Main.getCliProcess(before);
+ processID = Main.getCliProcess(before);
currentQuery = query;
if (hbProcess != null)
processHandle = hbProcess.MainWindowHandle; // Set the process Handle
diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs index 5f41c799b..9d004ffc7 100644 --- a/win/C#/frmActivityWindow.cs +++ b/win/C#/frmActivityWindow.cs @@ -28,14 +28,14 @@ namespace Handbrake public frmActivityWindow(string mode)
{
+ InitializeComponent();
+
_kilLThread = false;
_position = 0;
if (mode == "scan")
SetScanMode();
else
SetEncodeMode();
-
- InitializeComponent();
}
private void NewActivityWindow_Load(object sender, EventArgs e)
{
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index c6fb58e60..87ea63e92 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -192,8 +192,8 @@ namespace Handbrake {
return this.dvdDriveLabel;
}
-
- if(Path.GetFileNameWithoutExtension(this.sourcePath) != "VIDEO_TS")
+
+ if (Path.GetFileNameWithoutExtension(this.sourcePath) != "VIDEO_TS")
return Path.GetFileNameWithoutExtension(this.sourcePath);
return Path.GetFileNameWithoutExtension(Path.GetDirectoryName(this.sourcePath));
@@ -789,19 +789,19 @@ namespace Handbrake {
if (ActivityWindow == null || !ActivityWindow.IsHandleCreated)
ActivityWindow = new frmActivityWindow(lastAction);
-
- switch (lastAction)
- {
- case "scan":
- ActivityWindow.SetScanMode();
- break;
- case "encode":
- ActivityWindow.SetEncodeMode();
- break;
- default:
- ActivityWindow.SetEncodeMode();
- break;
- }
+ else
+ switch (lastAction)
+ {
+ case "scan":
+ ActivityWindow.SetScanMode();
+ break;
+ case "encode":
+ ActivityWindow.SetEncodeMode();
+ break;
+ default:
+ ActivityWindow.SetEncodeMode();
+ break;
+ }
ActivityWindow.Show();
ActivityWindow.Activate();
|