diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/frmMain.Designer.cs | 54 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 37 | ||||
-rw-r--r-- | win/C#/frmMain.resx | 6 | ||||
-rw-r--r-- | win/C#/frmPreview.Designer.cs | 7 | ||||
-rw-r--r-- | win/C#/frmPreview.cs | 24 |
5 files changed, 96 insertions, 32 deletions
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 7893e7198..37dcd055a 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -38,7 +38,7 @@ namespace Handbrake System.Windows.Forms.Label Label38;
System.Windows.Forms.ContextMenuStrip notifyIconMenu;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();
this.File_Save = new System.Windows.Forms.SaveFileDialog();
@@ -244,11 +244,13 @@ namespace Handbrake this.btn_add2Queue = new System.Windows.Forms.ToolStripButton();
this.btn_showQueue = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
- this.btn_vidPreview = new System.Windows.Forms.ToolStripButton();
this.btn_ActivityWindow = new System.Windows.Forms.ToolStripButton();
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.StatusStrip = new System.Windows.Forms.StatusStrip();
this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();
+ this.tb_preview = new System.Windows.Forms.ToolStripDropDownButton();
+ this.mnu_qtpreview = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnu_vlcpreview = new System.Windows.Forms.ToolStripMenuItem();
Label38 = new System.Windows.Forms.Label();
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
notifyIconMenu.SuspendLayout();
@@ -642,9 +644,9 @@ namespace Handbrake //
// number
//
- dataGridViewCellStyle1.Format = "N0";
- dataGridViewCellStyle1.NullValue = null;
- this.number.DefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle3.Format = "N0";
+ dataGridViewCellStyle3.NullValue = null;
+ this.number.DefaultCellStyle = dataGridViewCellStyle3;
this.number.HeaderText = "Chapter Number";
this.number.MaxInputLength = 3;
this.number.Name = "number";
@@ -2743,7 +2745,7 @@ namespace Handbrake this.btn_add2Queue,
this.btn_showQueue,
this.toolStripSeparator4,
- this.btn_vidPreview,
+ this.tb_preview,
this.btn_ActivityWindow});
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
this.toolStrip1.Name = "toolStrip1";
@@ -2842,16 +2844,6 @@ namespace Handbrake this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 39);
//
- // btn_vidPreview
- //
- this.btn_vidPreview.Image = global::Handbrake.Properties.Resources.picture;
- this.btn_vidPreview.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
- this.btn_vidPreview.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.btn_vidPreview.Name = "btn_vidPreview";
- this.btn_vidPreview.Size = new System.Drawing.Size(81, 36);
- this.btn_vidPreview.Text = "Preview";
- this.btn_vidPreview.Click += new System.EventHandler(this.btn_vidPreview_Click);
- //
// btn_ActivityWindow
//
this.btn_ActivityWindow.Image = global::Handbrake.Properties.Resources.ActivityWindow;
@@ -2891,6 +2883,32 @@ namespace Handbrake this.lbl_encode.Size = new System.Drawing.Size(31, 17);
this.lbl_encode.Text = "{0}";
//
+ // tb_preview
+ //
+ this.tb_preview.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnu_qtpreview,
+ this.mnu_vlcpreview});
+ this.tb_preview.Image = global::Handbrake.Properties.Resources.picture;
+ this.tb_preview.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+ this.tb_preview.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tb_preview.Name = "tb_preview";
+ this.tb_preview.Size = new System.Drawing.Size(90, 36);
+ this.tb_preview.Text = "Preview";
+ //
+ // mnu_qtpreview
+ //
+ this.mnu_qtpreview.Name = "mnu_qtpreview";
+ this.mnu_qtpreview.Size = new System.Drawing.Size(185, 22);
+ this.mnu_qtpreview.Text = "Preview in QuickTime";
+ this.mnu_qtpreview.Click += new System.EventHandler(this.mnu_qtpreview_Click);
+ //
+ // mnu_vlcpreview
+ //
+ this.mnu_vlcpreview.Name = "mnu_vlcpreview";
+ this.mnu_vlcpreview.Size = new System.Drawing.Size(185, 22);
+ this.mnu_vlcpreview.Text = "Preview in VLC";
+ this.mnu_vlcpreview.Click += new System.EventHandler(this.mnu_vlcpreview_Click);
+ //
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -3151,7 +3169,6 @@ namespace Handbrake private System.Windows.Forms.ToolStripSeparator sep1;
private System.Windows.Forms.ToolStripMenuItem pmnu_delete;
private System.Windows.Forms.SplitContainer splitContainer1;
- private System.Windows.Forms.ToolStripButton btn_vidPreview;
private System.Windows.Forms.Button btn_RemoveAudioTrack;
private System.Windows.Forms.Button btn_addAudioTrack;
private System.Windows.Forms.ColumnHeader col_Source;
@@ -3167,6 +3184,9 @@ namespace Handbrake private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem audioList_remove;
private System.Windows.Forms.ImageList AudioMenuRowHeightHack;
+ private System.Windows.Forms.ToolStripDropDownButton tb_preview;
+ private System.Windows.Forms.ToolStripMenuItem mnu_qtpreview;
+ private System.Windows.Forms.ToolStripMenuItem mnu_vlcpreview;
}
}
\ No newline at end of file diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 418a15f69..6f9341641 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -37,7 +37,8 @@ namespace Handbrake // Globals: Mainly used for tracking.
private frmQueue queueWindow;
- private frmGenPreview preview;
+ private frmGenPreview vlcpreview;
+ private frmPreview qtpreview;
private string lastAction = null;
public int maxWidth = 0;
public int maxHeight = 0;
@@ -568,21 +569,41 @@ namespace Handbrake queueWindow.setQueue(encodeQueue);
queueWindow.Show();
}
- private void btn_vidPreview_Click(object sender, EventArgs e)
+ private void mnu_vlcpreview_Click(object sender, EventArgs e)
{
if (text_source.Text == "" || text_source.Text == "Click 'Source' to continue" || text_destination.Text == "")
MessageBox.Show("No source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else
{
- if (preview == null)
+ if (vlcpreview == null)
{
- preview = new frmGenPreview(this);
- preview.Show();
+ vlcpreview = new frmGenPreview(this);
+ vlcpreview.Show();
}
- else if (preview.IsDisposed)
+ else if (vlcpreview.IsDisposed)
{
- preview = new frmGenPreview(this);
- preview.Show();
+ vlcpreview = new frmGenPreview(this);
+ vlcpreview.Show();
+ }
+ else
+ MessageBox.Show("The preview window is already open!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ }
+ }
+ private void mnu_qtpreview_Click(object sender, EventArgs e)
+ {
+ if (text_source.Text == "" || text_source.Text == "Click 'Source' to continue" || text_destination.Text == "")
+ MessageBox.Show("No source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ else
+ {
+ if (qtpreview == null)
+ {
+ qtpreview = new frmPreview(this);
+ qtpreview.Show();
+ }
+ else if (qtpreview.IsDisposed)
+ {
+ qtpreview = new frmPreview(this);
+ qtpreview.Show();
}
else
MessageBox.Show("The preview window is already open!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
diff --git a/win/C#/frmMain.resx b/win/C#/frmMain.resx index d6bf08e3e..0039ebd87 100644 --- a/win/C#/frmMain.resx +++ b/win/C#/frmMain.resx @@ -155,6 +155,12 @@ Make sure you have selected a "Title" from the "Source" box above otherwise the list will not be populated with the correct amount of chapters.
Note: Do not change any of the chapter numbers!</value>
</data>
+ <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
<data name="check_Cabac.ToolTip" xml:space="preserve">
<value>CABAC, or context adaptive binary arithmetic coding, is used by x264 to reduce the bitrate needed for a given quality by 15%.
This makes it very cool and very useful, and it should be left on whenever possible. However, it is incompatible with the iPod 5.5G, and makes the AppleTV struggle.
diff --git a/win/C#/frmPreview.Designer.cs b/win/C#/frmPreview.Designer.cs index 5fb9b2b80..8ecd53ec8 100644 --- a/win/C#/frmPreview.Designer.cs +++ b/win/C#/frmPreview.Designer.cs @@ -13,9 +13,12 @@ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
- if (disposing && (components != null))
+ if (disposing)
{
- components.Dispose();
+ if (components != null)
+ {
+ components.Dispose();
+ }
}
base.Dispose(disposing);
}
diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs index cd44f74d8..c7d442d5d 100644 --- a/win/C#/frmPreview.cs +++ b/win/C#/frmPreview.cs @@ -23,6 +23,7 @@ namespace Handbrake String currently_playing = "";
frmMain mainWindow;
private Process hbProc;
+ private Thread player;
public frmPreview(frmMain mw)
{
@@ -32,17 +33,30 @@ namespace Handbrake cb_duration.SelectedIndex = 1;
}
- private void OpenMovie(string url)
+ private void play()
+ {
+ player = new Thread(OpenMovie);
+ player.IsBackground = true;
+ player.Start();
+ }
+
+ [STAThread]
+ private void OpenMovie()
{
try
{
- QTControl.URL = url;
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new UpdateUIHandler(OpenMovie));
+ return;
+ }
+ QTControl.URL = currently_playing;
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.URL = currently_playing;
QTControl.SetScale(0);
QTControl.Show();
@@ -59,7 +73,7 @@ namespace Handbrake MessageBox.Show("Unable to open movie:\n\n" + ex.ToString());
}
}
-
+
#region Encode Sample
private void btn_encode_Click(object sender, EventArgs e)
{
@@ -96,7 +110,7 @@ namespace Handbrake 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);
+ play();
lbl_encode.Text = "";
}
catch (Exception exc)
|