Example #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 initAvsHandler()
 {
     // Init AVS handlers
     avsProfileHandler = new ProfilesControlHandler <AviSynthSettings, Empty>(
         "AviSynth", mainForm, avsProfileControl, avsSettingsProvider.EditSettings, Empty.Getter,
         new SettingsGetter <AviSynthSettings>(avsSettingsProvider.GetCurrentSettings), new SettingsSetter <AviSynthSettings>(avsSettingsProvider.LoadSettings));
     SingleConfigurerHandler <AviSynthSettings, Empty, int, int> configurerHandler = new SingleConfigurerHandler <AviSynthSettings, Empty, int, int>(avsProfileHandler, avsSettingsProvider);
 }
 private void initX264Handler()
 {
     x264profileHandler = new ProfilesControlHandler <VideoCodecSettings, VideoInfo>(
         "Video:X264", this.mainForm, profileControl1, x264settingsProvider.EditSettings, new InfoGetter <VideoInfo>(delegate { return(info); }),
         new SettingsGetter <VideoCodecSettings>(delegate() { return(x264settingsProvider.GetCurrentSettings()); }),
         new SettingsSetter <VideoCodecSettings>(delegate(VideoCodecSettings s) { x264settingsProvider.LoadSettings(s); }));
     x264configHandler =
         new SingleConfigurerHandler <VideoCodecSettings, VideoInfo, VideoCodec, VideoEncoderType>(
             x264profileHandler, x264settingsProvider);
     x264configHandler.ProfileChanged += new SelectedProfileChangedEvent(configHandler_ProfileChanged);
 }
        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);
 }
Example #6
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();
        }
Example #7
0
        private void initOneClickHandler()
        {
            audioTrack = new List <FileSCBox>();
            audioTrack.Add(audioTrack1);
            audioTrack.Add(audioTrack2);

            trackLabel = new List <Label>();
            trackLabel.Add(track1Label);
            trackLabel.Add(track2Label);

            audioConfigControl = new List <AudioConfigControl>();
            audioConfigControl.Add(audio1);
            audioConfigControl.Add(audio2);

            // Init oneclick handlers
            ProfilesControlHandler <OneClickSettings, Empty> profileHandler = new ProfilesControlHandler <OneClickSettings, Empty>(
                "OneClick", mainForm, profileControl2, oneClickSettingsProvider.EditSettings, Empty.Getter,
                new SettingsGetter <OneClickSettings>(oneClickSettingsProvider.GetCurrentSettings), new SettingsSetter <OneClickSettings>(oneClickSettingsProvider.LoadSettings));
            SingleConfigurerHandler <OneClickSettings, Empty, int, int> configurerHandler = new SingleConfigurerHandler <OneClickSettings, Empty, int, int>(profileHandler, oneClickSettingsProvider);

            profileHandler.ProfileChanged     += new SelectedProfileChangedEvent(OneClickProfileChanged);
            profileHandler.ConfigureCompleted += new EventHandler(profileHandler_ConfigureCompleted);
            profileHandler.RefreshProfiles();
        }