X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmMain.cs;h=a377aca69d4b1006023eb5915052d7409083be78;hb=31e8e90017a38e8b35b8297eb338d6f4f79de6f4;hp=428e3ae2719a24ecd15450e6b1e3b6b795f359ba;hpb=fe7fa3039ef1b85b109f06e08d45a21e33ee0b11;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 428e3ae2..a377aca6 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -22,7 +22,7 @@ namespace Handbrake public partial class frmMain : Form { // Objects which may be used by one or more other objects ************* - QueueHandler encodeQueue = new QueueHandler(); + EncodeAndQueueHandler encodeQueue = new EncodeAndQueueHandler(); PresetsHandler presetHandler = new PresetsHandler(); QueryGenerator queryGen = new QueryGenerator(); @@ -31,8 +31,13 @@ namespace Handbrake private DVD thisDVD; private frmQueue queueWindow; private frmPreview qtpreview; + private frmActivityWindow ActivityWindow; private Form splash; public string sourcePath; + private string lastAction; + private SourceType selectedSourceType; + private string dvdDrivePath; + private string dvdDriveLabel; // Delegates ********************************************************** private delegate void UpdateWindowHandler(); @@ -86,12 +91,12 @@ namespace Handbrake tabs_panel.TabPages.RemoveAt(7); // Remove the query editor tab if the user does not want it enabled. // Load the user's default settings or Normal Preset - if (Properties.Settings.Default.defaultSettings && Properties.Settings.Default.defaultPreset != "") + if (Properties.Settings.Default.defaultPreset != "") { - if (presetHandler.getPreset(Properties.Settings.Default.defaultPreset) != null) + if (presetHandler.GetPreset(Properties.Settings.Default.defaultPreset) != null) { - string query = presetHandler.getPreset(Properties.Settings.Default.defaultPreset).Query; - Boolean loadPictureSettings = presetHandler.getPreset(Properties.Settings.Default.defaultPreset).PictureSettings; + string query = presetHandler.GetPreset(Properties.Settings.Default.defaultPreset).Query; + Boolean loadPictureSettings = presetHandler.GetPreset(Properties.Settings.Default.defaultPreset).PictureSettings; if (query != null) { @@ -117,6 +122,9 @@ namespace Handbrake if (Properties.Settings.Default.tooltipEnable) ToolTip.Active = true; + // Register with Growl (if not using Growl for the encoding completion action, this wont hurt anything) + GrowlCommunicator.Register(); + //Finished Loading lblStatus.Text = "Loading Complete!"; Application.DoEvents(); @@ -152,19 +160,19 @@ namespace Handbrake catch (Exception ex) { if ((bool)result.AsyncState) - MessageBox.Show("Unable to check for updates, Please try again later. \n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Unable to check for updates, Please try again later.\n\nDetailed Error Information:\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } // Startup Functions private void queueRecovery() { - if (Main.check_queue_recovery()) + if (Main.checkQueueRecovery()) { DialogResult result = MessageBox.Show("HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?", "Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) - encodeQueue.recoverQueue("hb_queue_recovery.xml"); // Start Recovery + encodeQueue.LoadQueueFromFile("hb_queue_recovery.xml"); // Start Recovery else { // Remove the Queue recovery file if the user doesn't want to recovery the last queue. @@ -176,21 +184,36 @@ namespace Handbrake } #endregion + #region Properties + public string SourceName + { + get + { + if (this.selectedSourceType == SourceType.DvdDrive) + { + return this.dvdDriveLabel; + } + + return Path.GetFileNameWithoutExtension(this.sourcePath); + } + } + #endregion + #region Events // Encoding Events for setting up the GUI private void events() { // Handle Widget changes when preset is selected. - registerPresetEventHandler(); + RegisterPresetEventHandler(); // Handle Window Resize if (Properties.Settings.Default.MainWindowMinimize) this.Resize += new EventHandler(frmMain_Resize); // Handle Encode Start / Finish / Pause - encodeQueue.OnEncodeEnded += new EventHandler(encodeEnded); - encodeQueue.OnPaused += new EventHandler(encodePaused); - encodeQueue.OnEncodeStart += new EventHandler(encodeStarted); + encodeQueue.CurrentJobCompleted += new EventHandler(encodeEnded); + encodeQueue.QueuePauseRequested += new EventHandler(encodePaused); + encodeQueue.NewJobStarted += new EventHandler(encodeStarted); // Handle a file being draged onto the GUI. this.DragEnter += new DragEventHandler(frmMain_DragEnter); @@ -198,7 +221,7 @@ namespace Handbrake } // Change the preset label to custom when a user changes a setting. Don't want to give the impression that users can change settings and still be using a preset - public void registerPresetEventHandler() + private void RegisterPresetEventHandler() { // Output Settings drop_format.SelectedIndexChanged += new EventHandler(changePresetLabel); @@ -207,7 +230,7 @@ namespace Handbrake check_optimiseMP4.CheckedChanged += new EventHandler(changePresetLabel); // Picture Settings - PictureSettings.PictureSettingsChanged += new EventHandler(changePresetLabel); + //PictureSettings.PictureSettingsChanged += new EventHandler(changePresetLabel); // Filter Settings Filters.FilterSettingsChanged += new EventHandler(changePresetLabel); @@ -226,7 +249,7 @@ namespace Handbrake // Advanced Tab x264Panel.rtf_x264Query.TextChanged += new EventHandler(changePresetLabel); } - public void unRegisterPresetEventHandler() + private void UnRegisterPresetEventHandler() { // Output Settings drop_format.SelectedIndexChanged -= new EventHandler(changePresetLabel); @@ -235,7 +258,7 @@ namespace Handbrake check_optimiseMP4.CheckedChanged -= new EventHandler(changePresetLabel); // Picture Settings - PictureSettings.PictureSettingsChanged -= new EventHandler(changePresetLabel); + //PictureSettings.PictureSettingsChanged -= new EventHandler(changePresetLabel); // Filter Settings Filters.FilterSettingsChanged -= new EventHandler(changePresetLabel); @@ -274,17 +297,14 @@ namespace Handbrake if (fileList[0].StartsWith("\\")) { MessageBox.Show( - "Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", + "Sorry, HandBrake does not support UNC file paths. \nTry mounting the network share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); UpdateSourceLabel(); } else { if (fileList[0] != "") - { - setupGUIforScan(fileList[0]); startScan(fileList[0]); - } else UpdateSourceLabel(); } @@ -341,7 +361,7 @@ namespace Handbrake } private void mnu_options_Click(object sender, EventArgs e) { - Form options = new frmOptions(); + Form options = new frmOptions(this); options.ShowDialog(); } #endregion @@ -349,7 +369,7 @@ namespace Handbrake #region Presets Menu private void mnu_presetReset_Click(object sender, EventArgs e) { - presetHandler.updateBuiltInPresets(); + presetHandler.UpdateBuiltInPresets(); loadPresetPanel(); if (treeView_presets.Nodes.Count == 0) MessageBox.Show("Unable to load the presets.xml file. Please select \"Update Built-in Presets\" from the Presets Menu. \nMake sure you are running the program in Admin mode if running on Vista. See Windows FAQ for details!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -360,16 +380,20 @@ namespace Handbrake } private void mnu_delete_preset_Click(object sender, EventArgs e) { - presetHandler.removeBuiltInPresets(); + presetHandler.RemoveBuiltInPresets(); loadPresetPanel(); // Reload the preset panel } private void mnu_SelectDefault_Click(object sender, EventArgs e) { loadNormalPreset(); } + private void mnu_importMacPreset_Click(object sender, EventArgs e) + { + importPreset(); + } private void btn_new_preset_Click(object sender, EventArgs e) { - Form preset = new frmAddPreset(this, queryGen.generateTheQuery(this), presetHandler); + Form preset = new frmAddPreset(this, queryGen.GenerateCLIQuery(this, 0, null), presetHandler); preset.ShowDialog(); } #endregion @@ -405,7 +429,7 @@ namespace Handbrake { // Get the information about the new build, if any, and close the window info = Main.EndCheckForUpdates(result); - + if (info.NewVersionAvailable && info.BuildInformation != null) { frmUpdater updateWindow = new frmUpdater(info.BuildInformation); @@ -419,7 +443,7 @@ namespace Handbrake catch (Exception ex) { if ((bool)result.AsyncState) - MessageBox.Show("Unable to check for updates, Please try again later. \n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Unable to check for updates, Please try again later.\n\nDetailed Error Information:\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void mnu_about_Click(object sender, EventArgs e) @@ -441,19 +465,23 @@ namespace Handbrake { treeView_presets.CollapseAll(); } + private void pmnu_import_Click(object sender, EventArgs e) + { + importPreset(); + } private void pmnu_saveChanges_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Do you wish to include picture settings when updating the preset: " + treeView_presets.SelectedNode.Text, "Update Preset", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (result == DialogResult.Yes) - presetHandler.updatePreset(treeView_presets.SelectedNode.Text, QueryGenerator.generateTabbedComponentsQuery(this), true); + presetHandler.Update(treeView_presets.SelectedNode.Text, QueryGenerator.GenerateTabbedComponentsQuery(this), true); else if (result == DialogResult.No) - presetHandler.updatePreset(treeView_presets.SelectedNode.Text, QueryGenerator.generateTabbedComponentsQuery(this), false); + presetHandler.Update(treeView_presets.SelectedNode.Text, QueryGenerator.GenerateTabbedComponentsQuery(this), false); } private void pmnu_delete_click(object sender, EventArgs e) { if (treeView_presets.SelectedNode != null) { - presetHandler.remove(treeView_presets.SelectedNode.Text); + presetHandler.Remove(treeView_presets.SelectedNode.Text); treeView_presets.Nodes.Remove(treeView_presets.SelectedNode); } treeView_presets.Select(); @@ -465,7 +493,7 @@ namespace Handbrake // Now enable the save menu if the selected preset is a user preset if (treeView_presets.SelectedNode != null) - if (presetHandler.checkIfUserPresetExists(treeView_presets.SelectedNode.Text)) + if (presetHandler.CheckIfUserPresetExists(treeView_presets.SelectedNode.Text)) pmnu_saveChanges.Enabled = true; treeView_presets.Select(); @@ -474,7 +502,7 @@ namespace Handbrake // Presets Management private void btn_addPreset_Click(object sender, EventArgs e) { - Form preset = new frmAddPreset(this, QueryGenerator.generateTabbedComponentsQuery(this), presetHandler); + Form preset = new frmAddPreset(this, QueryGenerator.GenerateTabbedComponentsQuery(this), presetHandler); preset.ShowDialog(); } private void btn_removePreset_Click(object sender, EventArgs e) @@ -484,7 +512,7 @@ namespace Handbrake { if (treeView_presets.SelectedNode != null) { - presetHandler.remove(treeView_presets.SelectedNode.Text); + presetHandler.Remove(treeView_presets.SelectedNode.Text); treeView_presets.Nodes.Remove(treeView_presets.SelectedNode); } } @@ -532,7 +560,7 @@ namespace Handbrake if (result == DialogResult.Yes) { if (treeView_presets.SelectedNode != null) - presetHandler.remove(treeView_presets.SelectedNode.Text); + presetHandler.Remove(treeView_presets.SelectedNode.Text); // Remember each nodes expanded status so we can reload it List nodeStatus = new List(); @@ -560,10 +588,10 @@ namespace Handbrake { // Ok, so, we've selected a preset. Now we want to load it. string presetName = treeView_presets.SelectedNode.Text; - if (presetHandler.getPreset(presetName) != null) + if (presetHandler.GetPreset(presetName) != null) { - string query = presetHandler.getPreset(presetName).Query; - Boolean loadPictureSettings = presetHandler.getPreset(presetName).PictureSettings; + string query = presetHandler.GetPreset(presetName).Query; + Boolean loadPictureSettings = presetHandler.GetPreset(presetName).PictureSettings; if (query != null) { @@ -594,19 +622,44 @@ namespace Handbrake } } } + private void importPreset() + { + Import imp = new Import(); + if (openPreset.ShowDialog() == DialogResult.OK) + { + QueryParser parsed = imp.importMacPreset(openPreset.FileName); + if (presetHandler.CheckIfUserPresetExists(parsed.PresetName + " (Imported)")) + { + DialogResult result = MessageBox.Show("This preset appears to already exist. Would you like to overwrite it?", "Overwrite preset?", + MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (result == DialogResult.Yes) + { + PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings); + presetHandler.Update(parsed.PresetName + " (Imported)", queryGen.GenerateCLIQuery(this, 0, null), + parsed.UsesPictureSettings); + } + } + else + { + PresetLoader.presetLoader(this, parsed, parsed.PresetName, parsed.UsesPictureSettings); + presetHandler.Add(parsed.PresetName, queryGen.GenerateCLIQuery(this, 0, null), parsed.UsesPictureSettings); + + if (presetHandler.Add(parsed.PresetName + " (Imported)", queryGen.GenerateCLIQuery(this, 0, null), parsed.UsesPictureSettings)) + { + TreeNode preset_treeview = new TreeNode(parsed.PresetName + " (Imported)") { ForeColor = Color.Black }; + treeView_presets.Nodes.Add(preset_treeview); + } + } + } + } #endregion #region ToolStrip private void btn_source_Click(object sender, EventArgs e) { - if (Properties.Settings.Default.drive_detection) - { - mnu_dvd_drive.Visible = true; - Thread driveInfoThread = new Thread(getDriveInfoThread); - driveInfoThread.Start(); - } - else - mnu_dvd_drive.Visible = false; + mnu_dvd_drive.Visible = true; + Thread driveInfoThread = new Thread(getDriveInfoThread); + driveInfoThread.Start(); } private void btn_start_Click(object sender, EventArgs e) { @@ -617,10 +670,10 @@ namespace Handbrake if (result == DialogResult.Yes) { // Pause The Queue - encodeQueue.pauseEncodeQueue(); + encodeQueue.RequestPause(); // Allow the CLI to exit cleanly - Win32.SetForegroundWindow((int)encodeQueue.encodeHandler.processHandle); + Win32.SetForegroundWindow((int)encodeQueue.processHandle); SendKeys.Send("^C"); // Update the GUI @@ -629,9 +682,44 @@ namespace Handbrake } else { - if (encodeQueue.count() != 0 || (!string.IsNullOrEmpty(sourcePath) && string.IsNullOrEmpty(text_destination.Text))) + if (encodeQueue.Count != 0 || (!string.IsNullOrEmpty(sourcePath) && !string.IsNullOrEmpty(text_destination.Text))) { - String query = rtf_query.Text != "" ? rtf_query.Text : queryGen.generateTheQuery(this); + string generatedQuery = queryGen.GenerateCLIQuery(this, 0, null); + string specifiedQuery = rtf_query.Text != "" ? rtf_query.Text : queryGen.GenerateCLIQuery(this, 0, null); + string query = string.Empty; + + // Check to make sure the generated query matches the GUI settings + if (Properties.Settings.Default.PromptOnUnmatchingQueries && !string.IsNullOrEmpty(specifiedQuery) && generatedQuery != specifiedQuery) + { + DialogResult result = MessageBox.Show("The query under the \"Query Editor\" tab " + + "does not match the current GUI settings. Because the manual query takes " + + "priority over the GUI, your recently updated settings will not be taken " + + "into account when encoding this job." + Environment.NewLine + Environment.NewLine + + "Do you want to replace the manual query with the GUI-generated query?", + "Manual Query does not Match GUI", + MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk, + MessageBoxDefaultButton.Button3); + + switch (result) + { + case DialogResult.Yes: + // Replace the manual query with the generated one + query = generatedQuery; + rtf_query.Text = generatedQuery; + break; + case DialogResult.No: + // Use the manual query + query = specifiedQuery; + break; + case DialogResult.Cancel: + // Don't start the encode + return; + } + } + else + { + query = generatedQuery; + } DialogResult overwrite = DialogResult.Yes; if (text_destination.Text != "") @@ -640,16 +728,20 @@ namespace Handbrake if (overwrite == DialogResult.Yes) { - if (encodeQueue.count() == 0) - encodeQueue.add(query, sourcePath, text_destination.Text); + if (encodeQueue.Count == 0) + encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != "")); queueWindow.setQueue(); - if (encodeQueue.count() > 1) + if (encodeQueue.Count > 1) queueWindow.Show(false); setEncodeStarted(); // Encode is running, so setup the GUI appropriately - encodeQueue.startEncode(); // Start The Queue Encoding Process + encodeQueue.StartEncodeQueue(); // Start The Queue Encoding Process lastAction = "encode"; // Set the last action to encode - Used for activity window. + + if (ActivityWindow != null) + ActivityWindow.SetLogView(false); + } this.Focus(); } @@ -663,20 +755,22 @@ namespace Handbrake MessageBox.Show("No source or destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); else { - String query = queryGen.generateTheQuery(this); + String query = queryGen.GenerateCLIQuery(this, 0, null); if (rtf_query.Text != "") query = rtf_query.Text; - if (encodeQueue.checkDestinationPath(text_destination.Text)) + if (encodeQueue.CheckForDestinationDuplicate(text_destination.Text)) { DialogResult result = MessageBox.Show("There is already a queue item for this destination path. \n\n If you continue, the encode will be overwritten. Do you wish to continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) - encodeQueue.add(query, sourcePath, text_destination.Text); + encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != "")); } else - encodeQueue.add(query, sourcePath, text_destination.Text); + encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != "")); + + lbl_encode.Text = encodeQueue.Count + " encode(s) pending in the queue"; queueWindow.Show(); } @@ -684,6 +778,7 @@ namespace Handbrake private void btn_showQueue_Click(object sender, EventArgs e) { queueWindow.Show(); + queueWindow.Activate(); } private void tb_preview_Click(object sender, EventArgs e) { @@ -708,8 +803,11 @@ namespace Handbrake private void btn_ActivityWindow_Click(object sender, EventArgs e) { String file = lastAction == "scan" ? "last_scan_log.txt" : "last_encode_log.txt"; + if (ActivityWindow == null) + ActivityWindow = new frmActivityWindow(file, encodeQueue, this); + + ActivityWindow.SetLogView(!encodeQueue.isEncoding); - frmActivityWindow ActivityWindow = new frmActivityWindow(file, encodeQueue, this); ActivityWindow.Show(); } #endregion @@ -746,92 +844,53 @@ namespace Handbrake //Source private void btn_dvd_source_Click(object sender, EventArgs e) { - // Enable the creation of chapter markers. - Check_ChapterMarkers.Enabled = true; - - // Set the last action to scan. - // This is used for tracking which file to load in the activity window - lastAction = "scan"; - sourcePath = string.Empty; - if (DVD_Open.ShowDialog() == DialogResult.OK) { - String filename = DVD_Open.SelectedPath; - - if (filename.StartsWith("\\")) - { - MessageBox.Show( - "Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", - "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - UpdateSourceLabel(); - } - else - { - if (filename != "") - { - sourcePath = Path.GetFullPath(filename); - setupGUIforScan(filename); - startScan(filename); - } else - UpdateSourceLabel(); - } + this.selectedSourceType = SourceType.Folder; + selectSource(DVD_Open.SelectedPath); } else UpdateSourceLabel(); } private void btn_file_source_Click(object sender, EventArgs e) { - // Set the last action to scan. - // This is used for tracking which file to load in the activity window - lastAction = "scan"; - sourcePath = string.Empty; - if (ISO_Open.ShowDialog() == DialogResult.OK) { - String filename = ISO_Open.FileName; - if (filename.StartsWith("\\")) - MessageBox.Show( - "Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", - "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - else - { - if (filename != "") - { - sourcePath = Path.GetFileName(filename); - setupGUIforScan(filename); - startScan(filename); - } else - UpdateSourceLabel(); - } + this.selectedSourceType = SourceType.VideoFile; + selectSource(ISO_Open.FileName); } - UpdateSourceLabel(); + else + UpdateSourceLabel(); } private void mnu_dvd_drive_Click(object sender, EventArgs e) { - // Enable the creation of chapter markers. + if (this.dvdDrivePath == null) return; + this.selectedSourceType = SourceType.DvdDrive; + selectSource(this.dvdDrivePath); + } + private void selectSource(string file) + { Check_ChapterMarkers.Enabled = true; - - // Set the last action to scan. - // This is used for tracking which file to load in the activity window lastAction = "scan"; sourcePath = string.Empty; - if (mnu_dvd_drive.Text.Contains("VIDEO_TS")) + if (file == string.Empty) // Must have a file or path { - string[] path = mnu_dvd_drive.Text.Split(' '); - String filename = path[0]; - sourcePath = Path.GetFullPath(filename); - setupGUIforScan(filename); - startScan(filename); + UpdateSourceLabel(); + return; } - // If there are no titles in the dropdown menu then the scan has obviously failed. Display an error message explaining to the user. - if (drp_dvdtitle.Items.Count == 0) - MessageBox.Show("No Title(s) found. Please make sure you have selected a valid, non-copy protected source.\nYour Source may be copy protected, badly mastered or a format which HandBrake does not support. \nPlease refer to the Documentation and FAQ (see Help Menu).", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); - - UpdateSourceLabel(); + if (file.StartsWith("\\")) // NO UNC Paths + { + MessageBox.Show( + "Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", + "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + UpdateSourceLabel(); + return; + } - lbl_encode.Text = ""; + sourcePath = Path.GetFileName(file); + startScan(file); } private void drp_dvdtitle_Click(object sender, EventArgs e) { @@ -840,10 +899,9 @@ namespace Handbrake } private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e) { - unRegisterPresetEventHandler(); - // Reset some values on the form - PictureSettings.lbl_Aspect.Text = "Select a Title"; - //lbl_RecomendedCrop.Text = "Select a Title"; + UnRegisterPresetEventHandler(); + + PictureSettings.lbl_Aspect.Text = "Select a Title"; // Reset some values on the form drop_chapterStart.Items.Clear(); drop_chapterFinish.Items.Clear(); @@ -884,23 +942,25 @@ namespace Handbrake drop_chapterFinish.Text = drop_chapterFinish.Items[drop_chapterFinish.Items.Count - 1].ToString(); // Populate the Audio Channels Dropdown - AudioSettings.setTrackList(selectedTitle); + AudioSettings.SetTrackList(selectedTitle); // Populate the Subtitles dropdown Subtitles.drp_subtitleTracks.Items.Clear(); Subtitles.drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)"); Subtitles.drp_subtitleTracks.Items.AddRange(selectedTitle.Subtitles.ToArray()); Subtitles.drp_subtitleTracks.SelectedIndex = 0; + Subtitles.Clear(); + Subtitles.setSubtitleTrackAuto(); } // Run the autoName & chapterNaming functions if (Properties.Settings.Default.autoNaming) { - string autoPath = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, sourcePath, text_destination.Text, drop_format.SelectedIndex); + string autoPath = Main.autoName(this); if (autoPath != null) text_destination.Text = autoPath; else - MessageBox.Show("You currently have automatic file naming enabled for the destination box, but you do not have a default direcotry set. You should set this in the program options (see Tools Menu)", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBox.Show("You currently have \"Automatically name output files\" enabled for the destination file box, but you do not have a default directory set.\n\nYou should set a \"Default Path\" in HandBrakes preferences. (See 'Tools' menu -> 'Options' -> 'General' Tab -> 'Default Path')", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } data_chpt.Rows.Clear(); @@ -920,88 +980,75 @@ namespace Handbrake data_chpt.Columns[0].Width = 166; data_chpt.Columns[0].Width = 165; - registerPresetEventHandler(); + RegisterPresetEventHandler(); } - private void drop_chapterStart_SelectedIndexChanged(object sender, EventArgs e) + private void chapersChanged(object sender, EventArgs e) { - int c_start, c_end; - - if (drop_chapterFinish.Text == "Auto" && drop_chapterFinish.Items.Count != 0) - drop_chapterFinish.SelectedIndex = drop_chapterFinish.Items.Count - 1; + Control ctl = (Control)sender; + int chapterStart, chapterEnd; + int.TryParse(drop_chapterStart.Text, out chapterStart); + int.TryParse(drop_chapterFinish.Text, out chapterEnd); - int.TryParse(drop_chapterStart.Text, out c_start); - int.TryParse(drop_chapterFinish.Text, out c_end); - - if (c_end != 0) + switch (ctl.Name) { - if (c_start > c_end) - drop_chapterFinish.Text = c_start.ToString(); - } + case "drop_chapterStart": + if (drop_chapterFinish.SelectedIndex == -1 && drop_chapterFinish.Items.Count != 0) + drop_chapterFinish.SelectedIndex = drop_chapterFinish.Items.Count - 1; - lbl_duration.Text = Main.calculateDuration(drop_chapterStart.Text, drop_chapterFinish.Text, selectedTitle).ToString(); - - // Run the Autonaming function - if (Properties.Settings.Default.autoNaming) - text_destination.Text = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, sourcePath, text_destination.Text, drop_format.SelectedIndex); - - // Disable chapter markers if only 1 chapter is selected. - if (c_start == c_end) - { - Check_ChapterMarkers.Checked = false; - Check_ChapterMarkers.Enabled = false; - } - else - Check_ChapterMarkers.Enabled = true; - } - private void drop_chapterFinish_SelectedIndexChanged(object sender, EventArgs e) - { - int c_start, c_end; + if (chapterEnd != 0) + if (chapterStart > chapterEnd) + drop_chapterFinish.Text = chapterStart.ToString(); + break; + case "drop_chapterFinish": + if (drop_chapterStart.Items.Count >= 1 && drop_chapterStart.SelectedIndex == -1) + drop_chapterStart.SelectedIndex = 0; - if (drop_chapterStart.Text == "Auto" && drop_chapterStart.Items.Count >= 1) - drop_chapterStart.SelectedIndex = 1; + if (chapterStart != 0) + if (chapterEnd < chapterStart) + drop_chapterFinish.Text = chapterStart.ToString(); - int.TryParse(drop_chapterStart.Text, out c_start); - int.TryParse(drop_chapterFinish.Text, out c_end); + // Add more rows to the Chapter menu if needed. + if (Check_ChapterMarkers.Checked) + { + int i = data_chpt.Rows.Count, finish = 0; + int.TryParse(drop_chapterFinish.Text, out finish); - if (c_start != 0) - { - if (c_end < c_start) - drop_chapterFinish.Text = c_start.ToString(); + while (i < finish) + { + int n = data_chpt.Rows.Add(); + data_chpt.Rows[n].Cells[0].Value = (i + 1); + data_chpt.Rows[n].Cells[1].Value = "Chapter " + (i + 1); + data_chpt.Rows[n].Cells[0].ValueType = typeof(int); + data_chpt.Rows[n].Cells[1].ValueType = typeof(string); + i++; + } + } + break; } - lbl_duration.Text = Main.calculateDuration(drop_chapterStart.Text, drop_chapterFinish.Text, selectedTitle).ToString(); + // Update the Duration + lbl_duration.Text = Main.calculateDuration(drop_chapterStart.SelectedIndex, drop_chapterFinish.SelectedIndex, selectedTitle).ToString(); // Run the Autonaming function if (Properties.Settings.Default.autoNaming) - text_destination.Text = Main.autoName(drp_dvdtitle, drop_chapterStart.Text, drop_chapterFinish.Text, sourcePath, text_destination.Text, drop_format.SelectedIndex); - - // Add more rows to the Chapter menu if needed. - if (Check_ChapterMarkers.Checked) - { - int i = data_chpt.Rows.Count, finish = 0; - - if (drop_chapterFinish.Text != "Auto") - int.TryParse(drop_chapterFinish.Text, out finish); - - while (i < finish) - { - int n = data_chpt.Rows.Add(); - data_chpt.Rows[n].Cells[0].Value = (i + 1); - data_chpt.Rows[n].Cells[1].Value = "Chapter " + (i + 1); - data_chpt.Rows[n].Cells[0].ValueType = typeof(int); - data_chpt.Rows[n].Cells[1].ValueType = typeof(string); - i++; - } - } + text_destination.Text = Main.autoName(this); // Disable chapter markers if only 1 chapter is selected. - if (c_start == c_end) + if (chapterStart == chapterEnd) { - Check_ChapterMarkers.Checked = false; Check_ChapterMarkers.Enabled = false; + btn_importChapters.Enabled = false; + data_chpt.Enabled = false; } else + { Check_ChapterMarkers.Enabled = true; + if (Check_ChapterMarkers.Checked) + { + btn_importChapters.Enabled = true; + data_chpt.Enabled = true; + } + } } //Destination @@ -1032,13 +1079,13 @@ namespace Handbrake case 1: if (!Path.GetExtension(DVD_Save.FileName).Equals(".mp4", StringComparison.InvariantCultureIgnoreCase)) if (Properties.Settings.Default.useM4v) - DVD_Save.FileName += ".m4v"; + DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".m4v").Replace(".mkv", ".m4v"); else - DVD_Save.FileName += ".mp4"; + DVD_Save.FileName = DVD_Save.FileName.Replace(".m4v", ".mp4").Replace(".mkv", ".mp4"); break; case 2: if (!Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase)) - DVD_Save.FileName += ".mkv"; + DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".mkv").Replace(".m4v", ".mkv"); break; default: //do nothing @@ -1048,7 +1095,7 @@ namespace Handbrake // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing) if (Check_ChapterMarkers.Checked && DVD_Save.FilterIndex != 2) - setExtension(".m4v"); + SetExtension(".m4v"); } } } @@ -1067,20 +1114,20 @@ namespace Handbrake switch (drop_format.SelectedIndex) { case 0: - if (Properties.Settings.Default.useM4v) - setExtension(".m4v"); + if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() || Subtitles.RequiresM4V()) + SetExtension(".m4v"); else - setExtension(".mp4"); + SetExtension(".mp4"); break; case 1: - setExtension(".mkv"); + SetExtension(".mkv"); break; } - AudioSettings.setAudioByContainer(drop_format.Text); + AudioSettings.SetContainer(drop_format.Text); Subtitles.setContainer(drop_format.SelectedIndex); - if ((drop_format.Text.Contains("MP4")) || (drop_format.Text.Contains("M4V"))) + if (drop_format.Text.Contains("MP4")) { if (drp_videoEncoder.Items.Contains("VP3 (Theora)")) { @@ -1091,11 +1138,16 @@ namespace Handbrake else if (drop_format.Text.Contains("MKV")) drp_videoEncoder.Items.Add("VP3 (Theora)"); } - private void setExtension(string newExtension) + public void SetExtension(string newExtension) { - text_destination.Text = text_destination.Text.Replace(".mp4", newExtension); - text_destination.Text = text_destination.Text.Replace(".m4v", newExtension); - text_destination.Text = text_destination.Text.Replace(".mkv", newExtension); + if (newExtension == ".mp4" || newExtension == ".m4v") + if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() || Subtitles.RequiresM4V()) + newExtension = ".m4v"; + else + newExtension = ".mp4"; + + if (Path.HasExtension(newExtension)) + text_destination.Text = Path.ChangeExtension(text_destination.Text, newExtension); } //Video Tab @@ -1139,21 +1191,22 @@ namespace Handbrake slider_videoQuality.TickFrequency = 1; CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US"); - double multiplier = 1.0 / Properties.Settings.Default.x264cqstep; + double cqStep = Properties.Settings.Default.x264cqstep; + double multiplier = 1.0 / cqStep; double value = slider_videoQuality.Value * multiplier; switch (Properties.Settings.Default.x264cqstep.ToString(culture)) { - case "0.20": + case "0.2": slider_videoQuality.Maximum = 255; break; case "0.25": slider_videoQuality.Maximum = 204; break; - case "0.50": - slider_videoQuality.Maximum = 40; + case "0.5": + slider_videoQuality.Maximum = 102; break; - case "1.0": + case "1": slider_videoQuality.Maximum = 51; break; default: @@ -1193,8 +1246,54 @@ namespace Handbrake check_iPodAtom.Checked = false; } } + private double _cachedCqStep = Properties.Settings.Default.x264cqstep; + /// + /// Update the CQ slider for x264 for a new CQ step. This is set from option + /// + public void setQualityFromSlider() + { + // Work out the current RF value. + double cqStep = _cachedCqStep; + double rfValue = 51.0 - slider_videoQuality.Value * cqStep; + + // Change the maximum value for the slider + switch (Properties.Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"))) + { + case "0.2": + slider_videoQuality.Maximum = 255; + break; + case "0.25": + slider_videoQuality.Maximum = 204; + break; + case "0.5": + slider_videoQuality.Maximum = 102; + break; + case "1": + slider_videoQuality.Maximum = 51; + break; + default: + slider_videoQuality.Maximum = 51; + break; + } + + // Reset the CQ slider to RF0 + slider_videoQuality.Value = slider_videoQuality.Maximum; + + // Reset the CQ slider back to the previous value as close as possible + double cqStepNew = Properties.Settings.Default.x264cqstep; + double rfValueCurrent = 51.0 - slider_videoQuality.Value * cqStepNew; + while (rfValueCurrent < rfValue) + { + slider_videoQuality.Value--; + rfValueCurrent = 51.0 - slider_videoQuality.Value * cqStepNew; + } + + // Cache the CQ step for the next calculation + _cachedCqStep = Properties.Settings.Default.x264cqstep; + } private void slider_videoQuality_Scroll(object sender, EventArgs e) { + double cqStep = Properties.Settings.Default.x264cqstep; switch (drp_videoEncoder.Text) { case "MPEG-4 (FFmpeg)": @@ -1202,20 +1301,20 @@ namespace Handbrake double max = slider_videoQuality.Maximum; double min = slider_videoQuality.Minimum; double val = ((max - min) - (rfValue - min)) / (max - min); - SliderValue.Text = Math.Round((val * 100), 2) + "% QP:" + (32 - slider_videoQuality.Value); + SliderValue.Text = Math.Round((val * 100), 2).ToString(new CultureInfo("en-US")) + "% QP:" + (32 - slider_videoQuality.Value); break; case "H.264 (x264)": - rfValue = 51.0 - slider_videoQuality.Value * Properties.Settings.Default.x264cqstep; - max = slider_videoQuality.Maximum * Properties.Settings.Default.x264cqstep; + rfValue = 51.0 - slider_videoQuality.Value * cqStep; + max = slider_videoQuality.Maximum * cqStep; min = slider_videoQuality.Minimum; val = ((max - min) - (rfValue - min)) / (max - min); rfValue = Math.Round(rfValue, 2); - SliderValue.Text = Math.Round((val * 100), 2) + "% RF:" + rfValue; + SliderValue.Text = Math.Round((val * 100), 2).ToString(new CultureInfo("en-US")) + "% RF:" + rfValue.ToString(new CultureInfo("en-US")); break; case "VP3 (Theora)": rfValue = slider_videoQuality.Value; double value = rfValue / 63; - SliderValue.Text = Math.Round((value * 100), 2) + "% QP:" + slider_videoQuality.Value; + SliderValue.Text = Math.Round((value * 100), 2).ToString(new CultureInfo("en-US")) + "% QP:" + slider_videoQuality.Value; break; } } @@ -1264,26 +1363,42 @@ namespace Handbrake if (Check_ChapterMarkers.Checked) { if (drop_format.SelectedIndex != 1) - setExtension(".m4v"); - data_chpt.Rows.Clear(); + SetExtension(".m4v"); data_chpt.Enabled = true; - DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text); - if (chapterGridView != null) - data_chpt = chapterGridView; + btn_importChapters.Enabled = true; } else { if (drop_format.SelectedIndex != 1 && !Properties.Settings.Default.useM4v) - setExtension(".mp4"); - data_chpt.Rows.Clear(); + SetExtension(".mp4"); data_chpt.Enabled = false; + btn_importChapters.Enabled = false; + } + } + private void btn_importChapters_Click(object sender, EventArgs e) + { + if (File_ChapterImport.ShowDialog() == DialogResult.OK) + { + String filename = File_ChapterImport.FileName; + DataGridView imported = Main.importChapterNames(data_chpt, filename); + if (imported != null) + data_chpt = imported; + } + } + private void mnu_resetChapters_Click(object sender, EventArgs e) + { + data_chpt.Rows.Clear(); + DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text); + if (chapterGridView != null) + { + data_chpt = chapterGridView; } } // Query Editor Tab private void btn_generate_Query_Click(object sender, EventArgs e) { - rtf_query.Text = queryGen.generateTheQuery(this); + rtf_query.Text = queryGen.GenerateCLIQuery(this, 0, null); } private void btn_clear_Click(object sender, EventArgs e) { @@ -1296,32 +1411,30 @@ namespace Handbrake #region Source Scan public Boolean isScanning { get; set; } private static int scanProcessID { get; set; } - private void setupGUIforScan(String filename) + private void startScan(String filename) { + // Setup the GUI components for the scan. sourcePath = filename; foreach (Control ctrl in Controls) - { if (!(ctrl is StatusStrip || ctrl is MenuStrip || ctrl is ToolStrip)) ctrl.Enabled = false; - } + lbl_encode.Visible = true; lbl_encode.Text = "Scanning ..."; - //gb_source.Text = "Source: Scanning ..."; btn_source.Enabled = false; btn_start.Enabled = false; btn_showQueue.Enabled = false; btn_add2Queue.Enabled = false; tb_preview.Enabled = false; mnu_killCLI.Visible = true; - } - private void startScan(String filename) - { + + // Start hte Scan Thread try { - lbl_encode.Visible = true; - lbl_encode.Text = "Scanning..."; + if (ActivityWindow != null) + ActivityWindow.SetLogView(true); isScanning = true; - ThreadPool.QueueUserWorkItem(scanProcess, filename); + ThreadPool.QueueUserWorkItem(scanProcess); } catch (Exception exc) { @@ -1332,7 +1445,6 @@ namespace Handbrake { try { - string inputFile = (string)state; string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe"); string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; string dvdInfoPath = Path.Combine(logDir, "last_scan_log.txt"); @@ -1344,7 +1456,7 @@ namespace Handbrake String dvdnav = string.Empty; if (Properties.Settings.Default.dvdnav) dvdnav = " --dvdnav"; - string strCmdLine = String.Format(@"cmd /c """"{0}"" -i ""{1}"" -t0 {2} -v >""{3}"" 2>&1""", handbrakeCLIPath, inputFile, dvdnav, dvdInfoPath); + string strCmdLine = String.Format(@"cmd /c """"{0}"" -i ""{1}"" -t0 {2} -v >""{3}"" 2>&1""", handbrakeCLIPath, sourcePath, dvdnav, dvdInfoPath); ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine) { WindowStyle = ProcessWindowStyle.Hidden }; @@ -1361,11 +1473,8 @@ namespace Handbrake if (cleanExit) // If 0 exit code, CLI exited cleanly. { if (!File.Exists(dvdInfoPath)) - { - throw new Exception( - "Unable to retrieve the DVD Info. last_scan_log.txt is missing. \nExpected location of last_scan_log.txt: \n" + - dvdInfoPath); - } + throw new Exception("Unable to retrieve the DVD Info. last_scan_log.txt is missing. \nExpected location of last_scan_log.txt: \n" + + dvdInfoPath); using (StreamReader sr = new StreamReader(dvdInfoPath)) { @@ -1397,16 +1506,13 @@ namespace Handbrake drp_dvdtitle.Items.Clear(); if (thisDVD.Titles.Count != 0) drp_dvdtitle.Items.AddRange(thisDVD.Titles.ToArray()); - drp_dvdtitle.Text = "Automatic"; - drop_chapterFinish.Text = "Auto"; - drop_chapterStart.Text = "Auto"; // Now select the longest title if (thisDVD.Titles.Count != 0) - drp_dvdtitle.SelectedItem = Main.selectLongestTitle(drp_dvdtitle); + drp_dvdtitle.SelectedItem = Main.selectLongestTitle(thisDVD); // Enable the creation of chapter markers if the file is an image of a dvd. - if (sourcePath.ToLower().Contains(".iso") || sourcePath.ToLower().Contains("VIDEO_TS")) + if (sourcePath.ToLower().Contains(".iso") || sourcePath.Contains("VIDEO_TS")) Check_ChapterMarkers.Enabled = true; else { @@ -1419,7 +1525,7 @@ namespace Handbrake if (drp_dvdtitle.Items.Count == 0) { MessageBox.Show( - "No Title(s) found. \n\nYour Source may be copy protected, badly mastered or a format which HandBrake does not support. \nPlease refer to the Documentation and FAQ (see Help Menu).", + "No Title(s) found. \n\nYour Source may be copy protected, badly mastered or in a format which HandBrake does not support. \nPlease refer to the Documentation and FAQ (see Help Menu).", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); sourcePath = string.Empty; } @@ -1441,7 +1547,6 @@ namespace Handbrake if (InvokeRequired) BeginInvoke(new UpdateWindowHandler(enableGUI)); lbl_encode.Text = "Scan Completed"; - //gb_source.Text = "Source"; foreach (Control ctrl in Controls) ctrl.Enabled = true; btn_start.Enabled = true; @@ -1482,26 +1587,21 @@ namespace Handbrake private void resetGUI() { drp_dvdtitle.Items.Clear(); - drp_dvdtitle.Text = "Automatic"; drop_chapterStart.Items.Clear(); - drop_chapterStart.Text = "Auto"; drop_chapterFinish.Items.Clear(); - drop_chapterFinish.Text = "Auto"; lbl_duration.Text = "Select a Title"; PictureSettings.lbl_src_res.Text = "Select a Title"; PictureSettings.lbl_Aspect.Text = "Select a Title"; - sourcePath = "Source"; - text_destination.Text = ""; + sourcePath = String.Empty; + text_destination.Text = String.Empty; thisDVD = null; selectedTitle = null; isScanning = false; } - private void UpdateSourceLabel() { - labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : Path.GetFileName(sourcePath); + labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : this.SourceName; } - #endregion #region GUI @@ -1551,7 +1651,7 @@ namespace Handbrake } lbl_encode.Visible = true; - lbl_encode.Text = "Encoding in Progress"; + lbl_encode.Text = "Encoding with " + encodeQueue.Count + " encode(s) pending"; btn_start.Text = "Stop"; btn_start.ToolTipText = "Stop the encoding process."; btn_start.Image = Properties.Resources.stop; @@ -1564,14 +1664,13 @@ namespace Handbrake #endregion #region DVD Drive Detection - private delegate void ProgressUpdateHandler(); private void getDriveInfoThread() { try { if (InvokeRequired) { - BeginInvoke(new ProgressUpdateHandler(getDriveInfoThread)); + BeginInvoke(new UpdateWindowHandler(getDriveInfoThread)); return; } @@ -1583,7 +1682,9 @@ namespace Handbrake { if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO")) { - mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")"; + this.dvdDrivePath = curDrive.RootDirectory + "VIDEO_TS"; + this.dvdDriveLabel = curDrive.VolumeLabel; + mnu_dvd_drive.Text = this.dvdDrivePath + " (" + this.dvdDriveLabel + ")"; foundDrive = true; break; } @@ -1606,20 +1707,15 @@ namespace Handbrake /// public void loadPresetPanel() { - if (presetHandler.checkIfPresetsAreOutOfDate()) + if (presetHandler.CheckIfPresetsAreOutOfDate()) if (!Properties.Settings.Default.presetNotification) MessageBox.Show(splash, "HandBrake has determined your built-in presets are out of date... These presets will now be updated.", "Preset Update", MessageBoxButtons.OK, MessageBoxIcon.Information); - presetHandler.getPresetPanel(ref treeView_presets); + presetHandler.GetPresetPanel(ref treeView_presets); treeView_presets.Update(); } - - /// - /// Either Encode or Scan was last performed. - /// - public string lastAction { get; set; } #endregion #region Overrides @@ -1630,7 +1726,7 @@ namespace Handbrake protected override void OnFormClosing(FormClosingEventArgs e) { // If currently encoding, the queue isn't paused, and there are queue items to process, prompt to confirm close. - if ((encodeQueue.isEncoding) && (!encodeQueue.isPaused) && (encodeQueue.count() > 0)) + if ((encodeQueue.isEncoding) && (!encodeQueue.PauseRequested) && (encodeQueue.Count > 0)) { DialogResult result = MessageBox.Show("HandBrake has queue items to process. Closing HandBrake will not stop the current encoding, but will stop processing the queue.\n\nDo you want to close HandBrake?", "Close HandBrake?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); @@ -1642,21 +1738,18 @@ namespace Handbrake #endregion #region In-GUI Encode Status (Experimental) - private void encodeMonitorThread() { try { - Parser encode = new Parser(encodeQueue.encodeHandler.hbProcess.StandardOutput.BaseStream); + Parser encode = new Parser(encodeQueue.hbProcess.StandardOutput.BaseStream); encode.OnEncodeProgress += encodeOnEncodeProgress; while (!encode.EndOfStream) - { encode.readEncodeStatus(); - } } catch (Exception exc) { - MessageBox.Show(exc.ToString()); + MessageBox.Show(exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void encodeOnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining) @@ -1671,7 +1764,15 @@ namespace Handbrake } #endregion - + #region enum + private enum SourceType + { + None = 0, + Folder, + DvdDrive, + VideoFile + } + #endregion // This is the END of the road **************************************** } } \ No newline at end of file