/// Writes the current queue to disk. hb_queue_recovery.dat\r
/// This function is called after getNextItemForEncoding()\r
/// </summary>\r
- public void write2disk()\r
+ public void write2disk(string file)\r
{\r
try\r
{\r
- string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");\r
+ string tempPath = "";\r
+ if (file == "hb_queue_recovery.dat")\r
+ tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");\r
+ else\r
+ tempPath = file;\r
using (StreamWriter writer = new StreamWriter(tempPath))\r
{\r
foreach (string item in queue)\r
/// <summary>\r
/// Recover the queue from hb_queue_recovery.dat\r
/// </summary>\r
- public void recoverQueue()\r
+ public void recoverQueue(string file)\r
{\r
try\r
{\r
- string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");\r
+ string tempPath = "";\r
+ if (file == "hb_queue_recovery.dat")\r
+ tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");\r
+ else\r
+ tempPath = file;\r
using (StreamReader reader = new StreamReader(tempPath))\r
{\r
string queue_item = reader.ReadLine();\r
<PropertyGroup>\r
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
+ <ProductVersion>9.0.30729</ProductVersion>\r
<SchemaVersion>2.0</SchemaVersion>\r
<ProjectGuid>{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}</ProjectGuid>\r
<OutputType>WinExe</OutputType>\r
<None Include="Resources\hb16.png" />\r
<None Include="Resources\Help16.png" />\r
<None Include="Resources\info16.png" />\r
+ <None Include="Resources\folder.png" />\r
<Content Include="Resources\Output_Small.png" />\r
<None Include="Resources\Pause.png" />\r
<None Include="Resources\Play.png" />\r
<Content Include="Resources\Pref_Small.png" />\r
<Content Include="Resources\Queue.png" />\r
<Content Include="Resources\Queue_Small.png" />\r
+ <None Include="Resources\save.png" />\r
<None Include="Resources\stop.png" />\r
<None Include="Resources\SplashScreen.jpg" />\r
<None Include="Resources\Movies.png" />\r
//------------------------------------------------------------------------------\r
// <auto-generated>\r
// This code was generated by a tool.\r
-// Runtime Version:2.0.50727.1433\r
+// Runtime Version:2.0.50727.3053\r
//\r
// Changes to this file may cause incorrect behavior and will be lost if\r
// the code is regenerated.\r
}\r
}\r
\r
+ internal static System.Drawing.Bitmap folder {\r
+ get {\r
+ object obj = ResourceManager.GetObject("folder", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
internal static System.Drawing.Bitmap General_Preferences {\r
get {\r
object obj = ResourceManager.GetObject("General_Preferences", resourceCulture);\r
}\r
}\r
\r
+ internal static System.Drawing.Bitmap save {\r
+ get {\r
+ object obj = ResourceManager.GetObject("save", resourceCulture);\r
+ return ((System.Drawing.Bitmap)(obj));\r
+ }\r
+ }\r
+ \r
internal static System.Drawing.Bitmap SplashScreen {\r
get {\r
object obj = ResourceManager.GetObject("SplashScreen", resourceCulture);\r
<data name="stop" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
<value>..\Resources\stop.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
</data>\r
+ <data name="folder" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
+ <data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+ <value>..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+ </data>\r
</root>
\ No newline at end of file
result = MessageBox.Show("HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?", "Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question);\r
\r
if (result == DialogResult.Yes)\r
- encodeQueue.recoverQueue(); // Start Recovery\r
+ encodeQueue.recoverQueue("hb_queue_recovery.dat"); // Start Recovery\r
else\r
{\r
// Remove the Queue recovery file if the user doesn't want to recovery the last queue.\r
query = rtf_query.Text;\r
\r
encodeQueue.add(query);\r
- encodeQueue.write2disk(); // Writes the queue to the recovery file, just incase the GUI crashes.\r
+ encodeQueue.write2disk("hb_queue_recovery.dat"); // Writes the queue to the recovery file, just incase the GUI crashes.\r
\r
queueWindow.setQueue(encodeQueue);\r
queueWindow.Show();\r
this.label1 = new System.Windows.Forms.Label();\r
this.label3 = new System.Windows.Forms.Label();\r
this.toolStrip1 = new System.Windows.Forms.ToolStrip();\r
- this.btn_encode = new System.Windows.Forms.ToolStripButton();\r
- this.btn_stop = new System.Windows.Forms.ToolStripButton();\r
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
- this.btn_batch = new System.Windows.Forms.ToolStripButton();\r
this.SaveFile = new System.Windows.Forms.SaveFileDialog();\r
- this.pictureBox1 = new System.Windows.Forms.PictureBox();\r
this.list_queue = new System.Windows.Forms.ListView();\r
this.Title = new System.Windows.Forms.ColumnHeader();\r
this.Chapters = new System.Windows.Forms.ColumnHeader();\r
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();\r
this.progressBar = new System.Windows.Forms.ToolStripProgressBar();\r
this.lbl_progressValue = new System.Windows.Forms.ToolStripStatusLabel();\r
+ this.OpenFile = new System.Windows.Forms.OpenFileDialog();\r
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();\r
+ this.btn_encode = new System.Windows.Forms.ToolStripButton();\r
+ this.btn_stop = new System.Windows.Forms.ToolStripButton();\r
+ this.drop_button_queue = new System.Windows.Forms.ToolStripDropDownButton();\r
+ this.mnu_batch = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_import = new System.Windows.Forms.ToolStripMenuItem();\r
+ this.mnu_export = new System.Windows.Forms.ToolStripMenuItem();\r
this.toolStrip1.SuspendLayout();\r
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();\r
this.statusStrip1.SuspendLayout();\r
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();\r
this.SuspendLayout();\r
// \r
// btn_down\r
this.btn_encode,\r
this.btn_stop,\r
this.toolStripSeparator1,\r
- this.btn_batch});\r
- this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;\r
+ this.drop_button_queue});\r
this.toolStrip1.Location = new System.Drawing.Point(0, 0);\r
this.toolStrip1.Name = "toolStrip1";\r
this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;\r
this.toolStrip1.TabIndex = 71;\r
this.toolStrip1.Text = "toolStrip1";\r
// \r
- // btn_encode\r
- // \r
- this.btn_encode.Image = global::Handbrake.Properties.Resources.Play;\r
- this.btn_encode.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
- this.btn_encode.ImageTransparentColor = System.Drawing.Color.Magenta;\r
- this.btn_encode.Name = "btn_encode";\r
- this.btn_encode.Padding = new System.Windows.Forms.Padding(5);\r
- this.btn_encode.Size = new System.Drawing.Size(88, 46);\r
- this.btn_encode.Text = "Encode";\r
- this.btn_encode.Click += new System.EventHandler(this.btn_encode_Click);\r
- // \r
- // btn_stop\r
- // \r
- this.btn_stop.Image = global::Handbrake.Properties.Resources.Pause;\r
- this.btn_stop.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
- this.btn_stop.ImageTransparentColor = System.Drawing.Color.Magenta;\r
- this.btn_stop.Name = "btn_stop";\r
- this.btn_stop.Size = new System.Drawing.Size(72, 46);\r
- this.btn_stop.Text = "Pause";\r
- this.btn_stop.Visible = false;\r
- this.btn_stop.Click += new System.EventHandler(this.btn_stop_Click);\r
- // \r
// toolStripSeparator1\r
// \r
this.toolStripSeparator1.Name = "toolStripSeparator1";\r
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 49);\r
// \r
- // btn_batch\r
- // \r
- this.btn_batch.Image = global::Handbrake.Properties.Resources.ActivityWindow;\r
- this.btn_batch.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
- this.btn_batch.ImageTransparentColor = System.Drawing.Color.Magenta;\r
- this.btn_batch.Name = "btn_batch";\r
- this.btn_batch.Size = new System.Drawing.Size(100, 46);\r
- this.btn_batch.Text = "Batch Script";\r
- this.btn_batch.Click += new System.EventHandler(this.btn_batch_Click);\r
- // \r
// SaveFile\r
// \r
this.SaveFile.Filter = "Batch|.bat";\r
// \r
- // pictureBox1\r
- // \r
- this.pictureBox1.Image = global::Handbrake.Properties.Resources.Queue;\r
- this.pictureBox1.Location = new System.Drawing.Point(12, 61);\r
- this.pictureBox1.Name = "pictureBox1";\r
- this.pictureBox1.Size = new System.Drawing.Size(37, 32);\r
- this.pictureBox1.TabIndex = 61;\r
- this.pictureBox1.TabStop = false;\r
- // \r
// list_queue\r
// \r
this.list_queue.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {\r
this.lbl_progressValue.Size = new System.Drawing.Size(30, 26);\r
this.lbl_progressValue.Text = " 0 %";\r
// \r
+ // OpenFile\r
+ // \r
+ this.OpenFile.Filter = "HandBrake Queue|*.queue";\r
+ // \r
+ // pictureBox1\r
+ // \r
+ this.pictureBox1.Image = global::Handbrake.Properties.Resources.Queue;\r
+ this.pictureBox1.Location = new System.Drawing.Point(12, 61);\r
+ this.pictureBox1.Name = "pictureBox1";\r
+ this.pictureBox1.Size = new System.Drawing.Size(37, 32);\r
+ this.pictureBox1.TabIndex = 61;\r
+ this.pictureBox1.TabStop = false;\r
+ // \r
+ // btn_encode\r
+ // \r
+ this.btn_encode.Image = global::Handbrake.Properties.Resources.Play;\r
+ this.btn_encode.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
+ this.btn_encode.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+ this.btn_encode.Name = "btn_encode";\r
+ this.btn_encode.Padding = new System.Windows.Forms.Padding(5);\r
+ this.btn_encode.Size = new System.Drawing.Size(88, 46);\r
+ this.btn_encode.Text = "Encode";\r
+ this.btn_encode.Click += new System.EventHandler(this.btn_encode_Click);\r
+ // \r
+ // btn_stop\r
+ // \r
+ this.btn_stop.Image = global::Handbrake.Properties.Resources.Pause;\r
+ this.btn_stop.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
+ this.btn_stop.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+ this.btn_stop.Name = "btn_stop";\r
+ this.btn_stop.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;\r
+ this.btn_stop.Size = new System.Drawing.Size(72, 46);\r
+ this.btn_stop.Text = "Pause";\r
+ this.btn_stop.Visible = false;\r
+ this.btn_stop.Click += new System.EventHandler(this.btn_stop_Click);\r
+ // \r
+ // drop_button_queue\r
+ // \r
+ this.drop_button_queue.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
+ this.mnu_batch,\r
+ this.mnu_import,\r
+ this.mnu_export});\r
+ this.drop_button_queue.Image = global::Handbrake.Properties.Resources.ActivityWindow;\r
+ this.drop_button_queue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
+ this.drop_button_queue.ImageTransparentColor = System.Drawing.Color.Magenta;\r
+ this.drop_button_queue.Name = "drop_button_queue";\r
+ this.drop_button_queue.Size = new System.Drawing.Size(84, 46);\r
+ this.drop_button_queue.Text = "Queue";\r
+ // \r
+ // mnu_batch\r
+ // \r
+ this.mnu_batch.Image = global::Handbrake.Properties.Resources.Output_Small;\r
+ this.mnu_batch.Name = "mnu_batch";\r
+ this.mnu_batch.Size = new System.Drawing.Size(190, 22);\r
+ this.mnu_batch.Text = "Generate Batch Script";\r
+ this.mnu_batch.Click += new System.EventHandler(this.mnu_batch_Click);\r
+ // \r
+ // mnu_import\r
+ // \r
+ this.mnu_import.Image = global::Handbrake.Properties.Resources.folder;\r
+ this.mnu_import.Name = "mnu_import";\r
+ this.mnu_import.Size = new System.Drawing.Size(190, 22);\r
+ this.mnu_import.Text = "Import Queue";\r
+ this.mnu_import.Click += new System.EventHandler(this.mnu_import_Click);\r
+ // \r
+ // mnu_export\r
+ // \r
+ this.mnu_export.Image = global::Handbrake.Properties.Resources.save;\r
+ this.mnu_export.Name = "mnu_export";\r
+ this.mnu_export.Size = new System.Drawing.Size(190, 22);\r
+ this.mnu_export.Text = "Export Queue";\r
+ this.mnu_export.Click += new System.EventHandler(this.mnu_export_Click);\r
+ // \r
// frmQueue\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);\r
this.Text = "Encode Queue";\r
this.toolStrip1.ResumeLayout(false);\r
this.toolStrip1.PerformLayout();\r
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();\r
this.statusStrip1.ResumeLayout(false);\r
this.statusStrip1.PerformLayout();\r
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();\r
this.ResumeLayout(false);\r
this.PerformLayout();\r
\r
private System.Windows.Forms.ToolStripButton btn_encode;\r
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\r
private System.Windows.Forms.ToolStripButton btn_stop;\r
- private System.Windows.Forms.ToolStripButton btn_batch;\r
private System.Windows.Forms.SaveFileDialog SaveFile;\r
private System.Windows.Forms.ListView list_queue;\r
private System.Windows.Forms.ColumnHeader Title;\r
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;\r
private System.Windows.Forms.ToolStripProgressBar progressBar;\r
private System.Windows.Forms.ToolStripStatusLabel lbl_progressValue;\r
+ private System.Windows.Forms.ToolStripDropDownButton drop_button_queue;\r
+ private System.Windows.Forms.ToolStripMenuItem mnu_batch;\r
+ private System.Windows.Forms.ToolStripMenuItem mnu_import;\r
+ private System.Windows.Forms.ToolStripMenuItem mnu_export;\r
+ private System.Windows.Forms.OpenFileDialog OpenFile;\r
}\r
}
\ No newline at end of file
btn_stop.Visible = true;\r
progressBar.Value = 0;\r
lbl_progressValue.Text = "0 %";\r
- progressBar.Step = 100 / queue.count(); \r
+ progressBar.Step = 100 / queue.count();\r
Thread theQ = new Thread(startProc);\r
theQ.IsBackground = true;\r
theQ.Start();\r
if (list_queue.SelectedIndices.Count != 0)\r
{\r
queue.moveUp(list_queue.SelectedIndices[0]);\r
- queue.write2disk(); // Update the queue recovery file\r
+ queue.write2disk("hb_queue_recovery.dat"); // Update the queue recovery file\r
redrawQueue();\r
}\r
}\r
if (list_queue.SelectedIndices.Count != 0)\r
{\r
queue.moveDown(list_queue.SelectedIndices[0]);\r
- queue.write2disk(); // Update the queue recovery file\r
+ queue.write2disk("hb_queue_recovery.dat"); // Update the queue recovery file\r
redrawQueue();\r
}\r
}\r
if (list_queue.SelectedIndices.Count != 0)\r
{\r
queue.remove(list_queue.SelectedIndices[0]);\r
- queue.write2disk(); // Update the queue recovery file\r
+ queue.write2disk("hb_queue_recovery.dat"); // Update the queue recovery file\r
redrawQueue();\r
}\r
}\r
\r
- // Generate a batch file script to run the encode seperate of HandBrake\r
- private void btn_batch_Click(object sender, EventArgs e)\r
+\r
+ // Hide's the window from the users view.\r
+ private void btn_Close_Click(object sender, EventArgs e)\r
+ {\r
+ this.Hide();\r
+ }\r
+\r
+ // Hide's the window when the user tries to "x" out of the window instead of closing it.\r
+ protected override void OnClosing(CancelEventArgs e)\r
+ {\r
+ e.Cancel = true;\r
+ this.Hide();\r
+ base.OnClosing(e);\r
+ }\r
+\r
+ private void mnu_batch_Click(object sender, EventArgs e)\r
{\r
string queries = "";\r
- foreach (string query_item in queue.getQueue()) \r
+ foreach (string query_item in queue.getQueue())\r
{\r
string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query_item;\r
\r
}\r
string strCmdLine = queries;\r
\r
+ SaveFile.Filter = "Batch|.bat";\r
SaveFile.ShowDialog();\r
string filename = SaveFile.FileName;\r
\r
}\r
}\r
\r
- // Hide's the window from the users view.\r
- private void btn_Close_Click(object sender, EventArgs e)\r
+ private void mnu_export_Click(object sender, EventArgs e)\r
{\r
- this.Hide();\r
+ SaveFile.Filter = "HandBrake Queue|*.queue";\r
+ SaveFile.ShowDialog();\r
+ if (SaveFile.FileName != String.Empty)\r
+ queue.write2disk(SaveFile.FileName);\r
}\r
\r
- // Hide's the window when the user tries to "x" out of the window instead of closing it.\r
- protected override void OnClosing(CancelEventArgs e)\r
+ private void mnu_import_Click(object sender, EventArgs e)\r
{\r
- e.Cancel = true;\r
- this.Hide();\r
- base.OnClosing(e);\r
+ OpenFile.ShowDialog();\r
+ if (OpenFile.FileName != String.Empty)\r
+ queue.recoverQueue(OpenFile.FileName);\r
+ redrawQueue();\r
}\r
\r
+\r
}\r
}
\ No newline at end of file
<value>17, 17</value>\r
</metadata>\r
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>109, 17</value>\r
+ <value>93, 17</value>\r
</metadata>\r
<metadata name="SaveFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>208, 17</value>\r
+ <value>176, 17</value>\r
</metadata>\r
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>300, 17</value>\r
+ <value>366, 17</value>\r
+ </metadata>\r
+ <metadata name="OpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+ <value>252, 17</value>\r
+ </metadata>\r
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+ <value>True</value>\r
</metadata>\r
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r