private void buttonCopyInsert_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                int index = listBoxEncodingProfiles.SelectedIndex;
                if (index > -1)
                {
                    EncodingSettings es = new EncodingSettings(settings.encodingSettings[index]);
                    es.desc = "Copy " + es.desc;
                    settings.encodingSettings.Add(es);
                    UpdateEncodingProfile();

                    EditEncodingProfileWindow eepw = new EditEncodingProfileWindow(settings.encodingSettings[settings.encodingSettings.Count - 1]);
                    eepw.ShowDialog();
                    if (eepw.DialogResult == true)
                    {
                        settings.encodingSettings[settings.encodingSettings.Count - 1] = new EncodingSettings(eepw.encodingSettings);
                        UpdateEncodingProfile();
                        listBoxEncodingProfiles.SelectedIndex = settings.encodingSettings.Count - 1;
                    }
                    else
                    {
                        settings.encodingSettings.RemoveAt(settings.encodingSettings.Count - 1);
                        UpdateEncodingProfile();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
        public EditEncodingProfileWindow(EncodingSettings es)
        {            
            try
            {
                InitializeComponent();
                this.es = new EncodingSettings(es);
                textBoxDescription.Text = es.desc;
                textBoxSettings.Text = es.settings;
                textBoxSettings2.Text = es.settings2;
                textBoxSizeValue.Text = es.sizeValue.ToString();
                comboBoxSizeType.SelectedIndex = (int)es.sizeType;
                checkBox2pass.IsChecked = es.pass2;
                
                comboBoxProfile.ItemsSource = GlobalVars.profile;
                comboBoxPreset.ItemsSource = GlobalVars.preset;
                comboBoxTune.ItemsSource = GlobalVars.tune;
                comboBoxLevel.ItemsSource = GlobalVars.level;
                comboBoxAqmode.ItemsSource = GlobalVars.aqmode;
                comboBoxBadapt.ItemsSource = GlobalVars.badapt;

                textBoxCrf.Text = es.crf.ToString("f1");
                textBoxBframes.Text = es.bframes.ToString();
                textBoxRef.Text = es.refvalue.ToString();

                checkBoxFastdecode.IsChecked = es.fastdecode;
                checkBoxNofastpskip.IsChecked = es.nofastpskip;
                checkBoxZerolatency.IsChecked = es.zerolatency;
                checkBoxSlowfirstpass.IsChecked = es.slowfirstpass;

                if (es.profile > -1 && es.profile < GlobalVars.profile.Count) comboBoxProfile.SelectedIndex = es.profile;
                if (es.preset > -1 && es.preset < GlobalVars.preset.Count) comboBoxPreset.SelectedIndex = es.preset;
                if (es.tune > -1 && es.tune < GlobalVars.tune.Count) comboBoxTune.SelectedIndex = es.tune;
                if (es.level > -1 && es.level < GlobalVars.level.Count) comboBoxLevel.SelectedIndex = es.level;
                if (es.aqmode > -1 && es.aqmode < GlobalVars.aqmode.Count) comboBoxAqmode.SelectedIndex = es.aqmode;
                if (es.badapt > -1 && es.badapt < GlobalVars.badapt.Count) comboBoxBadapt.SelectedIndex = es.badapt;

                checkBox2pass_Checked(null, null);

                UpdateParams();
            }
            catch (Exception ex)
            {
                Global.ErrorMsg(ex);
            }
        }
 private void buttonProfileAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         EncodingSettings es = new EncodingSettings();
         es.desc = Global.Res("NewEncodingProfileDesc");
         EditEncodingProfileWindow eepw = new EditEncodingProfileWindow(es);
         eepw.ShowDialog();
         if (eepw.DialogResult == true)
         {
             settings.encodingSettings.Add(eepw.encodingSettings);
             UpdateEncodingProfile();
         }
     }
     catch (Exception)
     {
     }
 }
 private void buttonProfileDown_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int index = listBoxEncodingProfiles.SelectedIndex;
         if (index < settings.encodingSettings.Count - 1)
         {
             EncodingSettings es = new EncodingSettings(settings.encodingSettings[index]);
             settings.encodingSettings.RemoveAt(index);
             settings.encodingSettings.Insert(index + 1, es);
             UpdateEncodingProfile();
             listBoxEncodingProfiles.SelectedIndex = index + 1;
         }
     }
     catch (Exception)
     {
     }
 }
Example #5
0
        public EncodingSettings(EncodingSettings orig)
        {
            this.desc = orig.desc;
            this.settings = orig.settings;
            this.settings2 = orig.settings2;
            this.pass2 = orig.pass2;
            this.sizeValue = orig.sizeValue;
            this.sizeType = orig.sizeType;

            this.crf = orig.crf;
            this.profile = orig.profile;
            this.preset = orig.preset;
            this.tune = orig.tune;
            this.level = orig.level;
            this.refvalue = orig.refvalue;
            this.bframes = orig.bframes;
            this.badapt = orig.badapt;
            this.aqmode = orig.aqmode;
            this.nofastpskip = orig.nofastpskip;
            this.fastdecode = orig.fastdecode;
            this.zerolatency = orig.zerolatency;
            this.slowfirstpass = orig.slowfirstpass;
        }
Example #6
0
        public EncodingSettings(EncodingSettings orig)
        {
            this.desc      = orig.desc;
            this.settings  = orig.settings;
            this.settings2 = orig.settings2;
            this.pass2     = orig.pass2;
            this.sizeValue = orig.sizeValue;
            this.sizeType  = orig.sizeType;

            this.crf           = orig.crf;
            this.profile       = orig.profile;
            this.preset        = orig.preset;
            this.tune          = orig.tune;
            this.level         = orig.level;
            this.refvalue      = orig.refvalue;
            this.bframes       = orig.bframes;
            this.badapt        = orig.badapt;
            this.aqmode        = orig.aqmode;
            this.nofastpskip   = orig.nofastpskip;
            this.fastdecode    = orig.fastdecode;
            this.zerolatency   = orig.zerolatency;
            this.slowfirstpass = orig.slowfirstpass;
        }
        private void buttonCopyInsert_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                int index = listBoxEncodingProfiles.SelectedIndex;
                if (index > -1)
                {
                    EncodingSettings es = new EncodingSettings(settings.encodingSettings[index]);
                    es.desc = "Copy " + es.desc;
                    settings.encodingSettings.Add(es);
                    UpdateEncodingProfile();

                    EditEncodingProfileWindow eepw = new EditEncodingProfileWindow(settings.encodingSettings[settings.encodingSettings.Count - 1]);
                    eepw.ShowDialog();
                    if (eepw.DialogResult == true)
                    {
                        settings.encodingSettings[settings.encodingSettings.Count - 1] = new EncodingSettings(eepw.encodingSettings);
                        UpdateEncodingProfile();
                        listBoxEncodingProfiles.SelectedIndex = settings.encodingSettings.Count - 1;
                    }
                    else
                    {
                        settings.encodingSettings.RemoveAt(settings.encodingSettings.Count - 1);
                        UpdateEncodingProfile();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
 private void buttonProfileAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         EncodingSettings es = new EncodingSettings();
         es.desc = Global.Res("NewEncodingProfileDesc");
         EditEncodingProfileWindow eepw = new EditEncodingProfileWindow(es);
         eepw.ShowDialog();
         if (eepw.DialogResult == true)
         {
             settings.encodingSettings.Add(eepw.encodingSettings);
             UpdateEncodingProfile();
         }
     }
     catch (Exception)
     {
     }
 }
 private void buttonProfileDown_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int index = listBoxEncodingProfiles.SelectedIndex;
         if (index < settings.encodingSettings.Count - 1)
         {
             EncodingSettings es = new EncodingSettings(settings.encodingSettings[index]);
             settings.encodingSettings.RemoveAt(index);
             settings.encodingSettings.Insert(index + 1, es);
             UpdateEncodingProfile();
             listBoxEncodingProfiles.SelectedIndex = index + 1;
         }
     }
     catch (Exception)
     {
     }
 }
        public EditEncodingProfileWindow(EncodingSettings es)
        {
            try
            {
                InitializeComponent();
                this.es = new EncodingSettings(es);
                textBoxDescription.Text        = es.desc;
                textBoxSettings.Text           = es.settings;
                textBoxSettings2.Text          = es.settings2;
                textBoxSizeValue.Text          = es.sizeValue.ToString();
                comboBoxSizeType.SelectedIndex = (int)es.sizeType;
                checkBox2pass.IsChecked        = es.pass2;

                comboBoxProfile.ItemsSource = GlobalVars.profile;
                comboBoxPreset.ItemsSource  = GlobalVars.preset;
                comboBoxTune.ItemsSource    = GlobalVars.tune;
                comboBoxLevel.ItemsSource   = GlobalVars.level;
                comboBoxAqmode.ItemsSource  = GlobalVars.aqmode;
                comboBoxBadapt.ItemsSource  = GlobalVars.badapt;

                textBoxCrf.Text     = es.crf.ToString("f1");
                textBoxBframes.Text = es.bframes.ToString();
                textBoxRef.Text     = es.refvalue.ToString();

                checkBoxFastdecode.IsChecked    = es.fastdecode;
                checkBoxNofastpskip.IsChecked   = es.nofastpskip;
                checkBoxZerolatency.IsChecked   = es.zerolatency;
                checkBoxSlowfirstpass.IsChecked = es.slowfirstpass;

                if (es.profile > -1 && es.profile < GlobalVars.profile.Count)
                {
                    comboBoxProfile.SelectedIndex = es.profile;
                }
                if (es.preset > -1 && es.preset < GlobalVars.preset.Count)
                {
                    comboBoxPreset.SelectedIndex = es.preset;
                }
                if (es.tune > -1 && es.tune < GlobalVars.tune.Count)
                {
                    comboBoxTune.SelectedIndex = es.tune;
                }
                if (es.level > -1 && es.level < GlobalVars.level.Count)
                {
                    comboBoxLevel.SelectedIndex = es.level;
                }
                if (es.aqmode > -1 && es.aqmode < GlobalVars.aqmode.Count)
                {
                    comboBoxAqmode.SelectedIndex = es.aqmode;
                }
                if (es.badapt > -1 && es.badapt < GlobalVars.badapt.Count)
                {
                    comboBoxBadapt.SelectedIndex = es.badapt;
                }

                checkBox2pass_Checked(null, null);

                UpdateParams();
            }
            catch (Exception ex)
            {
                Global.ErrorMsg(ex);
            }
        }