private void RemoveAudioTrack_Click(object sender, EventArgs e)\r
{\r
RemoveTrack();\r
+\r
+ if (this.AudioTracks.Count == 0)\r
+ {\r
+ drp_audioMix.Enabled =\r
+ drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;\r
+ }\r
}\r
\r
#endregion\r
/// Gets or sets TaskCount.\r
/// </summary>\r
public int TaskCount { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets ElapsedTime.\r
+ /// </summary>\r
+ public TimeSpan ElapsedTime { get; set; }\r
}\r
}\r
/// </summary>\r
public Win7()\r
{\r
- if (IsWindowsSeven)\r
+ if (this.IsWindowsSeven)\r
{\r
- windowsTaskbar = TaskbarManager.Instance;\r
+ this.windowsTaskbar = TaskbarManager.Instance;\r
+ this.windowsTaskbar.ApplicationId = "HandBrake";\r
}\r
}\r
\r
{\r
get\r
{\r
- OperatingSystem os = Environment.OSVersion;\r
- return os.Version.Major >= 6 && os.Version.Minor >= 1;\r
+ return TaskbarManager.IsPlatformSupported;\r
}\r
}\r
\r
/// </param>\r
public void SetTaskBarProgress(int percentage)\r
{\r
- if (!IsWindowsSeven)\r
+ if (!this.IsWindowsSeven)\r
{\r
return;\r
}\r
- windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal);\r
- windowsTaskbar.SetProgressValue(percentage, 100);\r
+\r
+ this.windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal);\r
+ this.windowsTaskbar.SetProgressValue(percentage, 100);\r
}\r
\r
/// <summary>\r
/// </summary>\r
public void SetTaskBarProgressToNoProgress()\r
{\r
- if (!IsWindowsSeven)\r
+ if (!this.IsWindowsSeven)\r
{\r
return;\r
}\r
\r
- windowsTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress);\r
+ this.windowsTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress);\r
}\r
}\r
}
\ No newline at end of file
{\r
#region Private Variables\r
\r
- /// <summary>\r
- /// The User Setting Service\r
- /// </summary>\r
- private IUserSettingService userSettingService = new UserSettingService();\r
-\r
/// <summary>\r
/// The Log Buffer\r
/// </summary>\r
/// </summary>\r
StringBuilder header = GeneralUtilities.CreateCliLogHeader(null);\r
\r
+ /// <summary>\r
+ /// The Start time of the current Encode;\r
+ /// </summary>\r
+ private DateTime startTime;\r
+\r
#endregion\r
\r
/// <summary>\r
\r
#region Properties\r
\r
- /// <summary>\r
- /// Gets or sets The HB Process\r
- /// </summary>\r
- protected Process HbProcess { get; set; }\r
-\r
/// <summary>\r
/// Gets a value indicating whether IsEncoding.\r
/// </summary>\r
public string ActivityLog\r
{\r
get\r
- { \r
+ {\r
return string.IsNullOrEmpty(this.logBuffer.ToString()) ? header + "No log data available..." : header + this.logBuffer.ToString();\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets The HB Process\r
+ /// </summary>\r
+ protected Process HbProcess { get; set; }\r
+\r
#endregion\r
\r
#region Public Methods\r
\r
this.HbProcess.Start();\r
\r
+ this.startTime = DateTime.Now;\r
+\r
if (enableLogging)\r
{\r
this.HbProcess.ErrorDataReceived += HbProcErrorDataReceived;\r
EstimatedTimeLeft = Converters.EncodeToTimespan(timeRemaining),\r
PercentComplete = percentComplete,\r
Task = currentTask,\r
- TaskCount = taskCount\r
+ TaskCount = taskCount,\r
+ ElapsedTime = DateTime.Now - this.startTime,\r
};\r
\r
if (this.EncodeStatusChanged != null)\r
+ {\r
this.EncodeStatusChanged(this, eventArgs);\r
+ }\r
\r
- if (windowsSeven.IsWindowsSeven)\r
+ if (this.windowsSeven.IsWindowsSeven)\r
{\r
int percent;\r
int.TryParse(Math.Round(percentComplete).ToString(), out percent);\r
\r
- windowsSeven.SetTaskBarProgress(percent);\r
+ this.windowsSeven.SetTaskBarProgress(percent);\r
}\r
}\r
\r
using System.IO;\r
using System.Linq;\r
using System.Text.RegularExpressions;\r
+ using System.Windows;\r
using System.Xml.Serialization;\r
\r
using HandBrake.ApplicationServices.Model;\r
Description = string.Empty, // Maybe one day we will populate this.\r
IsBuildIn = true\r
};\r
+\r
this.presets.Add(newPreset);\r
}\r
}\r
/// </param>\r
private static void RecoverFromCorruptedPresetFile(string file)\r
{\r
- // Recover from Error.\r
- if (File.Exists(file))\r
+ try\r
{\r
- string disabledFile = file + ".old";\r
- File.Move(file, disabledFile);\r
+ // Recover from Error.\r
if (File.Exists(file))\r
{\r
- File.Delete(file);\r
+ string disabledFile = file + ".old";\r
+ File.Move(file, disabledFile);\r
+ if (File.Exists(file))\r
+ {\r
+ File.Delete(file);\r
+ }\r
}\r
+ } \r
+ catch(IOException)\r
+ {\r
+ // Give up\r
}\r
}\r
\r
// First clear the Presets arraylists\r
this.presets.Clear();\r
\r
- // Load in the users Presets from UserPresets.xml\r
+ // Load in the Presets from Presets.xml\r
try\r
{\r
if (File.Exists(this.builtInPresetFile))\r
{\r
// Growl\r
if (Properties.Settings.Default.GrowlQueue)\r
+ {\r
GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");\r
+ }\r
\r
// Do something whent he encode ends.\r
switch (Properties.Settings.Default.WhenCompleteAction)\r
// \r
// DVD_Open\r
// \r
- this.DVD_Open.Description = "Select the \"VIDEO_TS\" folder from your DVD Drive.";\r
+ this.DVD_Open.Description = "Select a VIDEO_TS folder or a folder which contains a collection of video files.";\r
// \r
// File_Open\r
// \r
return;\r
}\r
\r
+\r
lbl_encode.Text =\r
string.Format(\r
- "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Encode(s) Pending {4}",\r
+ "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}",\r
e.PercentComplete,\r
e.CurrentFrameRate,\r
e.AverageFrameRate,\r
e.EstimatedTimeLeft,\r
+ e.ElapsedTime,\r
this.queueProcessor.QueueManager.Count);\r
\r
ProgressBarStatus.Value = (int)Math.Round(e.PercentComplete);\r
this.lbl_encodesPending.Name = "lbl_encodesPending";\r
this.lbl_encodesPending.Size = new System.Drawing.Size(115, 17);\r
this.lbl_encodesPending.Text = "0 encode(s) pending";\r
+ this.lbl_encodesPending.ToolTipText = "- Displays the number of jobs remaining to process.\r\n- Displays the time for the " +\r
+ "current processing session. \r\n (Note, this is reset every time you press encode" +\r
+ ", including after a pause)";\r
// \r
// OpenFile\r
// \r
\r
private readonly IUserSettingService userSettingService = new UserSettingService();\r
\r
+ private DateTime startTime;\r
+ \r
/// <summary>\r
/// Initializes a new instance of the <see cref="frmQueue"/> class.\r
/// </summary>\r
\r
lbl_encodeStatus.Text =\r
string.Format(\r
- "Encoding: Pass {0} of {1}, {2:00.00}% Time Remaining: {3}",\r
+ "Encoding: Pass {0} of {1}, {2:00.00}%, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}",\r
e.Task,\r
e.TaskCount,\r
e.PercentComplete,\r
- e.EstimatedTimeLeft);\r
+ e.EstimatedTimeLeft,\r
+ e.ElapsedTime);\r
+\r
+ UpdateStatusLabel();\r
}\r
\r
/// <summary>\r
if (!queue.IsProcessing)\r
{\r
SetUiEncodeStarted();\r
+ startTime = DateTime.Now;\r
}\r
\r
lbl_encodeStatus.Text = "Encoding ...";\r
private void BtnPauseClick(object sender, EventArgs e)\r
{\r
queue.Pause();\r
+ \r
MessageBox.Show(\r
"No further items on the queue will start. The current encode process will continue until it is finished. \nClick 'Encode' when you wish to continue encoding the queue.",\r
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
lbl_dest.Text = "-";\r
lbl_encodeOptions.Text = "-";\r
\r
- lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending";\r
+ UpdateStatusLabel();\r
}\r
\r
/// <summary>\r
item.SubItems.Add(chapters); // Chapters\r
item.SubItems.Add(queueItem.Source); // Source\r
item.SubItems.Add(queueItem.Destination); // Destination\r
-\r
- switch (parsed.VideoEncoder)\r
- {\r
- case VideoEncoder.FFMpeg:\r
- item.SubItems.Add("MPEG-4 (FFmpeg)");\r
- break;\r
- default:\r
- case VideoEncoder.X264:\r
- item.SubItems.Add("H.264 (x264)");\r
- break;\r
- case VideoEncoder.Theora:\r
- item.SubItems.Add("VP3 (Theroa)");\r
- break;\r
- }\r
-\r
- // Video\r
+ item.SubItems.Add(EnumHelper<VideoEncoder>.GetDescription(parsed.VideoEncoder));\r
\r
// Display The Audio Track Information\r
string audio = string.Empty;\r
}\r
\r
RedrawQueue();\r
- lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending";\r
+ UpdateStatusLabel();\r
+ }\r
+\r
+ private void UpdateStatusLabel()\r
+ {\r
+ if (InvokeRequired)\r
+ {\r
+ BeginInvoke(new UpdateHandler(UpdateStatusLabel));\r
+ return;\r
+ }\r
+ TimeSpan span = DateTime.Now - startTime;\r
+\r
+ if (queue.IsProcessing)\r
+ {\r
+ lbl_encodesPending.Text = string.Format(\r
+ "{0} encodes(s) pending, Time Elasped {1:hh\\:mm\\:ss}", list_queue.Items.Count, span);\r
+ } \r
+ else\r
+ {\r
+ lbl_encodesPending.Text = string.Format(\r
+ "{0} encodes(s) pending", list_queue.Items.Count);\r
+ }\r
}\r
\r
/// <summary>\r