summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-01-04 22:28:21 +0000
committersr55 <[email protected]>2009-01-04 22:28:21 +0000
commit90c58971858b845e77bf97fc4d6e8d5f696c0dc1 (patch)
tree721cb4f03330a3dc316604b11c09cf5d4c4a9a1f
parentde7e8e8be0c1bd709a9f4381a06e786e75bd574a (diff)
WinGui:
- Fixes a few issues with the QT preview window and places it in the main directory. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2059 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/C#/frmPreview.Designer.cs (renamed from win/C#/Experimental/frmPreviewAX.Designer.cs)52
-rw-r--r--win/C#/frmPreview.cs (renamed from win/C#/Experimental/frmPreviewAX.cs)53
-rw-r--r--win/C#/frmPreview.resx (renamed from win/C#/Experimental/frmPreviewAX.resx)2
3 files changed, 63 insertions, 44 deletions
diff --git a/win/C#/Experimental/frmPreviewAX.Designer.cs b/win/C#/frmPreview.Designer.cs
index 775e5ebeb..5fb9b2b80 100644
--- a/win/C#/Experimental/frmPreviewAX.Designer.cs
+++ b/win/C#/frmPreview.Designer.cs
@@ -1,6 +1,6 @@
namespace Handbrake
{
- partial class frmPreviewAX
+ partial class frmPreview
{
/// <summary>
/// Required designer variable.
@@ -28,18 +28,18 @@
/// </summary>
private void InitializeComponent()
{
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPreviewAX));
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPreview));
this.toolBar = new System.Windows.Forms.ToolStrip();
this.lbl_preview = new System.Windows.Forms.ToolStripLabel();
this.cb_preview = new System.Windows.Forms.ToolStripComboBox();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.cb_duration = new System.Windows.Forms.ToolStripComboBox();
this.btn_encode = new System.Windows.Forms.ToolStripButton();
- this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
- this.btn_play = new System.Windows.Forms.ToolStripButton();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.QTControl = new AxQTOControlLib.AxQTControl();
+ this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();
this.toolBar.SuspendLayout();
+ this.statusStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.QTControl)).BeginInit();
this.SuspendLayout();
//
@@ -51,9 +51,7 @@
this.cb_preview,
this.toolStripLabel2,
this.cb_duration,
- this.btn_encode,
- this.toolStripSeparator1,
- this.btn_play});
+ this.btn_encode});
this.toolBar.Location = new System.Drawing.Point(0, 0);
this.toolBar.Name = "toolBar";
this.toolBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
@@ -122,27 +120,14 @@
this.btn_encode.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_encode.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_encode.Name = "btn_encode";
- this.btn_encode.Size = new System.Drawing.Size(115, 36);
- this.btn_encode.Text = "Encode Sample";
+ this.btn_encode.Size = new System.Drawing.Size(159, 36);
+ this.btn_encode.Text = "Encode and Play Sample";
this.btn_encode.Click += new System.EventHandler(this.btn_encode_Click);
//
- // toolStripSeparator1
- //
- this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(6, 39);
- //
- // btn_play
- //
- this.btn_play.Image = global::Handbrake.Properties.Resources.Play;
- this.btn_play.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
- this.btn_play.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.btn_play.Name = "btn_play";
- this.btn_play.Size = new System.Drawing.Size(63, 36);
- this.btn_play.Text = "Play";
- this.btn_play.Click += new System.EventHandler(this.btn_play_Click);
- //
// statusStrip
//
+ this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.lbl_encode});
this.statusStrip.Location = new System.Drawing.Point(0, 486);
this.statusStrip.Name = "statusStrip";
this.statusStrip.Size = new System.Drawing.Size(774, 22);
@@ -155,11 +140,19 @@
this.QTControl.Location = new System.Drawing.Point(0, 42);
this.QTControl.Name = "QTControl";
this.QTControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("QTControl.OcxState")));
- this.QTControl.Size = new System.Drawing.Size(1920, 1080);
+ this.QTControl.Size = new System.Drawing.Size(64, 64);
this.QTControl.TabIndex = 39;
this.QTControl.Visible = false;
//
- // frmPreviewAX
+ // lbl_encode
+ //
+ this.lbl_encode.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_encode.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_encode.Name = "lbl_encode";
+ this.lbl_encode.Size = new System.Drawing.Size(31, 17);
+ this.lbl_encode.Text = "{0}";
+ //
+ // frmPreview
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
@@ -169,12 +162,14 @@
this.Controls.Add(this.statusStrip);
this.Controls.Add(this.toolBar);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "frmPreviewAX";
+ this.Name = "frmPreview";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Video Preview";
this.TopMost = true;
this.toolBar.ResumeLayout(false);
this.toolBar.PerformLayout();
+ this.statusStrip.ResumeLayout(false);
+ this.statusStrip.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.QTControl)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -185,13 +180,12 @@
private System.Windows.Forms.ToolStrip toolBar;
private System.Windows.Forms.ToolStripButton btn_encode;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
- private System.Windows.Forms.ToolStripButton btn_play;
private System.Windows.Forms.StatusStrip statusStrip;
private AxQTOControlLib.AxQTControl QTControl;
private System.Windows.Forms.ToolStripComboBox cb_preview;
private System.Windows.Forms.ToolStripLabel lbl_preview;
private System.Windows.Forms.ToolStripLabel toolStripLabel2;
private System.Windows.Forms.ToolStripComboBox cb_duration;
+ private System.Windows.Forms.ToolStripStatusLabel lbl_encode;
}
} \ No newline at end of file
diff --git a/win/C#/Experimental/frmPreviewAX.cs b/win/C#/frmPreview.cs
index 89ccceccd..cd44f74d8 100644
--- a/win/C#/Experimental/frmPreviewAX.cs
+++ b/win/C#/frmPreview.cs
@@ -14,17 +14,17 @@ using QTOLibrary;
namespace Handbrake
{
- public partial class frmPreviewAX : Form
+ public partial class frmPreview : Form
{
Handbrake.QueryGenerator hb_common_func = new Handbrake.QueryGenerator();
Functions.Encode process = new Functions.Encode();
-
+ private delegate void UpdateUIHandler();
String currently_playing = "";
frmMain mainWindow;
private Process hbProc;
- public frmPreviewAX(frmMain mw)
+ public frmPreview(frmMain mw)
{
InitializeComponent();
this.mainWindow = mw;
@@ -32,23 +32,22 @@ namespace Handbrake
cb_duration.SelectedIndex = 1;
}
- private void btn_play_Click(object sender, EventArgs e)
- {
- if (mainWindow.text_destination.Text != "")
- currently_playing = mainWindow.text_destination.Text.Replace(".m", "_sample.m").Replace(".avi", "_sample.avi").Replace(".ogm", "_sample.ogm");
-
- OpenMovie(currently_playing);
-
- this.Width = QTControl.Width + 5;
- this.Height = QTControl.Height + 90;
- }
-
private void OpenMovie(string url)
{
try
{
QTControl.URL = url;
+ QTControl.Width = QTControl.Movie.Width;
+ QTControl.Height = QTControl.Movie.Height;
+ // The initial control size is 64,64. If we do not reload the clip here
+ // it'll scale the video from 64,64.
+ // Unsure why as it correctly resizes the control to the movies actual size.
+ QTControl.URL = url;
+ QTControl.SetScale(0);
QTControl.Show();
+
+ this.Width = QTControl.Width + 5;
+ this.Height = QTControl.Height + 90;
}
catch (COMException ex)
{
@@ -64,6 +63,8 @@ namespace Handbrake
#region Encode Sample
private void btn_encode_Click(object sender, EventArgs e)
{
+ btn_encode.Enabled = false;
+ lbl_encode.Text = "Encoding Sample ...";
String query = hb_common_func.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);
ThreadPool.QueueUserWorkItem(procMonitor, query);
}
@@ -77,6 +78,30 @@ namespace Handbrake
hbProc = process.runCli(this, (string)state);
hbProc.WaitForExit();
hbProc = null;
+ encodeCompleted();
+ }
+ }
+ private void encodeCompleted()
+ {
+ try
+ {
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new UpdateUIHandler(encodeCompleted));
+ return;
+ }
+ btn_encode.Enabled = true;
+ lbl_encode.Text = "Loading Clip ...";
+
+ if (mainWindow.text_destination.Text != "")
+ currently_playing = mainWindow.text_destination.Text.Replace(".m", "_sample.m").Replace(".avi", "_sample.avi").Replace(".ogm", "_sample.ogm");
+
+ OpenMovie(currently_playing);
+ lbl_encode.Text = "";
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("frmPreview.cs encodeCompleted " + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
#endregion
diff --git a/win/C#/Experimental/frmPreviewAX.resx b/win/C#/frmPreview.resx
index 670acba25..0db6e0108 100644
--- a/win/C#/Experimental/frmPreviewAX.resx
+++ b/win/C#/frmPreview.resx
@@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAVQAAAAIB
- AAAAAQAAAAAAAAAAAAAAAEAAAAAACAAAcMYAAJ9vAAATAA8AAIATAAAAAAADAAAAAAALAP//AwAAAAAA
+ AAAAAQAAAAAAAAAAAAAAAEAAAAAACAAAnQYAAJ0GAAATAA8AAIATAAAAAAADAAAAAAALAP//AwAAAAAA
CAACAAAAAAAIAAIAAAAAAAgAAgAAAAAACw==
</value>
</data>