Esempio n. 1
0
        /// <summary>
        ///     Set Controls
        /// </summary>
        public static void SetControls(ViewModel vm, string selectedCodec)
        {
            // --------------------------------------------------
            // Codec
            // --------------------------------------------------

            // -------------------------
            // MOV_Text
            // -------------------------
            if (selectedCodec == "MOV Text")
            {
                // Codec
                MOV_Text.Codec_Set(vm);

                // Items Source
                MOV_Text.Controls_ItemsSource(vm);

                // Selected Items
                MOV_Text.Controls_Selected(vm);

                // Checked
                MOV_Text.Controls_Checked(vm);

                // Unhecked
                MOV_Text.Controls_Unhecked(vm);

                // Enabled
                MOV_Text.Controls_Enable(vm);

                // Disabled
                MOV_Text.Controls_Disable(vm);
            }

            // -------------------------
            // SSA
            // -------------------------
            else if (selectedCodec == "SSA")
            {
                // Codec
                SSA.Codec_Set(vm);

                // Items Source
                SSA.Controls_ItemsSource(vm);

                // Selected Items
                SSA.Controls_Selected(vm);

                // Checked
                SSA.Controls_Checked(vm);

                // Unhecked
                SSA.Controls_Unhecked(vm);

                // Enabled
                SSA.Controls_Enable(vm);

                // Disabled
                SSA.Controls_Disable(vm);
            }

            // -------------------------
            // SRT
            // -------------------------
            else if (selectedCodec == "SRT")
            {
                // Codec
                SRT.Codec_Set(vm);

                // Items Source
                SRT.Controls_ItemsSource(vm);

                // Selected Items
                SRT.Controls_Selected(vm);

                // Checked
                SRT.Controls_Checked(vm);

                // Unhecked
                SRT.Controls_Unhecked(vm);

                // Enabled
                SRT.Controls_Enable(vm);

                // Disabled
                SRT.Controls_Disable(vm);
            }

            // -------------------------
            // Burn
            // -------------------------
            else if (selectedCodec == "Burn")
            {
                // Codec
                Burn.Codec_Set(vm);

                // Items Source
                Burn.Controls_ItemsSource(vm);

                // Selected Items
                Burn.Controls_Selected(vm);

                // Checked
                Burn.Controls_Checked(vm);

                // Unhecked
                Burn.Controls_Unhecked(vm);

                // Enabled
                Burn.Controls_Enable(vm);

                // Disabled
                Burn.Controls_Disable(vm);
            }

            // -------------------------
            // Copy
            // -------------------------
            else if (selectedCodec == "Copy")
            {
                // Codec
                SubtitleCopy.Codec_Set(vm);

                // Items Source
                SubtitleCopy.Controls_ItemsSource(vm);

                // Selected Items
                SubtitleCopy.Controls_Selected(vm);

                // Checked
                SubtitleCopy.Controls_Checked(vm);

                // Unhecked
                SubtitleCopy.Controls_Unhecked(vm);

                // Enabled
                SubtitleCopy.Controls_Enable(vm);

                // Disabled
                SubtitleCopy.Controls_Disable(vm);
            }

            // -------------------------
            // None
            // -------------------------
            else if (selectedCodec == "None")
            {
                // Codec
                SubtitleNone.Codec_Set(vm);

                // Items Source
                SubtitleNone.Controls_ItemsSource(vm);

                // Selected Items
                SubtitleNone.Controls_Selected(vm);

                // Checked
                SubtitleNone.Controls_Checked(vm);

                // Unhecked
                SubtitleNone.Controls_Unhecked(vm);

                // Enabled
                SubtitleNone.Controls_Enable(vm);

                // Disabled
                SubtitleNone.Controls_Disable(vm);
            }

            // --------------------------------------------------
            // Default Selected Item
            // --------------------------------------------------
            // Video
            //vm.Video_Quality_SelectedItem = SelectedItem(vm.Video_Quality_Items,
            //                                            vm.Video_Quality_SelectedItem
            //                                            );


            // --------------------------------------------------
            // Selected Items
            // --------------------------------------------------
            // -------------------------
            // None Codec
            // -------------------------
            if (vm.Subtitle_Codec_SelectedItem == "None")
            {
                vm.Subtitle_Stream_SelectedItem = "none";
                vm.Subtitle_Stream_IsEnabled    = false;
            }

            // -------------------------
            // Burn Codec
            // -------------------------
            else if (vm.Subtitle_Codec_SelectedItem == "Burn")
            {
                // Force Select External
                // Can't burn All subtitle streams
                vm.Subtitle_Stream_SelectedItem = "external";
                vm.Subtitle_Stream_IsEnabled    = true;
            }

            // -------------------------
            // Copy Codec
            // -------------------------
            else if (vm.Subtitle_Codec_SelectedItem == "Copy")
            {
                vm.Subtitle_Stream_IsEnabled = true;
            }

            // -------------------------
            // All Other Codecs
            // -------------------------
            else
            {
                vm.Subtitle_Stream_IsEnabled = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Set Controls
        /// </summary>
        public static void SetControls(string selectedCodec)
        {
            // --------------------------------------------------
            // Codec
            // --------------------------------------------------

            switch (selectedCodec)
            {
            // -------------------------
            // MOV_Text
            // -------------------------
            case "MOV Text":
                // Codec
                MOV_Text.Codec_Set();

                // Items Source
                MOV_Text.Controls_ItemsSource();
                // Selected Items
                MOV_Text.Controls_Selected();

                // Checked
                MOV_Text.Controls_Checked();
                // Unhecked
                MOV_Text.Controls_Unhecked();

                // Enabled
                MOV_Text.Controls_Enable();
                // Disabled
                MOV_Text.Controls_Disable();
                break;

            // -------------------------
            // SSA
            // -------------------------
            case "SSA":
                // Codec
                SSA.Codec_Set();

                // Items Source
                SSA.Controls_ItemsSource();
                // Selected Items
                SSA.Controls_Selected();

                // Checked
                SSA.Controls_Checked();
                // Unhecked
                SSA.Controls_Unhecked();

                // Enabled
                SSA.Controls_Enable();
                // Disabled
                SSA.Controls_Disable();
                break;

            // -------------------------
            // SRT
            // -------------------------
            case "SRT":
                // Codec
                SRT.Codec_Set();

                // Items Source
                SRT.Controls_ItemsSource();
                // Selected Items
                SRT.Controls_Selected();

                // Checked
                SRT.Controls_Checked();
                // Unhecked
                SRT.Controls_Unhecked();

                // Enabled
                SRT.Controls_Enable();
                // Disabled
                SRT.Controls_Disable();
                break;

            // -------------------------
            // Burn
            // -------------------------
            case "Burn":
                // Codec
                Burn.Codec_Set();

                // Items Source
                Burn.Controls_ItemsSource();
                // Selected Items
                Burn.Controls_Selected();

                // Checked
                Burn.Controls_Checked();
                // Unhecked
                Burn.Controls_Unhecked();

                // Enabled
                Burn.Controls_Enable();
                // Disabled
                Burn.Controls_Disable();
                break;

            // -------------------------
            // Copy
            // -------------------------
            case "Copy":
                // Codec
                SubtitleCopy.Codec_Set();

                // Items Source
                SubtitleCopy.Controls_ItemsSource();
                // Selected Items
                SubtitleCopy.Controls_Selected();

                // Checked
                SubtitleCopy.Controls_Checked();
                // Unhecked
                SubtitleCopy.Controls_Unhecked();

                // Enabled
                SubtitleCopy.Controls_Enable();
                // Disabled
                SubtitleCopy.Controls_Disable();
                break;

            // -------------------------
            // None
            // -------------------------
            case "None":
                // Codec
                SubtitleNone.Codec_Set();

                // Items Source
                SubtitleNone.Controls_ItemsSource();
                // Selected Items
                SubtitleNone.Controls_Selected();

                // Checked
                SubtitleNone.Controls_Checked();
                // Unhecked
                SubtitleNone.Controls_Unhecked();

                // Enabled
                SubtitleNone.Controls_Enable();
                // Disabled
                SubtitleNone.Controls_Disable();
                break;
            }

            // --------------------------------------------------
            // Default Selected Item
            // --------------------------------------------------
            // Video
            //VM.VideoView.Video_Quality_SelectedItem = SelectedItem(VM.VideoView.Video_Quality_Items,
            //                                            VM.VideoView.Video_Quality_SelectedItem
            //                                            );


            // --------------------------------------------------
            // Selected Items
            // --------------------------------------------------
            // -------------------------
            // None Codec
            // -------------------------
            if (VM.SubtitleView.Subtitle_Codec_SelectedItem == "None")
            {
                VM.SubtitleView.Subtitle_Stream_SelectedItem = "none";
                VM.SubtitleView.Subtitle_Stream_IsEnabled    = false;
            }

            // -------------------------
            // Burn Codec
            // -------------------------
            else if (VM.SubtitleView.Subtitle_Codec_SelectedItem == "Burn")
            {
                // Force Select External
                // Can't burn All subtitle streams
                VM.SubtitleView.Subtitle_Stream_SelectedItem = "external";
                VM.SubtitleView.Subtitle_Stream_IsEnabled    = true;
            }

            // -------------------------
            // Copy Codec
            // -------------------------
            else if (VM.SubtitleView.Subtitle_Codec_SelectedItem == "Copy")
            {
                VM.SubtitleView.Subtitle_Stream_IsEnabled = true;
            }

            // -------------------------
            // All Other Codecs
            // -------------------------
            else
            {
                VM.SubtitleView.Subtitle_Stream_IsEnabled = true;
            }
        }