/// <summary> /// Copy Controls /// <summary> public static void CopyControls(ViewModel vm) { // ------------------------- // Conditions Check // Enable // ------------------------- if (AutoCopyConditionsCheck(vm, MainWindow.inputExt, MainWindow.outputExt) == true) { // ------------------------- // Set Audio Codec Combobox Selected Item to Copy // ------------------------- if (vm.Audio_Codec_Items.Count > 0) { if (vm.Audio_Codec_Items?.Contains("Copy") == true) { vm.Audio_Codec_SelectedItem = "Copy"; } } } // ------------------------- // Reset to Default Codec // ------------------------- // Disable Copy if: // Input / Output Extensions don't match // Audio is Not Auto // VBR is Checked // Samplerate is Not auto // BitDepth is Not auto // Alimiter is Checked // Volume is Not 100 // ------------------------- else { // ------------------------- // Null Check // ------------------------- if (!string.IsNullOrEmpty(vm.Audio_Quality_SelectedItem)) { // ------------------------- // Copy Selected // ------------------------- if (vm.Audio_Codec_SelectedItem == "Copy") { // ------------------------- // Switch back to format's default codec // ------------------------- if (vm.Audio_Codec_SelectedItem != "Auto" || !string.Equals(MainWindow.inputExt, MainWindow.outputExt, StringComparison.CurrentCultureIgnoreCase) ) { // ------------------------- // Video Container // ------------------------- if (vm.Format_Container_SelectedItem == "webm") { vm.Audio_Codec_SelectedItem = "Vorbis"; } else if (vm.Format_Container_SelectedItem == "mp4") { vm.Audio_Codec_SelectedItem = "AAC"; } else if (vm.Format_Container_SelectedItem == "mkv") { vm.Audio_Codec_SelectedItem = "AC3"; } else if (vm.Format_Container_SelectedItem == "m2v") { vm.Audio_Codec_SelectedItem = "None"; } else if (vm.Format_Container_SelectedItem == "mpg") { vm.Audio_Codec_SelectedItem = "MP2"; } else if (vm.Format_Container_SelectedItem == "avi") { vm.Audio_Codec_SelectedItem = "LAME"; } else if (vm.Format_Container_SelectedItem == "ogv") { vm.Audio_Codec_SelectedItem = "Vorbis"; } // ------------------------- // Audio Container // ------------------------- if (vm.Format_Container_SelectedItem == "m4a") { vm.Audio_Codec_SelectedItem = "AAC"; } else if (vm.Format_Container_SelectedItem == "mp3") { vm.Audio_Codec_SelectedItem = "LAME"; } else if (vm.Format_Container_SelectedItem == "ogg") { vm.Audio_Codec_SelectedItem = "Opus"; } else if (vm.Format_Container_SelectedItem == "flac") { vm.Audio_Codec_SelectedItem = "FLAC"; } else if (vm.Format_Container_SelectedItem == "wav") { vm.Audio_Codec_SelectedItem = "PCM"; } // ------------------------- // Image Container // ------------------------- //if (vm.Format_Container_SelectedItem == "jpg") //{ // vm.Audio_Codec_SelectedItem = "None"; //} //else if (vm.Format_Container_SelectedItem == "png") //{ // vm.Audio_Codec_SelectedItem = "None"; //} //else if (vm.Format_Container_SelectedItem == "webp") //{ // vm.Audio_Codec_SelectedItem = "None"; //} } } } } }
// ------------------------- // Checked // ------------------------- public static void Controls_Checked(ViewModel vm) { // BitRate Mode vm.Video_VBR_IsChecked = true; }
/// <summary> /// Set Controls /// </summary> public static void SetControls(ViewModel vm, string codec_SelectedItem) { // -------------------------------------------------- // Codec // -------------------------------------------------- // ------------------------- // Vorbis // ------------------------- if (codec_SelectedItem == "Vorbis") { // Codec Vorbis.Codec_Set(vm); // Items Source Vorbis.Controls_ItemsSource(vm); // Selected Items Vorbis.Controls_Selected(vm); // Checked Vorbis.Controls_Checked(vm); // Unhecked Vorbis.Controls_Unhecked(vm); // Enabled Vorbis.Controls_Enable(vm); // Disabled Vorbis.Controls_Disable(vm); } // ------------------------- // Opus // ------------------------- else if (codec_SelectedItem == "Opus") { // Codec Opus.Codec_Set(vm); // Items Source Opus.Controls_ItemsSource(vm); // Selected Items Opus.Controls_Selected(vm); // Checked Opus.Controls_Checked(vm); // Unhecked Opus.Controls_Unhecked(vm); // Enabled Opus.Controls_Enable(vm); // Disabled Opus.Controls_Disable(vm); } // ------------------------- // AC3 // ------------------------- else if (codec_SelectedItem == "AC3") { // Codec AC3.Codec_Set(vm); // Items Source AC3.Controls_ItemsSource(vm); // Selected Items AC3.Controls_Selected(vm); // Checked AC3.Controls_Checked(vm); // Unhecked AC3.Controls_Unhecked(vm); // Enabled AC3.Controls_Enable(vm); // Disabled AC3.Controls_Disable(vm); } // ------------------------- // AAC // ------------------------- else if (codec_SelectedItem == "AAC") { // Codec AAC.Codec_Set(vm); // Items Source AAC.Controls_ItemsSource(vm); // Selected Items AAC.Controls_Selected(vm); // Checked AAC.Controls_Checked(vm); // Unhecked AAC.Controls_Unhecked(vm); // Enabled AAC.Controls_Enable(vm); // Disabled AAC.Controls_Disable(vm); } // ------------------------- // DTS // ------------------------- else if (codec_SelectedItem == "DTS") { // Codec DTS.Codec_Set(vm); // Items Source DTS.Controls_ItemsSource(vm); // Selected Items DTS.Controls_Selected(vm); // Checked DTS.Controls_Checked(vm); // Unhecked DTS.Controls_Unhecked(vm); // Enabled DTS.Controls_Enable(vm); // Disabled DTS.Controls_Disable(vm); } // ------------------------- // MP2 // ------------------------- else if (codec_SelectedItem == "MP2") { // Codec MP2.Codec_Set(vm); // Items Source MP2.Controls_ItemsSource(vm); // Selected Items MP2.Controls_Selected(vm); // Checked MP2.Controls_Checked(vm); // Unhecked MP2.Controls_Unhecked(vm); // Enabled MP2.Controls_Enable(vm); // Disabled MP2.Controls_Disable(vm); } // ------------------------- // LAME // ------------------------- else if (codec_SelectedItem == "LAME") { // Codec LAME.Codec_Set(vm); // Items Source LAME.Controls_ItemsSource(vm); // Selected Items LAME.Controls_Selected(vm); // Checked LAME.Controls_Checked(vm); // Unhecked LAME.Controls_Unhecked(vm); // Enabled LAME.Controls_Enable(vm); // Disabled LAME.Controls_Disable(vm); } // ------------------------- // ALAC // ------------------------- else if (codec_SelectedItem == "ALAC") { // Codec ALAC.Codec_Set(vm); // Items Source ALAC.Controls_ItemsSource(vm); // Selected Items ALAC.Controls_Selected(vm); // Checked ALAC.Controls_Checked(vm); // Unhecked ALAC.Controls_Unhecked(vm); // Enabled ALAC.Controls_Enable(vm); // Disabled ALAC.Controls_Disable(vm); } // ------------------------- // FLAC // ------------------------- else if (codec_SelectedItem == "FLAC") { // Codec FLAC.Codec_Set(vm); // Items Source FLAC.Controls_ItemsSource(vm); // Selected Items FLAC.Controls_Selected(vm); // Checked FLAC.Controls_Checked(vm); // Unhecked FLAC.Controls_Unhecked(vm); // Enabled FLAC.Controls_Enable(vm); // Disabled FLAC.Controls_Disable(vm); } // ------------------------- // PCM // ------------------------- else if (codec_SelectedItem == "PCM") { // Codec PCM.Codec_Set(vm); // Items Source PCM.Controls_ItemsSource(vm); // Selected Items PCM.Controls_Selected(vm); // Checked PCM.Controls_Checked(vm); // Unhecked PCM.Controls_Unhecked(vm); // Enabled PCM.Controls_Enable(vm); // Disabled PCM.Controls_Disable(vm); } // ------------------------- // Copy // ------------------------- else if (codec_SelectedItem == "Copy") { // Codec AudioCopy.Codec_Set(vm); // Items Source AudioCopy.Controls_ItemsSource(vm); // Selected Items AudioCopy.Controls_Selected(vm); // Checked AudioCopy.Controls_Checked(vm); // Unhecked AudioCopy.Controls_Unhecked(vm); // Enabled AudioCopy.Controls_Enable(vm); // Disabled AudioCopy.Controls_Disable(vm); } // ------------------------- // None // ------------------------- else if (codec_SelectedItem == "None") { // Codec AudioNone.Codec_Set(vm); // Items Source AudioNone.Controls_ItemsSource(vm); // Selected Items AudioNone.Controls_Selected(vm); // Checked AudioNone.Controls_Checked(vm); // Unhecked AudioNone.Controls_Unhecked(vm); // Enabled AudioNone.Controls_Enable(vm); // Disabled AudioNone.Controls_Disable(vm); } // -------------------------------------------------- // Default Selected Item // -------------------------------------------------- // ------------------------- // Audio Quality Selected Item // ------------------------- if (!string.IsNullOrEmpty(vm.Audio_Quality_SelectedItem) && vm.Audio_Quality_SelectedItem != "None" && vm.Audio_Quality_SelectedItem != "none") { MainWindow.Audio_Quality_PreviousItem = vm.Audio_Quality_SelectedItem; } vm.Audio_Quality_SelectedItem = MainWindow.SelectedItem(vm.Audio_Quality_Items.Select(c => c.Name).ToList(), MainWindow.Audio_Quality_PreviousItem ); // ------------------------- // Audio SampleRate Selected Item // ------------------------- if (!string.IsNullOrEmpty(vm.Audio_SampleRate_SelectedItem) && vm.Audio_SampleRate_SelectedItem != "None" && vm.Audio_SampleRate_SelectedItem != "none") { MainWindow.Audio_SampleRate_PreviousItem = vm.Audio_SampleRate_SelectedItem; } vm.Audio_SampleRate_SelectedItem = MainWindow.SelectedItem(vm.Audio_SampleRate_Items.Select(c => c.Name).ToList(), MainWindow.Audio_SampleRate_PreviousItem ); // ------------------------- // Audio BitDepth Selected Item // ------------------------- if (!string.IsNullOrEmpty(vm.Audio_BitDepth_SelectedItem) && vm.Audio_BitDepth_SelectedItem != "None" && vm.Audio_BitDepth_SelectedItem != "none") { MainWindow.Audio_BitDepth_PreviousItem = vm.Audio_BitDepth_SelectedItem; } vm.Audio_BitDepth_SelectedItem = MainWindow.SelectedItem(vm.Audio_BitDepth_Items.Select(c => c.Name).ToList(), MainWindow.Audio_BitDepth_PreviousItem ); }
// ------------------------- // Expanded // ------------------------- public static void Controls_Expanded(ViewModel vm) { // None }
// ------------------------- // Collapsed // ------------------------- public static void Controls_Collapsed(ViewModel vm) { vm.Video_Optimize_IsExpanded = false; }
// --------------------------------------------------------------------------- // Controls Behavior // --------------------------------------------------------------------------- // ------------------------- // Items Source // ------------------------- public static void Controls_ItemsSource(ViewModel vm) { vm.Subtitle_Stream_Items = stream; }
/// <summary> /// Get Output Extension /// </summary> public static void OutputFormatExt(ViewModel vm) { // Output Extension is Format ComboBox's Selected Item (eg mp4) MainWindow.outputExt = "." + vm.Format_Container_SelectedItem; }
/// <summary> /// Export axiom.conf /// </summary> public static void ExportConfig(MainWindow mainwindow, ViewModel vm) { // ------------------------- // Check if Directory Exists // ------------------------- if (!Directory.Exists(configDir)) { try { // Create Config Directory Directory.CreateDirectory(configDir); } catch { MessageBox.Show("Could not create Config folder. May require Administrator privileges.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } //// Yes/No Dialog Confirmation //// //MessageBoxResult resultExport = MessageBox.Show("Config Folder does not exist. Automatically create it?", // "Directory Not Found", // MessageBoxButton.YesNo, // MessageBoxImage.Information); //switch (resultExport) //{ // // Create // case MessageBoxResult.Yes: // try // { // Directory.CreateDirectory(configDir); // } // catch // { // MessageBox.Show("Could not create Config folder. May require Administrator privileges.", // "Error", // MessageBoxButton.OK, // MessageBoxImage.Error); // } // break; // // Use Default // case MessageBoxResult.No: // break; //} } // ------------------------- // Save axiom.conf file if directory exists // ------------------------- if (Directory.Exists(configDir)) { try { // Start conf File Write Configure.INIFile conf = new Configure.INIFile(configFile); // ------------------------- // Main Window // ------------------------- // Window Position Top conf.Write("Main Window", "Window_Position_Top", mainwindow.Top.ToString()); // Window Position Left conf.Write("Main Window", "Window_Position_Left", mainwindow.Left.ToString()); // Window Width conf.Write("Main Window", "Window_Width", mainwindow.Width.ToString()); // Window Height conf.Write("Main Window", "Window_Height", mainwindow.Height.ToString()); // Window Maximized if (mainwindow.WindowState == WindowState.Maximized) { conf.Write("Main Window", "WindowState_Maximized", "true"); } else { conf.Write("Main Window", "WindowState_Maximized", "false"); } // CMD Keep Window Open Toggle conf.Write("Main Window", "CMDWindowKeep_IsChecked", vm.CMDWindowKeep_IsChecked.ToString().ToLower()); // Auto Sort Script Toggle conf.Write("Main Window", "AutoSortScript_IsChecked", vm.AutoSortScript_IsChecked.ToString().ToLower()); // -------------------------------------------------- // Settings // -------------------------------------------------- // FFmpeg conf.Write("Settings", "FFmpegPath_Text", vm.FFmpegPath_Text); conf.Write("Settings", "FFprobePath_Text", vm.FFprobePath_Text); conf.Write("Settings", "FFplayPath_Text", vm.FFplayPath_Text); // Presets conf.Write("Settings", "CustomPresetsPath_Text", vm.CustomPresetsPath_Text); // Log conf.Write("Settings", "LogCheckBox_IsChecked", vm.LogCheckBox_IsChecked.ToString().ToLower()); conf.Write("Settings", "LogPath_Text", vm.LogPath_Text); // Threads conf.Write("Settings", "Threads_SelectedItem", vm.Threads_SelectedItem); // Theme conf.Write("Settings", "Theme_SelectedItem", vm.Theme_SelectedItem); // Updates conf.Write("Settings", "UpdateAutoCheck_IsChecked", vm.UpdateAutoCheck_IsChecked.ToString().ToLower()); } catch { MessageBox.Show("Could not save config file. May require Administrator privileges.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } }
/// <summary> /// Export Write Config /// </summary> public static void WriteConfig(MainWindow mainwindow, ViewModel vm, INIFile conf) { }
/// <summary> /// Cut Controls /// </summary> public static void CutControls(ViewModel vm) { // Enable Aspect Custom // ------------------------- // No // ------------------------- if (vm.Format_Cut_SelectedItem == "No") { // Cut vm.Format_CutStart_IsEnabled = false; vm.Format_CutStart_Hours_IsEnabled = false; vm.Format_CutStart_Minutes_IsEnabled = false; vm.Format_CutStart_Seconds_IsEnabled = false; vm.Format_CutStart_Milliseconds_IsEnabled = false; vm.Format_CutEnd_IsEnabled = false; vm.Format_CutEnd_Hours_IsEnabled = false; vm.Format_CutEnd_Minutes_IsEnabled = false; vm.Format_CutEnd_Seconds_IsEnabled = false; vm.Format_CutEnd_Milliseconds_IsEnabled = false; // Video / Sequence if (vm.Format_MediaType_SelectedItem == "Video" || vm.Format_MediaType_SelectedItem == "Sequence") { // Start vm.Format_CutStart_Hours_Text = "00"; vm.Format_CutStart_Minutes_Text = "00"; vm.Format_CutStart_Seconds_Text = "00"; vm.Format_CutStart_Milliseconds_Text = "000"; // End vm.Format_CutEnd_Hours_Text = "00"; vm.Format_CutEnd_Minutes_Text = "00"; vm.Format_CutEnd_Seconds_Text = "00"; vm.Format_CutEnd_Milliseconds_Text = "000"; } // Image else if (vm.Format_MediaType_SelectedItem == "Image") { //vm.Format_CutStart_Text = "00:00:00.000"; //vm.Format_CutEnd_Text = string.Empty; // Start vm.Format_CutStart_Hours_Text = "00"; vm.Format_CutStart_Minutes_Text = "00"; vm.Format_CutStart_Seconds_Text = "00"; vm.Format_CutStart_Milliseconds_Text = "000"; // End vm.Format_CutEnd_Hours_Text = string.Empty; vm.Format_CutEnd_Minutes_Text = string.Empty; vm.Format_CutEnd_Seconds_Text = string.Empty; vm.Format_CutEnd_Milliseconds_Text = string.Empty; } // Frames vm.Format_FrameStart_IsEnabled = false; vm.Format_FrameEnd_IsEnabled = false; // Reset Text vm.Format_FrameStart_Text = string.Empty; vm.Format_FrameEnd_Text = string.Empty; } // ------------------------- // Yes // ------------------------- else if (vm.Format_Cut_SelectedItem == "Yes") { // Frames // Only for Video if (vm.Format_MediaType_SelectedItem == "Video") { // Time vm.Format_CutStart_IsEnabled = true; vm.Format_CutStart_Hours_IsEnabled = true; vm.Format_CutStart_Minutes_IsEnabled = true; vm.Format_CutStart_Seconds_IsEnabled = true; vm.Format_CutStart_Milliseconds_IsEnabled = true; vm.Format_CutEnd_IsEnabled = true; vm.Format_CutEnd_Hours_IsEnabled = true; vm.Format_CutEnd_Minutes_IsEnabled = true; vm.Format_CutEnd_Seconds_IsEnabled = true; vm.Format_CutEnd_Milliseconds_IsEnabled = true; // Frames vm.Format_FrameStart_IsEnabled = true; vm.Format_FrameEnd_IsEnabled = true; } // Only for Video else if (vm.Format_MediaType_SelectedItem == "Audio") { // Time vm.Format_CutStart_IsEnabled = true; vm.Format_CutStart_Hours_IsEnabled = true; vm.Format_CutStart_Minutes_IsEnabled = true; vm.Format_CutStart_Seconds_IsEnabled = true; vm.Format_CutStart_Milliseconds_IsEnabled = true; vm.Format_CutEnd_IsEnabled = true; vm.Format_CutEnd_Hours_IsEnabled = true; vm.Format_CutEnd_Minutes_IsEnabled = true; vm.Format_CutEnd_Seconds_IsEnabled = true; vm.Format_CutEnd_Milliseconds_IsEnabled = true; // Frames vm.Format_FrameStart_IsEnabled = false; vm.Format_FrameEnd_IsEnabled = false; // Text vm.Format_FrameStart_Text = string.Empty; vm.Format_FrameEnd_Text = string.Empty; } // Only for Video else if (vm.Format_MediaType_SelectedItem == "Image") { // Time vm.Format_CutStart_IsEnabled = true; vm.Format_CutStart_Hours_IsEnabled = true; vm.Format_CutStart_Minutes_IsEnabled = true; vm.Format_CutStart_Seconds_IsEnabled = true; vm.Format_CutStart_Milliseconds_IsEnabled = true; vm.Format_CutEnd_IsEnabled = false; vm.Format_CutEnd_Hours_IsEnabled = false; vm.Format_CutEnd_Minutes_IsEnabled = false; vm.Format_CutEnd_Seconds_IsEnabled = false; vm.Format_CutEnd_Milliseconds_IsEnabled = false; vm.Format_CutEnd_Hours_Text = string.Empty; vm.Format_CutEnd_Minutes_Text = string.Empty; vm.Format_CutEnd_Seconds_Text = string.Empty; vm.Format_CutEnd_Milliseconds_Text = string.Empty; // Frames vm.Format_FrameStart_IsEnabled = true; vm.Format_FrameEnd_IsEnabled = false; vm.Format_FrameEnd_Text = string.Empty; } // Only for Video else if (vm.Format_MediaType_SelectedItem == "Sequence") { // Time vm.Format_CutStart_IsEnabled = true; vm.Format_CutStart_Hours_IsEnabled = true; vm.Format_CutStart_Minutes_IsEnabled = true; vm.Format_CutStart_Seconds_IsEnabled = true; vm.Format_CutStart_Milliseconds_IsEnabled = true; vm.Format_CutEnd_IsEnabled = true; vm.Format_CutEnd_Hours_IsEnabled = true; vm.Format_CutEnd_Minutes_IsEnabled = true; vm.Format_CutEnd_Seconds_IsEnabled = true; vm.Format_CutEnd_Milliseconds_IsEnabled = true; // Frames vm.Format_FrameStart_IsEnabled = true; vm.Format_FrameEnd_IsEnabled = true; } } }
/// <summary> /// Import Read Config /// </summary> public static void ReadConfig(MainWindow mainwindow, ViewModel vm, INIFile conf) { // ------------------------- // Main Window // ------------------------- // Window Position Top double top; double.TryParse(conf.Read("Main Window", "Window_Position_Top"), out top); mainwindow.Top = top; // Window Position Left double left; double.TryParse(conf.Read("Main Window", "Window_Position_Left"), out left); mainwindow.Left = left; // Center if (top == 0 && left == 0) { mainwindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; } // Window Maximized bool mainwindow_WindowState_Maximized; bool.TryParse(conf.Read("Main Window", "WindowState_Maximized").ToLower(), out mainwindow_WindowState_Maximized); if (mainwindow_WindowState_Maximized == true) { //vm.Window_State = WindowState.Maximized; mainwindow.WindowState = WindowState.Maximized; } else { //vm.Window_State = WindowState.Normal; mainwindow.WindowState = WindowState.Normal; } // Window Width double width; double.TryParse(conf.Read("Main Window", "Window_Width"), out width); mainwindow.Width = width; // Window Height double height; double.TryParse(conf.Read("Main Window", "Window_Height"), out height); mainwindow.Height = height; // CMD Window Keep bool mainwindow_CMDWindowKeep_IsChecked; bool.TryParse(conf.Read("Main Window", "CMDWindowKeep_IsChecked").ToLower(), out mainwindow_CMDWindowKeep_IsChecked); vm.CMDWindowKeep_IsChecked = mainwindow_CMDWindowKeep_IsChecked; // Auto Sort Script bool mainwindow_AutoSortScript_IsChecked; bool.TryParse(conf.Read("Main Window", "AutoSortScript_IsChecked").ToLower(), out mainwindow_AutoSortScript_IsChecked); vm.AutoSortScript_IsChecked = mainwindow_AutoSortScript_IsChecked; // -------------------------------------------------- // Settings // -------------------------------------------------- // FFmpeg vm.FFmpegPath_Text = conf.Read("Settings", "FFmpegPath_Text"); vm.FFprobePath_Text = conf.Read("Settings", "FFprobePath_Text"); vm.FFplayPath_Text = conf.Read("Settings", "FFplayPath_Text"); // Presets vm.CustomPresetsPath_Text = conf.Read("Settings", "CustomPresetsPath_Text"); // Log bool settings_LogCheckBox_IsChecked; bool.TryParse(conf.Read("Settings", "LogCheckBox_IsChecked").ToLower(), out settings_LogCheckBox_IsChecked); vm.LogCheckBox_IsChecked = settings_LogCheckBox_IsChecked; vm.LogPath_Text = conf.Read("Settings", "LogPath_Text"); // Threads vm.Threads_SelectedItem = conf.Read("Settings", "Threads_SelectedItem"); // Theme vm.Theme_SelectedItem = conf.Read("Settings", "Theme_SelectedItem"); // Updates bool settings_UpdateAutoCheck_IsChecked; bool.TryParse(conf.Read("Settings", "UpdateAutoCheck_IsChecked").ToLower(), out settings_UpdateAutoCheck_IsChecked); vm.UpdateAutoCheck_IsChecked = settings_UpdateAutoCheck_IsChecked; }
/// <summary> /// Audio Stream Controls /// </summary> public static void AudioStreamControls(ViewModel vm) { // -------------------------------------------------- // Video // Selected Audio Stream // -------------------------------------------------- // ------------------------- // webm // ------------------------- if (vm.Format_Container_SelectedItem == "webm") { // ------------------------- // VP8 // ------------------------- if (vm.Video_Codec_SelectedItem == "VP8") { vm.Audio_Stream_SelectedItem = "1"; } // ------------------------- // VP9 // ------------------------- else if (vm.Video_Codec_SelectedItem == "VP9") { vm.Audio_Stream_SelectedItem = "all"; } // ------------------------- // None // ------------------------- if (vm.Audio_Codec_SelectedItem == "None") { vm.Audio_Stream_SelectedItem = "none"; } } // ------------------------- // mp4 // mkv // mpg // avi // ogv // ------------------------- else if (vm.Format_Container_SelectedItem == "mp4" || vm.Format_Container_SelectedItem == "mkv" || vm.Format_Container_SelectedItem == "mpg" || vm.Format_Container_SelectedItem == "avi" || vm.Format_Container_SelectedItem == "ogv" ) { // ------------------------- // None // ------------------------- if (vm.Audio_Codec_SelectedItem == "None") { vm.Audio_Stream_SelectedItem = "none"; } // ------------------------- // All Other Codecs // ------------------------- else { vm.Audio_Stream_SelectedItem = "all"; } } // -------------------------------------------------- // Image / Sequence // Selected Audio Stream // -------------------------------------------------- // ------------------------- // None // ------------------------- else if (vm.Format_Container_SelectedItem == "jpg" || vm.Format_Container_SelectedItem == "png" || vm.Format_Container_SelectedItem == "webp" ) { // ------------------------- // All Codecs // ------------------------- vm.Audio_Stream_SelectedItem = "none"; } // -------------------------------------------------- // Audio // Selected Audio Stream // -------------------------------------------------- // ------------------------- // None // ------------------------- else if (vm.Format_Container_SelectedItem == "mp3" || vm.Format_Container_SelectedItem == "m4a" || vm.Format_Container_SelectedItem == "ogg" || vm.Format_Container_SelectedItem == "flac" || vm.Format_Container_SelectedItem == "wav" ) { // ------------------------- // None // ------------------------- if (vm.Audio_Codec_SelectedItem == "None") { vm.Audio_Stream_SelectedItem = "none"; } // ------------------------- // All Other Codecs // ------------------------- else { vm.Audio_Stream_SelectedItem = "1"; } } }
// -------------------------------------------------------------------------------------------------------- /// <summary> /// ComboBoxes Item Sources /// </summary> // -------------------------------------------------------------------------------------------------------- /// <summary> /// Set Controls /// </summary> public static void SetControls(ViewModel vm, string container_SelectedItem) { // -------------------------------------------------- // Containers // -------------------------------------------------- // Select Codecs and Default Selected Items per container // -------------------------------------------------- // Video // -------------------------------------------------- // ------------------------- // webm // ------------------------- if (container_SelectedItem == "webm") { // Media Type vm.Format_MediaType_Items = Containers.WebM.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.WebM.video; vm.Video_Codec_SelectedItem = "VP8"; // Optimize vm.Video_Optimize_SelectedItem = "Web"; // Audio Codec vm.Audio_Codec_Items = Containers.WebM.audio; vm.Audio_Codec_SelectedItem = "Vorbis"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.WebM.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // mp4 // ------------------------- else if (container_SelectedItem == "mp4") { // Media Type vm.Format_MediaType_Items = Containers.MP4.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.MP4.video; vm.Video_Codec_SelectedItem = "x264"; // Audio Codec vm.Audio_Codec_Items = Containers.MP4.audio; vm.Audio_Codec_SelectedItem = "AAC"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.MP4.subtitle; vm.Subtitle_Codec_SelectedItem = "MOV Text"; } // ------------------------- // mkv // ------------------------- else if (container_SelectedItem == "mkv") { // Media Type vm.Format_MediaType_Items = Containers.MKV.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.MKV.video; vm.Video_Codec_SelectedItem = "x264"; // Audio Codec vm.Audio_Codec_Items = Containers.MKV.audio; vm.Audio_Codec_SelectedItem = "AC3"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.MKV.subtitle; vm.Subtitle_Codec_SelectedItem = "SSA"; } // ------------------------- // m2v // ------------------------- else if (container_SelectedItem == "m2v") { // Media Type vm.Format_MediaType_Items = Containers.M2V.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.M2V.video; vm.Video_Codec_SelectedItem = "MPEG-2"; // Audio Codec vm.Audio_Codec_Items = Containers.M2V.audio; vm.Audio_Codec_SelectedItem = "None"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.M2V.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // mpg // ------------------------- else if (container_SelectedItem == "mpg") { // Media Type vm.Format_MediaType_Items = Containers.MPG.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.MPG.video; vm.Video_Codec_SelectedItem = "MPEG-2"; // Audio Codec vm.Audio_Codec_Items = Containers.MPG.audio; vm.Audio_Codec_SelectedItem = "MP2"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.MPG.subtitle; vm.Subtitle_Codec_SelectedItem = "SRT"; } // ------------------------- // avi // ------------------------- else if (container_SelectedItem == "avi") { // Media Type vm.Format_MediaType_Items = Containers.AVI.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.AVI.video; vm.Video_Codec_SelectedItem = "MPEG-4"; // Audio Codec vm.Audio_Codec_Items = Containers.AVI.audio; vm.Audio_Codec_SelectedItem = "LAME"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.AVI.subtitle; vm.Subtitle_Codec_SelectedItem = "SRT"; } // ------------------------- // ogv // ------------------------- else if (container_SelectedItem == "ogv") { // Media Type vm.Format_MediaType_Items = Containers.OGV.media; vm.Format_MediaType_SelectedItem = "Video"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.OGV.video; vm.Video_Codec_SelectedItem = "Theora"; // Audio Codec vm.Audio_Codec_Items = Containers.OGV.audio; vm.Audio_Codec_SelectedItem = "Opus"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.OGV.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // -------------------------------------------------- // Audio // -------------------------------------------------- // ------------------------- // mp3 // ------------------------- else if (container_SelectedItem == "mp3") { // Media Type vm.Format_MediaType_Items = Containers.LAME.media; vm.Format_MediaType_SelectedItem = "Audio"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.LAME.video; vm.Video_Codec_SelectedItem = "None"; // Audio Codec vm.Audio_Codec_Items = Containers.LAME.audio; vm.Audio_Codec_SelectedItem = "LAME"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.LAME.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // m4a // ------------------------- else if (container_SelectedItem == "m4a") { // Media Type vm.Format_MediaType_Items = Containers.M4A.media; vm.Format_MediaType_SelectedItem = "Audio"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.M4A.video; vm.Video_Codec_SelectedItem = "None"; // Audio Codec vm.Audio_Codec_Items = Containers.M4A.audio; vm.Audio_Codec_SelectedItem = "AAC"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.M4A.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // ogg // ------------------------- else if (container_SelectedItem == "ogg") { // Media Type vm.Format_MediaType_Items = Containers.OGG.media; vm.Format_MediaType_SelectedItem = "Audio"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.OGG.video; vm.Video_Codec_SelectedItem = "None"; // Audio Codec vm.Audio_Codec_Items = Containers.OGG.audio; vm.Audio_Codec_SelectedItem = "Opus"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.OGG.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // flac // ------------------------- else if (container_SelectedItem == "flac") { // Media Type vm.Format_MediaType_Items = Containers.FLAC.media; vm.Format_MediaType_SelectedItem = "Audio"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.FLAC.video; vm.Video_Codec_SelectedItem = "None"; // Audio Codec vm.Audio_Codec_Items = Containers.FLAC.audio; vm.Audio_Codec_SelectedItem = "FLAC"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.FLAC.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // wav // ------------------------- else if (container_SelectedItem == "wav") { // Media Type vm.Format_MediaType_Items = Containers.WAV.media; vm.Format_MediaType_SelectedItem = "Audio"; vm.Format_MediaType_IsEnabled = false; // Video Codec vm.Video_Codec_Items = Containers.WAV.video; vm.Video_Codec_SelectedItem = "None"; // Audio Codec vm.Audio_Codec_Items = Containers.WAV.audio; vm.Audio_Codec_SelectedItem = "PCM"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.WAV.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // -------------------------------------------------- // Image // -------------------------------------------------- // ------------------------- // jpg // ------------------------- else if (container_SelectedItem == "jpg") { // Media Type vm.Format_MediaType_Items = Containers.JPG.media; vm.Format_MediaType_SelectedItem = "Image"; vm.Format_MediaType_IsEnabled = true; // Video Codec vm.Video_Codec_Items = Containers.JPG.video; vm.Video_Codec_SelectedItem = "JPEG"; // Audio Codec vm.Audio_Codec_Items = Containers.JPG.audio; vm.Audio_Codec_SelectedItem = "None"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.JPG.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // png // ------------------------- else if (container_SelectedItem == "png") { // Media Type vm.Format_MediaType_Items = Containers.JPG.media; vm.Format_MediaType_SelectedItem = "Image"; vm.Format_MediaType_IsEnabled = true; // Video Codec vm.Video_Codec_Items = Containers.PNG.video; vm.Video_Codec_SelectedItem = "PNG"; // Audio Codec vm.Audio_Codec_Items = Containers.PNG.audio; vm.Audio_Codec_SelectedItem = "None"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.PNG.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } // ------------------------- // webp // ------------------------- else if (container_SelectedItem == "webp") { // Media Type vm.Format_MediaType_Items = Containers.JPG.media; vm.Format_MediaType_SelectedItem = "Image"; vm.Format_MediaType_IsEnabled = true; // Video Codec vm.Video_Codec_Items = Containers.WebP.video; vm.Video_Codec_SelectedItem = "WebP"; // Audio Codec vm.Audio_Codec_Items = Containers.WebP.audio; vm.Audio_Codec_SelectedItem = "None"; // Subtitle Codec vm.Subtitle_Codec_Items = Containers.WebP.subtitle; vm.Subtitle_Codec_SelectedItem = "None"; } }
/// <summary> /// MediaType Controls Controls /// </summary> public static void MediaTypeControls(ViewModel vm) { // ------------------------- // Video // ------------------------- // Enable Frame Textbox for Image Screenshot if (vm.Format_MediaType_SelectedItem == "Video") { // ------------------------- // Format // ------------------------- // Hardware Acceleration vm.Format_HWAccel_IsEnabled = true; // Cut // Change if coming back from JPEG, PNG, WebP if (vm.Format_CutStart_IsEnabled == true && vm.Format_CutEnd_IsEnabled == false) { vm.Format_Cut_SelectedItem = "No"; } // YouTube vm.Format_YouTube_SelectedItem = "Video + Audio"; // ------------------------- // Video // ------------------------- // Codec vm.Video_Codec_IsEnabled = true; // Size vm.Video_Scale_IsEnabled = true; // Scaling vm.Video_ScalingAlgorithm_IsEnabled = true; vm.Video_ScalingAlgorithm_SelectedItem = "auto"; // Speed vm.Video_Speed_IsEnabled = true; // Screen Format vm.Video_ScreenFormat_IsEnabled = true; // Aspect Ratio vm.Video_AspectRatio_IsEnabled = true; // Crop vm.Video_Crop_IsEnabled = true; // ------------------------- // Audio // ------------------------- // Codec vm.Audio_Codec_IsEnabled = true; // Channel vm.Audio_Channel_IsEnabled = true; // Volume vm.Audio_Volume_IsEnabled = true; // Limiter vm.Audio_HardLimiter_IsEnabled = true; // Audio Stream vm.Audio_Stream_IsEnabled = true; //AudioStreamControls(vm); // Selected Item //vm.Audio_Stream_SelectedItem = "all"; // ------------------------- // Subtitle // ------------------------- // Codec vm.Subtitle_Codec_IsEnabled = true; } // ------------------------- // Audio // ------------------------- else if (vm.Format_MediaType_SelectedItem == "Audio") { // ------------------------- // Format // ------------------------- // Hardware Acceleration vm.Format_HWAccel_IsEnabled = false; vm.Format_HWAccel_SelectedItem = "off"; // Cut // Change if coming back from JPEG, PNG, WebP if (vm.Format_CutStart_IsEnabled == true && vm.Format_CutEnd_IsEnabled == false) { vm.Format_Cut_SelectedItem = "No"; } // YouTube vm.Format_YouTube_SelectedItem = "Audio Only"; // Frame vm.Format_FrameEnd_IsEnabled = false; vm.Format_FrameEnd_Text = ""; // ------------------------- // Video // ------------------------- // Codec vm.Video_Codec_IsEnabled = false; // Size vm.Video_Scale_SelectedItem = "Source"; vm.Video_Scale_IsEnabled = false; // Scaling vm.Video_ScalingAlgorithm_SelectedItem = "auto"; vm.Video_ScalingAlgorithm_IsEnabled = false; // Speed vm.Video_Speed_IsEnabled = false; // Screen Format vm.Video_ScreenFormat_IsEnabled = false; // Aspect Ratio vm.Video_AspectRatio_IsEnabled = false; // Crop vm.Video_Crop_IsEnabled = false; // FPS vm.Video_FPS_SelectedItem = "auto"; vm.Video_FPS_IsEnabled = false; // Encode Speed vm.Video_EncodeSpeed_IsEnabled = false; // ------------------------- // Audio // ------------------------- // Codec vm.Audio_Codec_IsEnabled = true; // Audio Stream vm.Audio_Stream_IsEnabled = true; //AudioStreamControls(vm); // Selected Item //vm.Audio_Stream_SelectedItem = "1"; // Channel vm.Audio_Channel_IsEnabled = true; // Sample Rate // Controled Through Codec Class // Bit Depth // Controled Through Codec Class // Volume vm.Audio_Volume_IsEnabled = true; // Limiter vm.Audio_HardLimiter_IsEnabled = true; // ------------------------- // Subtitle // ------------------------- // Codec vm.Subtitle_Codec_IsEnabled = false; } // ------------------------- // Image // ------------------------- else if (vm.Format_MediaType_SelectedItem == "Image") { // ------------------------- // Format // ------------------------- // Hardware Acceleration vm.Format_HWAccel_IsEnabled = true; // Cut // Enable Cut Start Time for Frame Selection vm.Format_Cut_SelectedItem = "Yes"; vm.Format_CutStart_IsEnabled = true; vm.Format_CutStart_Hours_IsEnabled = true; vm.Format_CutStart_Minutes_IsEnabled = true; vm.Format_CutStart_Seconds_IsEnabled = true; vm.Format_CutStart_Milliseconds_IsEnabled = true; vm.Format_CutEnd_IsEnabled = false; vm.Format_CutEnd_Hours_IsEnabled = false; vm.Format_CutEnd_Minutes_IsEnabled = false; vm.Format_CutEnd_Seconds_IsEnabled = false; vm.Format_CutEnd_Milliseconds_IsEnabled = false; vm.Format_CutEnd_Hours_Text = string.Empty; vm.Format_CutEnd_Minutes_Text = string.Empty; vm.Format_CutEnd_Seconds_Text = string.Empty; vm.Format_CutEnd_Milliseconds_Text = string.Empty; // Frame vm.Format_FrameEnd_IsEnabled = false; vm.Format_FrameEnd_Text = ""; // YouTube vm.Format_YouTube_SelectedItem = "Video + Audio"; // ------------------------- // Video // ------------------------- // Codec vm.Video_Codec_IsEnabled = true; //Size vm.Video_Scale_IsEnabled = true; // Scaling vm.Video_ScalingAlgorithm_SelectedItem = "auto"; vm.Video_ScalingAlgorithm_IsEnabled = true; // Speed vm.Video_Speed_IsEnabled = false; // Screen Format vm.Video_ScreenFormat_IsEnabled = true; // Aspect Ratio vm.Video_AspectRatio_IsEnabled = true; // Crop vm.Video_Crop_IsEnabled = true; // Fps vm.Video_FPS_SelectedItem = "auto"; vm.Video_FPS_IsEnabled = false; // Encode Speed vm.Video_EncodeSpeed_IsEnabled = false; // ------------------------- // Audio // ------------------------- // Codec vm.Audio_Codec_IsEnabled = false; // Audio Stream //vm.Audio_Stream_SelectedItem = "none"; //AudioStreamControls(vm); // Selected Item vm.Audio_Stream_IsEnabled = false; // Channel vm.Audio_Channel_SelectedItem = "Source"; vm.Audio_Channel_IsEnabled = false; // Quality vm.Audio_Quality_SelectedItem = "None"; vm.Audio_Quality_IsEnabled = false; // Compression Level vm.Audio_CompressionLevel_SelectedItem = "auto"; vm.Audio_CompressionLevel_IsEnabled = false; // Sample Rate vm.Audio_SampleRate_SelectedItem = "auto"; vm.Audio_SampleRate_IsEnabled = false; // Bit Depth vm.Audio_BitDepth_SelectedItem = "auto"; vm.Audio_BitDepth_IsEnabled = false; // Volume vm.Audio_Volume_IsEnabled = false; // Limiter vm.Audio_HardLimiter_IsEnabled = false; vm.Audio_HardLimiter_Value = 1; // ------------------------- // Subtitle // ------------------------- // Codec vm.Subtitle_Codec_IsEnabled = false; } // ------------------------- // Sequence // ------------------------- else if (vm.Format_MediaType_SelectedItem == "Sequence") { // ------------------------- // Format // ------------------------- // Hardware Acceleration vm.Format_HWAccel_IsEnabled = true; // Cut // Change if coming back from Image if (vm.Format_CutStart_IsEnabled == true && vm.Format_CutEnd_IsEnabled == false) { vm.Format_Cut_SelectedItem = "No"; } // YouTube vm.Format_YouTube_SelectedItem = "Video + Audio"; // ------------------------- // Video // ------------------------- // Codec vm.Video_Codec_IsEnabled = true; //Size vm.Video_Scale_IsEnabled = true; // Scaling vm.Video_ScalingAlgorithm_SelectedItem = "auto"; vm.Video_ScalingAlgorithm_IsEnabled = true; // Speed vm.Video_Speed_IsEnabled = true; // Screen Format vm.Video_ScreenFormat_IsEnabled = true; // Aspect Ratio vm.Video_AspectRatio_IsEnabled = true; // Crop vm.Video_Crop_IsEnabled = true; // Speed vm.Video_EncodeSpeed_IsEnabled = false; // FPS vm.Video_FPS_IsEnabled = true; // ------------------------- // Audio // ------------------------- // Codec vm.Audio_Codec_IsEnabled = false; // Audio Stream //vm.Audio_Stream_SelectedItem = "none"; //AudioStreamControls(vm); // Selected Item vm.Audio_Stream_IsEnabled = false; // Channel vm.Audio_Channel_SelectedItem = "Source"; vm.Audio_Channel_IsEnabled = false; // Quality vm.Audio_Quality_SelectedItem = "None"; vm.Audio_Quality_IsEnabled = false; // Compression Level vm.Audio_CompressionLevel_SelectedItem = "auto"; vm.Audio_CompressionLevel_IsEnabled = false; // Sample Rate vm.Audio_SampleRate_SelectedItem = "auto"; vm.Audio_SampleRate_IsEnabled = false; // Bit Depth vm.Audio_BitDepth_SelectedItem = "auto"; vm.Audio_BitDepth_IsEnabled = false; // Volume vm.Audio_Volume_IsEnabled = false; // Limiter vm.Audio_HardLimiter_IsEnabled = false; vm.Audio_HardLimiter_Value = 1; // ------------------------- // Subtitle // ------------------------- // Codec vm.Subtitle_Codec_IsEnabled = false; } // ------------------------- // Reset to 0 if Disabled // ------------------------- if (vm.Format_CutStart_IsEnabled == false && vm.Format_CutEnd_IsEnabled == false) { // Start vm.Format_CutStart_Hours_Text = "00"; vm.Format_CutStart_Minutes_Text = "00"; vm.Format_CutStart_Seconds_Text = "00"; vm.Format_CutStart_Milliseconds_Text = "000"; // End vm.Format_CutEnd_Hours_Text = "00"; vm.Format_CutEnd_Minutes_Text = "00"; vm.Format_CutEnd_Seconds_Text = "00"; vm.Format_CutEnd_Milliseconds_Text = "000"; } }
// ------------------------- // Unchecked // ------------------------- public static void Controls_Unhecked(ViewModel vm) { // None }
/// <summary> /// Import axiom.conf file /// </summary> public static void ImportConfig(MainWindow mainwindow, ViewModel vm) { try { List <string> listFailedImports = new List <string>(); // Start INI File Read Configure.INIFile conf = null; // ------------------------- // Check if axiom.conf file exists in C:\ProgramData\Axiom UI\ // ------------------------- if (File.Exists(configFile)) { conf = new Configure.INIFile(configFile); // Read ReadConfig(mainwindow, vm, conf); } // ------------------------- // Check if axiom.conf file exists in App Dir // ------------------------- else if (File.Exists(MainWindow.appDir + "axiom.conf")) { conf = new Configure.INIFile(MainWindow.appDir + "axiom.conf"); // Read ReadConfig(mainwindow, vm, conf); } // ------------------------- // Preset ini file does not exist // ------------------------- else if (!File.Exists(configFile)) { MessageBox.Show("Confg file axiom.conf does not exist.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } // -------------------------------------------------- // Failed Imports // -------------------------------------------------- if (listFailedImports.Count > 0 && listFailedImports != null) { Profiles.failedImportMessage = string.Join(Environment.NewLine, listFailedImports); // Detect which screen we're on var allScreens = System.Windows.Forms.Screen.AllScreens.ToList(); var thisScreen = allScreens.SingleOrDefault(s => mainwindow.Left >= s.WorkingArea.Left && mainwindow.Left < s.WorkingArea.Right); // Start Window FailedImportWindow failedimportwindow = new FailedImportWindow(); // Position Relative to MainWindow failedimportwindow.Left = Math.Max((mainwindow.Left + (mainwindow.Width - failedimportwindow.Width) / 2), thisScreen.WorkingArea.Left); failedimportwindow.Top = Math.Max((mainwindow.Top + (mainwindow.Height - failedimportwindow.Height) / 2), thisScreen.WorkingArea.Top); // Open Window failedimportwindow.Show(); } } // Error Loading axiom.conf // catch { // Delete axiom.conf and Restart // Check if axiom.conf Exists if (File.Exists(configFile)) { // Yes/No Dialog Confirmation // MessageBoxResult result = MessageBox.Show( "Could not load axiom.conf. \n\nDelete config and reload defaults?", "Error", MessageBoxButton.YesNo, MessageBoxImage.Error); switch (result) { // Create case MessageBoxResult.Yes: File.Delete(configFile); // Reload Control Defaults vm.LoadConfigDefaults(); vm.LoadControlsDefaults(); // Restart Program Process.Start(Application.ResourceAssembly.Location); Application.Current.Shutdown(); break; // Use Default case MessageBoxResult.No: // Force Shutdown System.Windows.Forms.Application.ExitThread(); Environment.Exit(0); return; } } // If axiom.conf Not Found else { MessageBox.Show("No Previous Config File Found.", "Notice", MessageBoxButton.OK, MessageBoxImage.Information); return; } } }
// ------------------------- // Disabled // ------------------------- public static void Controls_Disable(ViewModel vm) { // None }
// ------------------------- // Pass // ------------------------- public static void EncodingPass(ViewModel vm) { // ------------------------- // Quality // ------------------------- // Auto if (vm.Video_Quality_SelectedItem == "Auto") { vm.Video_Pass_Items = new List <string>() { "1 Pass" }; vm.Video_Pass_SelectedItem = "1 Pass"; vm.Video_Pass_IsEnabled = false; VideoControls.passUserSelected = false; vm.Video_CRF_IsEnabled = false; } // Custom else if (vm.Video_Quality_SelectedItem == "Custom") { vm.Video_Pass_Items = new List <string>() { "1 Pass" }; vm.Video_Pass_IsEnabled = false; vm.Video_CRF_IsEnabled = true; } // None else if (vm.Video_Quality_SelectedItem == "None") { vm.Video_Pass_Items = new List <string>() { "auto" }; vm.Video_Pass_IsEnabled = false; vm.Video_CRF_IsEnabled = false; } // Presets: Ultra, High, Medium, Low, Sub else { vm.Video_Pass_Items = new List <string>() { "1 Pass" }; vm.Video_Pass_IsEnabled = false; vm.Video_CRF_IsEnabled = false; // Default to 1 Pass if (VideoControls.passUserSelected == false) { vm.Video_Pass_SelectedItem = "1 Pass"; VideoControls.passUserSelected = true; } } // Clear TextBoxes if (vm.Video_Quality_SelectedItem == "Auto" || vm.Video_Quality_SelectedItem == "Lossless" || vm.Video_Quality_SelectedItem == "Custom" || vm.Video_Quality_SelectedItem == "None" ) { vm.Video_CRF_Text = string.Empty; vm.Video_BitRate_Text = string.Empty; vm.Video_MinRate_Text = string.Empty; vm.Video_MaxRate_Text = string.Empty; vm.Video_BufSize_Text = string.Empty; } }
// ------------------------- // Selected Items // ------------------------- public static void Controls_Selected(ViewModel vm) { // Stream vm.Subtitle_Stream_SelectedItem = "all"; }
// --------------------------------------------------------------------------- // Codec // --------------------------------------------------------------------------- public static void Codec_Set(ViewModel vm) { vm.Subtitle_Codec = string.Empty; }