using HandBrakeWPF.Utilities;\r
using HandBrakeWPF.ViewModels.Interfaces;\r
\r
+ using Microsoft.Win32;\r
+\r
using Ookii.Dialogs.Wpf;\r
\r
using Execute = Caliburn.Micro.Execute;\r
private int selectedVerbosity;\r
private bool sendFileAfterEncode;\r
private string sendFileTo;\r
- private string sendFileToPath;\r
+ private string sendFileToPath; \r
private string vlcPath;\r
private string whenDone;\r
private BindingList<string> whenDoneOptions = new BindingList<string>();\r
private bool pauseOnLowDiskspace;\r
private long pauseOnLowDiskspaceLevel;\r
private bool useQsvDecodeForNonQsvEnc;\r
-\r
private bool showStatusInTitleBar;\r
\r
+ private string whenDoneAudioFile;\r
+\r
+ private bool playSoundWhenDone;\r
+\r
#endregion\r
\r
#region Constructors and Destructors\r
}\r
}\r
\r
-\r
/// <summary>\r
/// Gets or sets a value indicating whether to show encode status in the tile bar.\r
/// </summary>\r
this.NotifyOfPropertyChange(() => this.ShowStatusInTitleBar);\r
}\r
}\r
- \r
+\r
+ /// <summary>\r
+ /// When Done Audio File\r
+ /// </summary>\r
+ public string WhenDoneAudioFile\r
+ {\r
+ get\r
+ {\r
+ return this.whenDoneAudioFile;\r
+ }\r
+ set\r
+ {\r
+ if (value == this.whenDoneAudioFile) return;\r
+ this.whenDoneAudioFile = value;\r
+ this.NotifyOfPropertyChange(() => this.WhenDoneAudioFile);\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// When Done Audio File - File Path\r
+ /// </summary>\r
+ public string WhenDoneAudioFileFullPath { get; set; }\r
+\r
+ /// <summary>\r
+ /// Play a sound when an encode or queue finishes.\r
+ /// </summary>\r
+ public bool PlaySoundWhenDone\r
+ {\r
+ get\r
+ {\r
+ return this.playSoundWhenDone;\r
+ }\r
+ set\r
+ {\r
+ if (value == this.playSoundWhenDone) return;\r
+ this.playSoundWhenDone = value;\r
+ this.NotifyOfPropertyChange(() => this.PlaySoundWhenDone);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Output Files\r
this.updateService.CheckForUpdates(this.UpdateCheckComplete);\r
}\r
\r
+ /// <summary>\r
+ /// Browse - Send File To\r
+ /// </summary>\r
+ public void BrowseWhenDoneAudioFile()\r
+ {\r
+ OpenFileDialog dialog = new OpenFileDialog() { Filter = "All Files|*.wav;*.mp3", FileName = this.WhenDoneAudioFileFullPath };\r
+ bool? dialogResult = dialog.ShowDialog();\r
+ if (dialogResult.HasValue && dialogResult.Value)\r
+ {\r
+ this.WhenDoneAudioFile = Path.GetFileNameWithoutExtension(dialog.FileName);\r
+ this.WhenDoneAudioFileFullPath = dialog.FileName;\r
+ }\r
+ }\r
+\r
#endregion\r
\r
/// <summary>\r
this.ResetWhenDoneAction = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ResetWhenDoneAction);\r
this.ShowQueueInline = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowQueueInline);\r
this.ShowStatusInTitleBar = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowStatusInTitleBar);\r
+ this.WhenDoneAudioFile = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenDoneAudioFile)) ?? string.Empty;\r
+ this.WhenDoneAudioFileFullPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenDoneAudioFile);\r
+ this.PlaySoundWhenDone = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PlaySoundWhenDone);\r
\r
// #############################\r
// Output Settings\r
this.userSettingService.SetUserSetting(UserSettingConstants.ResetWhenDoneAction, this.ResetWhenDoneAction);\r
this.userSettingService.SetUserSetting(UserSettingConstants.ShowQueueInline, this.ShowQueueInline);\r
this.userSettingService.SetUserSetting(UserSettingConstants.ShowStatusInTitleBar, this.ShowStatusInTitleBar);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenDone, this.PlaySoundWhenDone);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.WhenDoneAudioFile, this.WhenDoneAudioFileFullPath);\r
\r
/* Output Files */\r
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);\r
<TextBox Name="SendToArguments" Text="{Binding Arguments}" Width="250" />\r
</StackPanel>\r
\r
+ <StackPanel Orientation="Vertical" Margin="0,7,0,0">\r
+ <CheckBox Content="{x:Static Properties:ResourcesUI.OptionsView_PlaySoundWhenDone}" \r
+ VerticalAlignment="Center" VerticalContentAlignment="Center" IsChecked="{Binding PlaySoundWhenDone}" Margin="0,1,0,0" />\r
+ \r
+ <StackPanel Orientation="Horizontal" Margin="25,2,0,0">\r
+ <TextBlock Text="{Binding WhenDoneAudioFile}" VerticalAlignment="Center" Margin="5,0,5,0" />\r
+ <Button Content="Browse" cal:Message.Attach="[Event Click] = [Action BrowseWhenDoneAudioFile]" />\r
+ </StackPanel>\r
+ \r
+ </StackPanel>\r
+\r
+\r
</StackPanel>\r
</StackPanel>\r
\r