示例#1
0
        public void InitializeDropdowns()
        {
            audioCodec.Items.Clear();
            audioCodec.Items.AddRange(mainForm.PackageSystem.AudioSettingsProviders.ValuesArray);
            try { audioCodec.SelectedItem = mainForm.PackageSystem.AudioSettingsProviders["NAAC"]; }
            catch (Exception)
            {
                try { audioCodec.SelectedIndex = 0; }
                catch (Exception) { MessageBox.Show("No valid audio codecs are set up", "No valid audio codecs", MessageBoxButtons.OK, MessageBoxIcon.Error); }
            }

            fileTypeHandler = new FileTypeHandler <AudioType>(audioContainer, audioCodec, new FileTypeHandler <AudioType> .SupportedOutputGetter(delegate
            {
                return(audioEncoderProvider.GetSupportedOutput(codecHandler.CurrentSettingsProvider.EncoderType));
            }));

            codecHandler = new MultipleConfigurersHandler <AudioCodecSettings, string[], AudioCodec, AudioEncoderType>(audioCodec);

            profileHandler = new ProfilesControlHandler <AudioCodecSettings, string[]>("Audio", mainForm, profileControl1, codecHandler.EditSettings,
                                                                                       new InfoGetter <string[]>(delegate { return(new string[] { AudioInput, AudioOutput }); }), codecHandler.Getter, codecHandler.Setter);

            profileHandler.ConfigureCompleted += new EventHandler(profileHandler_ConfigureCompleted);
            codecHandler.Register(profileHandler);
            fileTypeHandler.RefreshFiletypes();
        }
        private void initAudioHandler()
        {
            this.audioCodec.Items.AddRange(mainForm.PackageSystem.AudioSettingsProviders.ValuesArray);
            try
            {
                this.audioCodec.SelectedItem = mainForm.PackageSystem.AudioSettingsProviders["ND AAC"];
            }
            catch (Exception) { }

            // Init audio handlers
            audioCodecHandler   = new MultipleConfigurersHandler <AudioCodecSettings, string[], AudioCodec, AudioEncoderType>(audioCodec);
            audioProfileHandler = new ProfilesControlHandler <AudioCodecSettings, string[]>("Audio", mainForm, audioProfileControl, audioCodecHandler.EditSettings,
                                                                                            new InfoGetter <string[]>(delegate { return(new string[] { "input", "output" }); }), audioCodecHandler.Getter, audioCodecHandler.Setter);
            audioCodecHandler.Register(audioProfileHandler);
        }
 private void initVideoHandler()
 {
     this.videoCodec.Items.AddRange(mainForm.PackageSystem.VideoSettingsProviders.ValuesArray);
     try
     {
         this.videoCodec.SelectedItem = mainForm.PackageSystem.VideoSettingsProviders["x264"];
     }
     catch (Exception) { }
     // Init Video handlers
     videoCodecHandler =
         new MultipleConfigurersHandler <VideoCodecSettings, VideoInfo, VideoCodec, VideoEncoderType>(videoCodec);
     videoProfileHandler =
         new ProfilesControlHandler <VideoCodecSettings, VideoInfo>("Video", mainForm, videoProfileControl,
                                                                    videoCodecHandler.EditSettings, new InfoGetter <VideoInfo>(delegate() { return(new VideoInfo()); }),
                                                                    videoCodecHandler.Getter, videoCodecHandler.Setter);
     videoCodecHandler.Register(videoProfileHandler);
 }
示例#4
0
        public void InitializeDropdowns()
        {
            videoCodec.Items.Clear();
            videoCodec.Items.AddRange(mainForm.PackageSystem.VideoSettingsProviders.ValuesArray);
            try { videoCodec.SelectedItem = mainForm.PackageSystem.VideoSettingsProviders["x264"]; }
            catch (Exception)
            {
                try { videoCodec.SelectedIndex = 0; }
                catch (Exception) { MessageBox.Show("No valid video codecs are set up", "No valid video codecs", MessageBoxButtons.OK, MessageBoxIcon.Error); }
            }


            fileTypeHandler = new FileTypeHandler <VideoType>(fileType, videoCodec,
                                                              new FileTypeHandler <VideoType> .SupportedOutputGetter(delegate
            {
                return(videoEncoderProvider.GetSupportedOutput(codecHandler.CurrentSettingsProvider.EncoderType));
            }));

            fileTypeHandler.FileTypeChanged += new FileTypeHandler <VideoType> .FileTypeEvent(delegate
                                                                                              (object sender, VideoType currentType) {
                VideoCodecSettings settings = CurrentSettings;
                this.updateIOConfig();
                if (MainForm.verifyOutputFile(this.VideoOutput) == null)
                {
                    this.VideoOutput = Path.ChangeExtension(this.VideoOutput, currentType.Extension);
                }
            });

            codecHandler =
                new MultipleConfigurersHandler <VideoCodecSettings, VideoInfo, VideoCodec, VideoEncoderType>(videoCodec);

            profileHandler = new ProfilesControlHandler <VideoCodecSettings, VideoInfo>("Video", mainForm, profileControl1,
                                                                                        codecHandler.EditSettings, new InfoGetter <VideoInfo>(getInfo),
                                                                                        codecHandler.Getter, codecHandler.Setter);
            codecHandler.Register(profileHandler);
            fileTypeHandler.RefreshFiletypes();
        }