]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sat, 11 Sep 2010 14:23:01 +0000 (14:23 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 11 Sep 2010 14:23:01 +0000 (14:23 +0000)
- Some fixes and improvements to the preview window.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3512 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmPreview.Designer.cs
win/C#/frmPreview.cs
win/C#/frmPreview.resx

index d37a8f53ea24adbeca2eddaaca3b0153ac58ae3e..729e65b2b990178f6bbbe7295da77cb03db68694 100644 (file)
             this.cb_duration = new System.Windows.Forms.ToolStripComboBox();\r
             this.btn_playQT = new System.Windows.Forms.ToolStripButton();\r
             this.btn_playVLC = new System.Windows.Forms.ToolStripButton();\r
-            this.QTControl = new AxQTOControlLib.AxQTControl();\r
-            this.panel1 = new System.Windows.Forms.Panel();\r
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
             this.ProgressBarStatus = new System.Windows.Forms.ToolStripProgressBar();\r
             this.lbl_encodeStatus = new System.Windows.Forms.ToolStripLabel();\r
+            this.panel1 = new System.Windows.Forms.Panel();\r
+            this.QTControl = new AxQTOControlLib.AxQTControl();\r
             this.toolBar.SuspendLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.QTControl)).BeginInit();\r
             this.panel1.SuspendLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.QTControl)).BeginInit();\r
             this.SuspendLayout();\r
             // \r
             // toolBar\r
             // \r
+            this.toolBar.AutoSize = false;\r
             this.toolBar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;\r
             this.toolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
             this.lbl_preview,\r
@@ -65,7 +66,7 @@
             this.toolBar.Location = new System.Drawing.Point(0, 0);\r
             this.toolBar.Name = "toolBar";\r
             this.toolBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
-            this.toolBar.Size = new System.Drawing.Size(772, 25);\r
+            this.toolBar.Size = new System.Drawing.Size(722, 25);\r
             this.toolBar.TabIndex = 37;\r
             this.toolBar.Text = "toolStrip1";\r
             // \r
             this.btn_playQT.Name = "btn_playQT";\r
             this.btn_playQT.Size = new System.Drawing.Size(96, 22);\r
             this.btn_playQT.Text = "Play with QT";\r
-            this.btn_playQT.Click += new System.EventHandler(this.PlayQT_Click);\r
+            this.btn_playQT.Click += new System.EventHandler(this.PlayQtClick);\r
             // \r
             // btn_playVLC\r
             // \r
             this.btn_playVLC.Name = "btn_playVLC";\r
             this.btn_playVLC.Size = new System.Drawing.Size(101, 22);\r
             this.btn_playVLC.Text = "Play with VLC";\r
-            this.btn_playVLC.Click += new System.EventHandler(this.PlayVLC_Click);\r
-            // \r
-            // QTControl\r
-            // \r
-            this.QTControl.Enabled = true;\r
-            this.QTControl.Location = new System.Drawing.Point(0, 0);\r
-            this.QTControl.Name = "QTControl";\r
-            this.QTControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("QTControl.OcxState")));\r
-            this.QTControl.Size = new System.Drawing.Size(64, 72);\r
-            this.QTControl.TabIndex = 39;\r
-            this.QTControl.Visible = false;\r
-            // \r
-            // panel1\r
-            // \r
-            this.panel1.Controls.Add(this.QTControl);\r
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
-            this.panel1.Location = new System.Drawing.Point(0, 25);\r
-            this.panel1.Name = "panel1";\r
-            this.panel1.Size = new System.Drawing.Size(772, 481);\r
-            this.panel1.TabIndex = 40;\r
+            this.btn_playVLC.Click += new System.EventHandler(this.PlayVlcClick);\r
             // \r
             // toolStripSeparator1\r
             // \r
             this.lbl_encodeStatus.Text = "0.00%";\r
             this.lbl_encodeStatus.Visible = false;\r
             // \r
+            // panel1\r
+            // \r
+            this.panel1.AutoSize = true;\r
+            this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;\r
+            this.panel1.Controls.Add(this.QTControl);\r
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.panel1.Location = new System.Drawing.Point(0, 25);\r
+            this.panel1.Name = "panel1";\r
+            this.panel1.Size = new System.Drawing.Size(722, 481);\r
+            this.panel1.TabIndex = 40;\r
+            // \r
+            // QTControl\r
+            // \r
+            this.QTControl.Enabled = true;\r
+            this.QTControl.Location = new System.Drawing.Point(0, 0);\r
+            this.QTControl.Name = "QTControl";\r
+            this.QTControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("QTControl.OcxState")));\r
+            this.QTControl.Size = new System.Drawing.Size(64, 72);\r
+            this.QTControl.TabIndex = 39;\r
+            this.QTControl.Visible = false;\r
+            // \r
             // frmPreview\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+            this.AutoSize = true;\r
+            this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;\r
             this.BackColor = System.Drawing.Color.Black;\r
-            this.ClientSize = new System.Drawing.Size(772, 506);\r
+            this.ClientSize = new System.Drawing.Size(722, 506);\r
             this.Controls.Add(this.panel1);\r
             this.Controls.Add(this.toolBar);\r
             this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
+            this.MinimumSize = new System.Drawing.Size(730, 32);\r
             this.Name = "frmPreview";\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
             this.Text = "Video Preview";\r
             this.toolBar.ResumeLayout(false);\r
             this.toolBar.PerformLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.QTControl)).EndInit();\r
             this.panel1.ResumeLayout(false);\r
+            ((System.ComponentModel.ISupportInitialize)(this.QTControl)).EndInit();\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
index d68841b4980e0f082417eebab2236cc86106d77b..bbf8c78e405967e3ecee2d894e810cc622913741 100644 (file)
@@ -25,6 +25,7 @@ namespace Handbrake
     public partial class frmPreview : Form\r
     {\r
         #region Private Variables\r
+\r
         /// <summary>\r
         /// The Main Window\r
         /// </summary>\r
@@ -33,7 +34,7 @@ namespace Handbrake
         /// <summary>\r
         /// True if QT is not installed\r
         /// </summary>\r
-        private readonly bool noQT;\r
+        private readonly bool noQt;\r
 \r
         /// <summary>\r
         /// The encode queue\r
@@ -48,13 +49,15 @@ namespace Handbrake
         /// <summary>\r
         /// Play With VLC tracker\r
         /// </summary>\r
-        private bool playWithVLC;\r
+        private bool playWithVlc;\r
 \r
         /// <summary>\r
         /// A Thread for the video player\r
         /// </summary>\r
         private Thread player;\r
 \r
+        #endregion\r
+\r
         /// <summary>\r
         /// Initializes a new instance of the <see cref="frmPreview"/> class.\r
         /// </summary>\r
@@ -69,21 +72,27 @@ namespace Handbrake
             }\r
             catch (Exception)\r
             {\r
-                this.noQT = true;\r
+                this.noQt = true;\r
             }\r
+\r
             this.mainWindow = mw;\r
+\r
             cb_preview.SelectedIndex = 0;\r
             cb_duration.SelectedIndex = 1;\r
 \r
             cb_preview.Items.Clear();\r
             for (int i = 1; i <= Properties.Settings.Default.previewScanCount; i++)\r
+            {\r
                 cb_preview.Items.Add(i.ToString());\r
+            }\r
+\r
             cb_preview.SelectedIndex = 0;\r
 \r
-            encodeQueue.EncodeStarted += this.EncodeQueue_EncodeStarted;\r
-            encodeQueue.EncodeEnded += this.EncodeQueue_EncodeEnded;\r
+            encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;\r
+            encodeQueue.EncodeEnded += this.EncodeQueueEncodeEnded;\r
         }\r
 \r
+        #region Delegates\r
         /// <summary>\r
         /// Update UI Delegate\r
         /// </summary>\r
@@ -93,15 +102,15 @@ namespace Handbrake
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private delegate void UpdateUIHandler(object sender, EventArgs e);\r
+        private delegate void UpdateUiHandler(object sender, EventArgs e);\r
 \r
         /// <summary>\r
         /// The Open Movie Handler\r
         /// </summary>\r
         private delegate void OpenMovieHandler();\r
-\r
         #endregion\r
 \r
+        #region Event Handlers\r
         /// <summary>\r
         /// The encode has started\r
         /// </summary>\r
@@ -111,9 +120,9 @@ namespace Handbrake
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void EncodeQueue_EncodeStarted(object sender, EventArgs e)\r
+        private void EncodeQueueEncodeStarted(object sender, EventArgs e)\r
         {\r
-            encodeQueue.EncodeStatusChanged += this.EncodeQueue_EncodeStatusChanged;\r
+            encodeQueue.EncodeStatusChanged += this.EncodeQueueEncodeStatusChanged;\r
         }\r
 \r
         /// <summary>\r
@@ -125,22 +134,22 @@ namespace Handbrake
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void EncodeQueue_EncodeEnded(object sender, EventArgs e)\r
+        private void EncodeQueueEncodeEnded(object sender, EventArgs e)\r
         {\r
-            encodeQueue.EncodeStatusChanged -= this.EncodeQueue_EncodeStatusChanged;\r
+            encodeQueue.EncodeStatusChanged -= this.EncodeQueueEncodeStatusChanged;\r
 \r
             try\r
             {\r
                 if (this.InvokeRequired)\r
                 {\r
-                    this.BeginInvoke(new UpdateUIHandler(EncodeQueue_EncodeEnded), new[] { sender, e });\r
+                    this.BeginInvoke(new UpdateUiHandler(EncodeQueueEncodeEnded), new[] { sender, e });\r
                     return;\r
                 }\r
 \r
                 ProgressBarStatus.Visible = false;\r
                 lbl_encodeStatus.Visible = false;\r
 \r
-                if (!this.noQT)\r
+                if (!this.noQt)\r
                     btn_playQT.Enabled = true;\r
                 btn_playVLC.Enabled = true;\r
 \r
@@ -153,10 +162,10 @@ namespace Handbrake
                             Replace(".mkv", "_sample.mkv");\r
 \r
                 // Play back in QT or VLC\r
-                if (!playWithVLC)\r
+                if (!playWithVlc)\r
                     Play();\r
                 else\r
-                    PlayVLC();\r
+                    PlayVlc();\r
             }\r
             catch (Exception exc)\r
             {\r
@@ -173,17 +182,18 @@ namespace Handbrake
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void EncodeQueue_EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EncodeProgressEventArgs e)\r
+        private void EncodeQueueEncodeStatusChanged(object sender, HandBrake.ApplicationServices.EncodeProgressEventArgs e)\r
         {\r
             if (this.InvokeRequired)\r
             {\r
-                this.BeginInvoke(new Encode.EncodeProgessStatus(this.EncodeQueue_EncodeStatusChanged), new[] { sender, e });\r
+                this.BeginInvoke(new Encode.EncodeProgessStatus(this.EncodeQueueEncodeStatusChanged), new[] { sender, e });\r
                 return;\r
             }\r
 \r
             lbl_encodeStatus.Text = e.PercentComplete + "%";\r
             ProgressBarStatus.Value = (int)Math.Round(e.PercentComplete);\r
         }\r
+        #endregion\r
 \r
         #region Encode Sample\r
 \r
@@ -196,16 +206,17 @@ namespace Handbrake
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void PlayVLC_Click(object sender, EventArgs e)\r
+        private void PlayVlcClick(object sender, EventArgs e)\r
         {\r
             ProgressBarStatus.Visible = true;\r
             ProgressBarStatus.Value = 0;\r
             lbl_encodeStatus.Visible = true;\r
-            playWithVLC = true;\r
-\r
+            playWithVlc = true;\r
+            this.panel1.Visible = false;\r
+            \r
             try\r
             {\r
-                if (!this.noQT)\r
+                if (!this.noQt)\r
                     QTControl.URL = string.Empty;\r
 \r
                 if (File.Exists(this.currentlyPlaying))\r
@@ -235,10 +246,11 @@ namespace Handbrake
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        private void PlayQT_Click(object sender, EventArgs e)\r
+        private void PlayQtClick(object sender, EventArgs e)\r
         {\r
-            playWithVLC = false;\r
-            if (this.noQT)\r
+            playWithVlc = false;\r
+            this.panel1.Visible = true;\r
+            if (this.noQt)\r
             {\r
                 MessageBox.Show(this,\r
                                 "It would appear QuickTime 7 is not installed or not accessible. Please (re)install QuickTime.",\r
@@ -248,7 +260,7 @@ namespace Handbrake
             if (this.mainWindow.text_destination.Text.Contains(".mkv"))\r
             {\r
                 MessageBox.Show(this,\r
-                                "The QuickTime Control does not support MKV files, It is recommended you use VLC option instead.",\r
+                                "The QuickTime Control does not support MKV files, It is recommended you use the VLC option instead.",\r
                                 "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
             else\r
@@ -294,7 +306,7 @@ namespace Handbrake
                 MessageBox.Show(\r
                     this,\r
                     "Handbrake is already encoding a video!",\r
-                    "Status",\r
+                    "Warning",\r
                     MessageBoxButtons.OK,\r
                     MessageBoxIcon.Warning);\r
 \r
@@ -320,7 +332,7 @@ namespace Handbrake
         /// <summary>\r
         /// Play the video back in an external VLC Player\r
         /// </summary>\r
-        private void PlayVLC()\r
+        private void PlayVlc()\r
         {\r
             // Launch VLC and Play video.\r
             if (this.currentlyPlaying != string.Empty)\r
@@ -411,8 +423,8 @@ namespace Handbrake
         /// </param>\r
         protected override void OnClosing(System.ComponentModel.CancelEventArgs e)\r
         {\r
-            encodeQueue.EncodeStarted -= this.EncodeQueue_EncodeStarted;\r
-            encodeQueue.EncodeEnded -= this.EncodeQueue_EncodeEnded;\r
+            encodeQueue.EncodeStarted -= this.EncodeQueueEncodeStarted;\r
+            encodeQueue.EncodeEnded -= this.EncodeQueueEncodeEnded;\r
             base.OnClosing(e);\r
         }\r
     }\r
index f75a67ce1857d4896d123959738ca783c47187c2..85ca67137f9830ac28775a333fb4d5711460e86c 100644 (file)
   </metadata>\r
   <data name="QTControl.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">\r
     <value>\r
-        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w\r
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w\r
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0\r
         ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAVQAAAAIB\r
         AAAAAQAAAAAAAAAAAAAAAEAAAAAACAAAnQYAAHEHAAATAA8AAIATAAAAAAADAAAAAAALAP//AwAAAAAA\r