/// <summary> /// The queue processor_ queue completed. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The EventArgs. /// </param> private void QueueProcessorQueueCompleted(object sender, System.EventArgs e) { // Growl if (userSettingService.GetUserSetting <bool>(UserSettingConstants.GrowlQueue)) { GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done."); } }
/// <summary> /// The encode service_ encode completed. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The EncodeCompletedEventArgs. /// </param> private void EncodeServiceEncodeCompleted(object sender, HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs e) { // Growl if (userSettingService.GetUserSetting <bool>(UserSettingConstants.GrowlEncode)) { GrowlCommunicator.Notify( "Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done."); } }
/// <summary> /// After an encode is complete, move onto the next job. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The EncodeCompletedEventArgs. /// </param> private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e) { this.QueueManager.LastProcessedJob.Status = QueueItemStatus.Completed; // Clear the completed item of the queue if the setting is set. if (userSettingService.GetUserSetting <bool>(ASUserSettingConstants.ClearCompletedFromQueue)) { this.QueueManager.ClearCompleted(); } // Growl if (userSettingService.GetUserSetting <bool>(ASUserSettingConstants.GrowlEncode)) { GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done."); } if (!e.Successful) { this.QueueManager.LastProcessedJob.Status = QueueItemStatus.Error; this.Pause(); } // Handling Log Data this.EncodeService.ProcessLogs(this.QueueManager.LastProcessedJob.Task.Destination); // Post-Processing if (e.Successful) { SendToApplication(this.QueueManager.LastProcessedJob.Task.Destination); } // Move onto the next job. if (this.IsProcessing) { this.ProcessNextJob(); } else { this.EncodeService.EncodeCompleted -= this.EncodeServiceEncodeCompleted; this.InvokeQueueCompleted(EventArgs.Empty); this.QueueManager.BackupQueue(string.Empty); } }
/// <summary> /// After an encode is complete, move onto the next job. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The EncodeCompletedEventArgs. /// </param> private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e) { // Growl if (Init.GrowlEncode) { GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done."); } if (!e.Successful) { this.Pause(); MessageBox.Show(e.Exception + e.ErrorInformation); } // Handling Log Data this.EncodeService.ProcessLogs(this.QueueManager.LastProcessedJob.Destination); // Move onto the next job. this.ProcessNextJob(); }
/// <summary> /// Perform an action after an encode. e.g a shutdown, standby, restart etc. /// </summary> private static void Finish() { // Growl if (userSettingService.GetUserSetting <bool>(ASUserSettingConstants.GrowlQueue)) { GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done."); } // Do something whent he encode ends. switch (userSettingService.GetUserSetting <string>(ASUserSettingConstants.WhenCompleteAction)) { case "Shutdown": Process.Start("Shutdown", "-s -t 60"); break; case "Log off": Win32.ExitWindowsEx(0, 0); break; case "Suspend": Application.SetSuspendState(PowerState.Suspend, true, true); break; case "Hibernate": Application.SetSuspendState(PowerState.Hibernate, true, true); break; case "Lock System": Win32.LockWorkStation(); break; case "Quit HandBrake": Application.Exit(); break; default: break; } }