diff options
author | sr55 <[email protected]> | 2009-01-04 23:02:32 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-01-04 23:02:32 +0000 |
commit | 1a9d98d7f9a76c8f6a0057c6acb7ce599ab36464 (patch) | |
tree | ad681fc7b6cb69f339a1b0223a8bbf6065904934 /win/C#/frmPreview.cs | |
parent | 90c58971858b845e77bf97fc4d6e8d5f696c0dc1 (diff) |
WinGui:
- Makes the new preview window user accessible from the main window.
- Attempt at a fix for a QT lockup.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2060 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmPreview.cs')
-rw-r--r-- | win/C#/frmPreview.cs | 24 |
1 files changed, 19 insertions, 5 deletions
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)
|