public static bool passUserSelected = false; // Used to determine if User manually selected CRF, 1 Pass or 2 Pass /// <summary> /// Set Controls /// </summary> public static void SetControls(string codec_SelectedItem) { // -------------------------------------------------- // Codec // -------------------------------------------------- // -------------------------------------------------- // Video // -------------------------------------------------- switch (codec_SelectedItem) { // ------------------------- // VP8 // ------------------------- case "VP8": // Codec VP8.Codec_Set(); // Items Source VP8.Controls_ItemsSource(); // Selected Items VP8.Controls_Selected(); // Expanded VP8.Controls_Expanded(); // Collapsed VP8.Controls_Collapsed(); // Checked VP8.Controls_Checked(); // Unhecked VP8.Controls_Unhecked(); // Enabled VP8.Controls_Enable(); // Disabled VP8.Controls_Disable(); break; // ------------------------- // VP9 // ------------------------- case "VP9": // Codec VP9.Codec_Set(); // Items Source VP9.Controls_ItemsSource(); // Selected Items VP9.Controls_Selected(); // Expanded VP9.Controls_Expanded(); // Collapsed VP9.Controls_Collapsed(); // Checked VP9.Controls_Checked(); // Unhecked VP9.Controls_Unhecked(); // Enabled VP9.Controls_Enable(); // Disabled VP9.Controls_Disable(); break; // ------------------------- // x264 // ------------------------- case "x264": // Codec x264.Codec_Set(); // Items Source x264.Controls_ItemsSource(); // Selected Items x264.Controls_Selected(); // Expanded x264.Controls_Expanded(); // Collapsed x264.Controls_Collapsed(); // Checked x264.Controls_Checked(); // Unhecked x264.Controls_Unhecked(); // Enabled x264.Controls_Enable(); // Disabled x264.Controls_Disable(); break; // ------------------------- // x265 // ------------------------- case "x265": // Codec x265.Codec_Set(); // Items Source x265.Controls_ItemsSource(); // Selected Items x265.Controls_Selected(); // Expanded x265.Controls_Expanded(); // Collapsed x265.Controls_Collapsed(); // Checked x265.Controls_Checked(); // Unhecked x265.Controls_Unhecked(); // Enabled x265.Controls_Enable(); // Disabled x265.Controls_Disable(); break; // ------------------------- // AV1 // ------------------------- case "AV1": // Codec AV1.Codec_Set(); // Items Source AV1.Controls_ItemsSource(); // Selected Items AV1.Controls_Selected(); // Expanded AV1.Controls_Expanded(); // Collapsed AV1.Controls_Collapsed(); // Checked AV1.Controls_Checked(); // Unhecked AV1.Controls_Unhecked(); // Enabled AV1.Controls_Enable(); // Disabled AV1.Controls_Disable(); break; // ------------------------- // FFV1 // ------------------------- case "FFV1": // Codec FFV1.Codec_Set(); // Items Source FFV1.Controls_ItemsSource(); // Selected Items FFV1.Controls_Selected(); // Expanded FFV1.Controls_Expanded(); // Collapsed FFV1.Controls_Collapsed(); // Checked FFV1.Controls_Checked(); // Unhecked FFV1.Controls_Unhecked(); // Enabled FFV1.Controls_Enable(); // Disabled FFV1.Controls_Disable(); break; // ------------------------- // HuffYUV // ------------------------- case "HuffYUV": // Codec HuffYUV.Codec_Set(); // Items Source HuffYUV.Controls_ItemsSource(); // Selected Items HuffYUV.Controls_Selected(); // Expanded HuffYUV.Controls_Expanded(); // Collapsed HuffYUV.Controls_Collapsed(); // Checked HuffYUV.Controls_Checked(); // Unhecked HuffYUV.Controls_Unhecked(); // Enabled HuffYUV.Controls_Enable(); // Disabled HuffYUV.Controls_Disable(); break; // ------------------------- // Theora // ------------------------- case "Theora": // Codec Theora.Codec_Set(); // Items Source Theora.Controls_ItemsSource(); // Selected Items Theora.Controls_Selected(); // Expanded Theora.Controls_Expanded(); // Collapsed Theora.Controls_Collapsed(); // Checked Theora.Controls_Checked(); // Unhecked Theora.Controls_Unhecked(); // Enabled Theora.Controls_Enable(); // Disabled Theora.Controls_Disable(); break; // ------------------------- // MPEG-2 // ------------------------- case "MPEG-2": // Codec MPEG_2.Codec_Set(); // Items Source MPEG_2.Controls_ItemsSource(); // Selected Items MPEG_2.Controls_Selected(); // Expanded MPEG_2.Controls_Expanded(); // Collapsed MPEG_2.Controls_Collapsed(); // Checked MPEG_2.Controls_Checked(); // Unhecked MPEG_2.Controls_Unhecked(); // Enabled MPEG_2.Controls_Enable(); // Disabled MPEG_2.Controls_Disable(); break; // ------------------------- // MPEG-4 // ------------------------- case "MPEG-4": // Codec MPEG_4.Codec_Set(); // Items Source MPEG_4.Controls_ItemsSource(); // Selected Items MPEG_4.Controls_Selected(); // Expanded MPEG_4.Controls_Expanded(); // Collapsed MPEG_4.Controls_Collapsed(); // Checked MPEG_4.Controls_Checked(); // Unhecked MPEG_4.Controls_Unhecked(); // Enabled MPEG_4.Controls_Enable(); // Disabled MPEG_4.Controls_Disable(); break; // -------------------------------------------------- // Image // -------------------------------------------------- // ------------------------- // JPEG // ------------------------- case "JPEG": // Codec JPEG.Codec_Set(); // Items Source JPEG.Controls_ItemsSource(); // Selected Items JPEG.Controls_Selected(); // Expanded JPEG.Controls_Expanded(); // Collapsed JPEG.Controls_Collapsed(); // Checked JPEG.Controls_Checked(); // Unhecked JPEG.Controls_Unhecked(); // Enabled JPEG.Controls_Enable(); // Disabled JPEG.Controls_Disable(); break; // ------------------------- // PNG // ------------------------- case "PNG": // Codec PNG.Codec_Set(); // Items Source PNG.Controls_ItemsSource(); // Selected Items PNG.Controls_Selected(); // Expanded PNG.Controls_Expanded(); // Collapsed PNG.Controls_Collapsed(); // Checked PNG.Controls_Checked(); // Unhecked PNG.Controls_Unhecked(); // Enabled PNG.Controls_Enable(); // Disabled PNG.Controls_Disable(); break; // ------------------------- // WebP // ------------------------- case "WebP": // Codec WebP.Codec_Set(); // Items Source WebP.Controls_ItemsSource(); // Selected Items WebP.Controls_Selected(); // Expanded WebP.Controls_Expanded(); // Collapsed WebP.Controls_Collapsed(); // Checked WebP.Controls_Checked(); // Unhecked WebP.Controls_Unhecked(); // Enabled WebP.Controls_Enable(); // Disabled WebP.Controls_Disable(); break; // ------------------------- // Copy // ------------------------- case "Copy": // Codec VideoCopy.Codec_Set(); // Items Source VideoCopy.Controls_ItemsSource(); // Selected Items VideoCopy.Controls_Selected(); // Expanded VideoCopy.Controls_Expanded(); // Collapsed VideoCopy.Controls_Collapsed(); // Checked VideoCopy.Controls_Checked(); // Unhecked VideoCopy.Controls_Unhecked(); // Enabled VideoCopy.Controls_Enable(); // Disabled VideoCopy.Controls_Disable(); break; // ------------------------- // None // ------------------------- case "None": // Codec VideoNone.Codec_Set(); // Items Source VideoNone.Controls_ItemsSource(); // Selected Items VideoNone.Controls_Selected(); // Expanded VideoNone.Controls_Expanded(); // Collapsed VideoNone.Controls_Collapsed(); // Checked VideoNone.Controls_Checked(); // Unhecked VideoNone.Controls_Unhecked(); // Enabled VideoNone.Controls_Enable(); // Disabled VideoNone.Controls_Disable(); break; } // -------------------------------------------------- // Default Selected Item // Previous Items set in ViewModel _SelectedItem // -------------------------------------------------- // ------------------------- // Video Encode Speed Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.VideoView.Video_EncodeSpeed_SelectedItem) && VM.VideoView.Video_EncodeSpeed_SelectedItem != "none") { MainWindow.Video_EncodeSpeed_PreviousItem = VM.VideoView.Video_EncodeSpeed_SelectedItem; } VM.VideoView.Video_EncodeSpeed_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_EncodeSpeed_Items.Select(c => c.Name).ToList(), MainWindow.Video_EncodeSpeed_PreviousItem ); // ------------------------- // Video Quality Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.VideoView.Video_Quality_SelectedItem) && VM.VideoView.Video_Quality_SelectedItem != "None") { MainWindow.Video_Quality_PreviousItem = VM.VideoView.Video_Quality_SelectedItem; } VM.VideoView.Video_Quality_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_Quality_Items.Select(c => c.Name).ToList(), MainWindow.Video_Quality_PreviousItem ); // ------------------------- // Video Pass Selected Item // ------------------------- //if (!string.IsNullOrEmpty(VM.VideoView.Video_Pass_SelectedItem)) //{ // MainWindow.Video_EncodeSpeed_PreviousItem = VM.VideoView.Video_Pass_SelectedItem; //} //VM.VideoView.Video_Pass_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_Pass_Items, // MainWindow.Video_Pass_PreviousItem // ); // ------------------------- // Video Optimize Selected Item // ------------------------- // Problem, do not use, selects Web in mp4 when coming from webm //if (!string.IsNullOrEmpty(VM.VideoView.Video_Optimize_SelectedItem) && // VM.VideoView.Video_Optimize_SelectedItem != "None") //{ // MainWindow.VideoOptimize_PreviousItem = VM.VideoView.Video_Optimize_SelectedItem; //} //VM.VideoView.Video_Optimize_SelectedItem = MainWindow.SelectedItem(VM.VideoView.Video_Optimize_Items.Select(c => c.Name).ToList(), // MainWindow.VideoOptimize_PreviousItem // ); }
/// <summary> /// Set Controls /// </summary> public static void SetControls(string codec_SelectedItem) { // -------------------------------------------------- // Codec // -------------------------------------------------- // ------------------------- // Vorbis // ------------------------- if (codec_SelectedItem == "Vorbis") { // Codec Vorbis.Codec_Set(); // Items Source Vorbis.Controls_ItemsSource(); // Selected Items Vorbis.Controls_Selected(); // Checked Vorbis.Controls_Checked(); // Unhecked Vorbis.Controls_Unhecked(); // Enabled Vorbis.Controls_Enable(); // Disabled Vorbis.Controls_Disable(); } // ------------------------- // Opus // ------------------------- else if (codec_SelectedItem == "Opus") { // Codec Opus.Codec_Set(); // Items Source Opus.Controls_ItemsSource(); // Selected Items Opus.Controls_Selected(); // Checked Opus.Controls_Checked(); // Unhecked Opus.Controls_Unhecked(); // Enabled Opus.Controls_Enable(); // Disabled Opus.Controls_Disable(); } // ------------------------- // AC3 // ------------------------- else if (codec_SelectedItem == "AC3") { // Codec AC3.Codec_Set(); // Items Source AC3.Controls_ItemsSource(); // Selected Items AC3.Controls_Selected(); // Checked AC3.Controls_Checked(); // Unhecked AC3.Controls_Unhecked(); // Enabled AC3.Controls_Enable(); // Disabled AC3.Controls_Disable(); } // ------------------------- // AAC // ------------------------- else if (codec_SelectedItem == "AAC") { // Codec AAC.Codec_Set(); // Items Source AAC.Controls_ItemsSource(); // Selected Items AAC.Controls_Selected(); // Checked AAC.Controls_Checked(); // Unhecked AAC.Controls_Unhecked(); // Enabled AAC.Controls_Enable(); // Disabled AAC.Controls_Disable(); } // ------------------------- // DTS // ------------------------- else if (codec_SelectedItem == "DTS") { // Codec DTS.Codec_Set(); // Items Source DTS.Controls_ItemsSource(); // Selected Items DTS.Controls_Selected(); // Checked DTS.Controls_Checked(); // Unhecked DTS.Controls_Unhecked(); // Enabled DTS.Controls_Enable(); // Disabled DTS.Controls_Disable(); } // ------------------------- // MP2 // ------------------------- else if (codec_SelectedItem == "MP2") { // Codec MP2.Codec_Set(); // Items Source MP2.Controls_ItemsSource(); // Selected Items MP2.Controls_Selected(); // Checked MP2.Controls_Checked(); // Unhecked MP2.Controls_Unhecked(); // Enabled MP2.Controls_Enable(); // Disabled MP2.Controls_Disable(); } // ------------------------- // LAME // ------------------------- else if (codec_SelectedItem == "LAME") { // Codec LAME.Codec_Set(); // Items Source LAME.Controls_ItemsSource(); // Selected Items LAME.Controls_Selected(); // Checked LAME.Controls_Checked(); // Unhecked LAME.Controls_Unhecked(); // Enabled LAME.Controls_Enable(); // Disabled LAME.Controls_Disable(); } // ------------------------- // ALAC // ------------------------- else if (codec_SelectedItem == "ALAC") { // Codec ALAC.Codec_Set(); // Items Source ALAC.Controls_ItemsSource(); // Selected Items ALAC.Controls_Selected(); // Checked ALAC.Controls_Checked(); // Unhecked ALAC.Controls_Unhecked(); // Enabled ALAC.Controls_Enable(); // Disabled ALAC.Controls_Disable(); } // ------------------------- // FLAC // ------------------------- else if (codec_SelectedItem == "FLAC") { // Codec FLAC.Codec_Set(); // Items Source FLAC.Controls_ItemsSource(); // Selected Items FLAC.Controls_Selected(); // Checked FLAC.Controls_Checked(); // Unhecked FLAC.Controls_Unhecked(); // Enabled FLAC.Controls_Enable(); // Disabled FLAC.Controls_Disable(); } // ------------------------- // PCM // ------------------------- else if (codec_SelectedItem == "PCM") { // Codec PCM.Codec_Set(); // Items Source PCM.Controls_ItemsSource(); // Selected Items PCM.Controls_Selected(); // Checked PCM.Controls_Checked(); // Unhecked PCM.Controls_Unhecked(); // Enabled PCM.Controls_Enable(); // Disabled PCM.Controls_Disable(); } // ------------------------- // Copy // ------------------------- else if (codec_SelectedItem == "Copy") { // Codec AudioCopy.Codec_Set(); // Items Source AudioCopy.Controls_ItemsSource(); // Selected Items AudioCopy.Controls_Selected(); // Checked AudioCopy.Controls_Checked(); // Unhecked AudioCopy.Controls_Unhecked(); // Enabled AudioCopy.Controls_Enable(); // Disabled AudioCopy.Controls_Disable(); } // ------------------------- // None // ------------------------- else if (codec_SelectedItem == "None") { // Codec AudioNone.Codec_Set(); // Items Source AudioNone.Controls_ItemsSource(); // Selected Items AudioNone.Controls_Selected(); // Checked AudioNone.Controls_Checked(); // Unhecked AudioNone.Controls_Unhecked(); // Enabled AudioNone.Controls_Enable(); // Disabled AudioNone.Controls_Disable(); } // -------------------------------------------------- // Default Selected Item // -------------------------------------------------- // ------------------------- // Audio Quality Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.AudioView.Audio_Quality_SelectedItem) && VM.AudioView.Audio_Quality_SelectedItem != "None" && VM.AudioView.Audio_Quality_SelectedItem != "none") { MainWindow.Audio_Quality_PreviousItem = VM.AudioView.Audio_Quality_SelectedItem; } VM.AudioView.Audio_Quality_SelectedItem = MainWindow.SelectedItem(VM.AudioView.Audio_Quality_Items.Select(c => c.Name).ToList(), MainWindow.Audio_Quality_PreviousItem ); // ------------------------- // Audio SampleRate Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.AudioView.Audio_SampleRate_SelectedItem) && VM.AudioView.Audio_SampleRate_SelectedItem != "None" && VM.AudioView.Audio_SampleRate_SelectedItem != "none") { MainWindow.Audio_SampleRate_PreviousItem = VM.AudioView.Audio_SampleRate_SelectedItem; } VM.AudioView.Audio_SampleRate_SelectedItem = MainWindow.SelectedItem(VM.AudioView.Audio_SampleRate_Items.Select(c => c.Name).ToList(), MainWindow.Audio_SampleRate_PreviousItem ); // ------------------------- // Audio BitDepth Selected Item // ------------------------- if (!string.IsNullOrEmpty(VM.AudioView.Audio_BitDepth_SelectedItem) && VM.AudioView.Audio_BitDepth_SelectedItem != "None" && VM.AudioView.Audio_BitDepth_SelectedItem != "none") { MainWindow.Audio_BitDepth_PreviousItem = VM.AudioView.Audio_BitDepth_SelectedItem; } VM.AudioView.Audio_BitDepth_SelectedItem = MainWindow.SelectedItem(VM.AudioView.Audio_BitDepth_Items.Select(c => c.Name).ToList(), MainWindow.Audio_BitDepth_PreviousItem ); }