summaryrefslogtreecommitdiffstats
path: root/win/C#/frmGenPreview.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-02-19 18:30:32 +0000
committersr55 <[email protected]>2009-02-19 18:30:32 +0000
commit40f3eab91de2779cf2490fa51b6b232a0d4432ae (patch)
tree3feb31ded0afaf035166bf1ca1586fb0265aab8e /win/C#/frmGenPreview.cs
parent4094ee87962714480465a116035a534d19ecc55c (diff)
WinGui:
- Re-add all the x264 tooltips. - Combines the 2 Preview windows for VLC and QT into one. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2167 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmGenPreview.cs')
-rw-r--r--win/C#/frmGenPreview.cs111
1 files changed, 0 insertions, 111 deletions
diff --git a/win/C#/frmGenPreview.cs b/win/C#/frmGenPreview.cs
deleted file mode 100644
index 29a6213ad..000000000
--- a/win/C#/frmGenPreview.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Threading;
-using System.Diagnostics;
-using System.IO;
-
-namespace Handbrake
-{
- public partial class frmGenPreview : Form
- {
- private delegate void UpdateHandler();
- QueryGenerator queryGen = new QueryGenerator();
- Functions.Encode process = new Functions.Encode();
- Process hbProc;
- frmMain mainWindow;
-
- public frmGenPreview(frmMain mw)
- {
- InitializeComponent();
- this.mainWindow = mw;
- cb_duration.SelectedIndex = 0;
- cb_preview.SelectedIndex = 0;
- }
-
- private void btn_play_Click(object sender, EventArgs e)
- {
- // Get the Destination of the sample video.
- String currently_playing = "";
- if (mainWindow.text_destination.Text != "")
- currently_playing = mainWindow.text_destination.Text.Replace(".m", "_sample.m").Replace(".avi", "_sample.avi").Replace(".ogm", "_sample.ogm");
-
- // Launch VLC and play video.
- if (currently_playing != "")
- {
- if (File.Exists(currently_playing))
- {
- if (File.Exists(Properties.Settings.Default.VLC_Path))
- {
- String args = "\"" + currently_playing + "\"";
- ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);
- Process.Start(vlc);
- lbl_status.Text = "VLC will now launch.";
- }
- else
- MessageBox.Show("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- } else
- MessageBox.Show("Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
-
- private void btn_encode_Click(object sender, EventArgs e)
- {
- String query = queryGen.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);
- ThreadPool.QueueUserWorkItem(procMonitor, query);
- }
- private void procMonitor(object state)
- {
- // Make sure we are not already encoding and if we are then display an error.
- if (hbProc != null)
- MessageBox.Show("Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- else
- {
- encodingMessage();
- hbProc = process.runCli(this, (string)state);
- hbProc.WaitForExit();
- hbProc = null;
- updateUIElements();
- }
- }
- // Update the UI now that the encode has finished.
- private void encodingMessage()
- {
- try
- {
- if (InvokeRequired)
- {
- BeginInvoke(new UpdateHandler(encodingMessage));
- return;
- }
- lbl_status.Text = "Encoding, Please wait ...";
- }
- catch (Exception exc)
- {
- MessageBox.Show(exc.ToString());
- }
- }
-
- // Update the UI now that the encode has finished.
- private void updateUIElements()
- {
- try
- {
- if (InvokeRequired)
- {
- BeginInvoke(new UpdateHandler(updateUIElements));
- return;
- }
-
- btn_play.Visible = true;
- toolStripSeparator1.Visible = true;
- lbl_status.Text = "Your sample is ready to play.";
- }
- catch (Exception exc)
- {
- MessageBox.Show(exc.ToString());
- }
- }
-
-
- }
-}