当前位置: 首页>>代码示例>>C#>>正文


C# frmMain.setContainerOpts方法代码示例

本文整理汇总了C#中frmMain.setContainerOpts方法的典型用法代码示例。如果您正苦于以下问题:C# frmMain.setContainerOpts方法的具体用法?C# frmMain.setContainerOpts怎么用?C# frmMain.setContainerOpts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在frmMain的用法示例。


在下文中一共展示了frmMain.setContainerOpts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadPreset

        /// <summary>
        /// This function takes in a Query which has been parsed by QueryParser and
        /// set's all the GUI widgets correctly.
        /// </summary>
        /// <param name="mainWindow">
        /// FrmMain window
        /// </param>
        /// <param name="presetQuery">
        /// The Parsed CLI Query
        /// </param>
        /// <param name="name">
        /// Name of the preset
        /// </param>
        public static void LoadPreset(frmMain mainWindow, EncodeTask presetQuery, string name)
        {
            #region Source

            // Reset some vaules to stock first to prevent errors.
            mainWindow.check_iPodAtom.CheckState = CheckState.Unchecked;

            // Now load all the new settings onto the main window
            string destination = mainWindow.text_destination.Text;
            destination = destination.Replace(".mp4", "." + presetQuery.OutputFormat);
            destination = destination.Replace(".m4v", "." + presetQuery.OutputFormat);
            destination = destination.Replace(".mkv", "." + presetQuery.OutputFormat);
            mainWindow.text_destination.Text = destination;

            #endregion

            #region Destination and Output Settings

            if (presetQuery.OutputFormat == OutputFormat.Mp4 || presetQuery.OutputFormat == OutputFormat.M4V)
            {
                if (mainWindow.drop_format.SelectedIndex == 0)
                {
                    mainWindow.SetExtension(".mp4");
                }
                else
                {
                    mainWindow.drop_format.SelectedIndex = 0;
                }
            }
            else if (presetQuery.OutputFormat == OutputFormat.Mkv)
            {
                if (mainWindow.drop_format.SelectedIndex == 1)
                {
                    mainWindow.SetExtension(".mkv");
                }
                else
                {
                    mainWindow.drop_format.SelectedIndex = 1;
                }
            }

            mainWindow.check_iPodAtom.CheckState = presetQuery.IPod5GSupport ? CheckState.Checked : CheckState.Unchecked;

            mainWindow.check_optimiseMP4.CheckState = presetQuery.OptimizeMP4
                                                          ? CheckState.Checked
                                                          : CheckState.Unchecked;

            mainWindow.check_largeFile.CheckState = presetQuery.LargeFile ? CheckState.Checked : CheckState.Unchecked;

            mainWindow.setContainerOpts(); // select the container options according to the selected format

            #endregion

            #region Picture

            mainWindow.PictureSettings.check_autoCrop.Checked = true;
            if (presetQuery.IsCustomCropping)
            {
                mainWindow.PictureSettings.check_customCrop.Checked = true;
                mainWindow.PictureSettings.crop_top.Value = presetQuery.Cropping.Top;
                mainWindow.PictureSettings.crop_bottom.Value = presetQuery.Cropping.Bottom;
                mainWindow.PictureSettings.crop_left.Value = presetQuery.Cropping.Left;
                mainWindow.PictureSettings.crop_right.Value = presetQuery.Cropping.Right;
            }

            // Set the anamorphic mode 0,1,2,3

            switch (presetQuery.Anamorphic)
            {
                case Anamorphic.None:
                    mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 0;
                    break;
                case Anamorphic.Strict:
                    mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 1;
                    break;
                case Anamorphic.Loose:
                    mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 2;
                    break;
                case Anamorphic.Custom:
                    mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 3;
                    break;
            }

            // Keep Aspect Ration Anamorphic Setting.
            mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.KeepDisplayAspect
                                                                     ? CheckState.Checked
                                                                     : CheckState.Unchecked;
//.........这里部分代码省略.........
开发者ID:bakotaco,项目名称:HandBrake,代码行数:101,代码来源:PresetLoader.cs

示例2: LoadPreset

        /// <summary>
        /// This function takes in a Query which has been parsed by QueryParser and
        /// set's all the GUI widgets correctly.
        /// </summary>
        /// <param name="mainWindow">
        /// FrmMain window
        /// </param>
        /// <param name="presetQuery">
        /// The Parsed CLI Query
        /// </param>
        /// <param name="name">
        /// Name of the preset
        /// </param>
        public static void LoadPreset(frmMain mainWindow, QueryParser presetQuery, string name)
        {
            #region Source

            // Reset some vaules to stock first to prevent errors.
            mainWindow.check_iPodAtom.CheckState = CheckState.Unchecked;

            // Now load all the new settings onto the main window
            if (presetQuery.Format != null)
            {
                string destination = mainWindow.text_destination.Text;
                destination = destination.Replace(".mp4", "." + presetQuery.Format);
                destination = destination.Replace(".m4v", "." + presetQuery.Format);
                destination = destination.Replace(".mkv", "." + presetQuery.Format);
                mainWindow.text_destination.Text = destination;
            }

            #endregion

            #region Destination and Output Settings

            if (presetQuery.Format != null)
            {
                if (presetQuery.Format == "mp4" || presetQuery.Format == "m4v")
                {
                    if (mainWindow.drop_format.SelectedIndex == 0)
                        mainWindow.SetExtension(".mp4");
                    else
                        mainWindow.drop_format.SelectedIndex = 0;
                }
                else if (presetQuery.Format == "mkv")
                {
                    if (mainWindow.drop_format.SelectedIndex == 1)
                        mainWindow.SetExtension(".mkv");
                    else
                        mainWindow.drop_format.SelectedIndex = 1;
                }
            }

            mainWindow.check_iPodAtom.CheckState = presetQuery.IpodAtom ? CheckState.Checked : CheckState.Unchecked;

            mainWindow.check_optimiseMP4.CheckState = presetQuery.OptimizeMP4
                                                          ? CheckState.Checked
                                                          : CheckState.Unchecked;

            mainWindow.check_largeFile.CheckState = presetQuery.LargeMP4 ? CheckState.Checked : CheckState.Unchecked;

            mainWindow.setContainerOpts(); // select the container options according to the selected format

            #endregion

            #region Picture

            mainWindow.PictureSettings.check_autoCrop.Checked = true;
            if (presetQuery.CropValues != null)
            {
                int top, bottom, left, right;
                int.TryParse(presetQuery.CropTop, out top);
                int.TryParse(presetQuery.CropBottom, out bottom);
                int.TryParse(presetQuery.CropLeft, out left);
                int.TryParse(presetQuery.CropRight, out right);

                mainWindow.PictureSettings.check_customCrop.Checked = true;
                mainWindow.PictureSettings.crop_top.Value = top;
                mainWindow.PictureSettings.crop_bottom.Value = bottom;
                mainWindow.PictureSettings.crop_left.Value = left;
                mainWindow.PictureSettings.crop_right.Value = right;
            }

            // Set the anamorphic mode 0,1,2,3
            mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;

            // Keep Aspect Ration Anamorphic Setting.
            mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.KeepDisplayAsect
                                                                     ? CheckState.Checked
                                                                     : CheckState.Unchecked;

            // Set the Width and height as Required.
            if (presetQuery.Width != 0)
                mainWindow.PictureSettings.text_width.Value = presetQuery.Width;

            if (presetQuery.Height != 0)
                mainWindow.PictureSettings.text_height.Value = presetQuery.Height;

            // Max Width/Height override Width/Height
            if (presetQuery.MaxWidth != 0)
                mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth;
//.........这里部分代码省略.........
开发者ID:griff,项目名称:HandBrake,代码行数:101,代码来源:PresetLoader.cs


注:本文中的frmMain.setContainerOpts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。