Exemple #1
0
 private void combo_level_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (combo_level.IsDropDownOpen || combo_level.IsSelectionBoxHighlighted)
     {
         m.flac_options.level = combo_level.SelectedIndex;
         root_window.UpdateManualProfile();
     }
 }
Exemple #2
0
        private void combo_bitrate_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (combo_bitrate.IsDropDownOpen || combo_bitrate.IsSelectionBoxHighlighted)
            {
                AudioStream outstream = (AudioStream)m.outaudiostreams[m.outaudiostream];
                outstream.bitrate = Convert.ToInt32(combo_bitrate.SelectedItem);

                root_window.UpdateOutSize();
                root_window.UpdateManualProfile();
            }
        }
Exemple #3
0
        private void combo_mode_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (combo_mode.IsDropDownOpen || combo_mode.IsSelectionBoxHighlighted)
            {
                string mode = combo_mode.SelectedItem.ToString();
                if (mode == "CBR")
                {
                    m.aac_options.encodingmode = Settings.AudioEncodingModes.CBR;
                }
                else if (mode == "VBR")
                {
                    m.aac_options.encodingmode = Settings.AudioEncodingModes.VBR;
                }
                else if (mode == "ABR")
                {
                    m.aac_options.encodingmode = Settings.AudioEncodingModes.ABR;
                }
                else
                {
                    m.aac_options.encodingmode = Settings.AudioEncodingModes.TwoPass;
                }

                AudioStream outstream = (AudioStream)m.outaudiostreams[m.outaudiostream];

                LoadBitrates();

                if (m.aac_options.encodingmode == Settings.AudioEncodingModes.VBR)
                {
                    combo_bitrate.SelectedItem = m.aac_options.quality.ToString("0.00").Replace(",", ".");
                }
                else
                {
                    combo_bitrate.SelectedItem = outstream.bitrate;
                }

                root_window.UpdateOutSize();
                root_window.UpdateManualProfile();
            }

            if (combo_mode.SelectedIndex != -1)
            {
                text_bitrate.Content = (combo_mode.SelectedIndex == 1) ? str_quality : str_bitrate;
                num_period.IsEnabled = (combo_mode.SelectedIndex == 3);
            }
        }
Exemple #4
0
 private void combo_bits_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (combo_bits.IsDropDownOpen || combo_bits.IsSelectionBoxHighlighted)
     {
         AudioStream outstream = (AudioStream)m.outaudiostreams[m.outaudiostream];
         outstream.bits    = Convert.ToInt32(combo_bits.SelectedItem.ToString().Substring(0, 2));
         outstream.bitrate = (int)(0.016 * outstream.channels * (double)Convert.ToInt32(outstream.samplerate) * (double)outstream.bits / 16.0);
         root_window.UpdateManualProfile();
         root_window.UpdateOutSize();
     }
 }
Exemple #5
0
        private void combo_mode_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (combo_mode.IsDropDownOpen || combo_mode.IsSelectionBoxHighlighted)
            {
                string mode = combo_mode.SelectedItem.ToString();
                m.mp3_options.encodingmode = (Settings.AudioEncodingModes)Enum.Parse(typeof(Settings.AudioEncodingModes), mode);
                AudioStream outstream = (AudioStream)m.outaudiostreams[m.outaudiostream];

                LoadBitrates();

                if (m.mp3_options.encodingmode == Settings.AudioEncodingModes.VBR)
                {
                    combo_bitrate.SelectedItem = m.mp3_options.quality;
                    m.mp3_options.minb         = 32;
                    m.mp3_options.maxb         = 320;
                }
                else if (m.mp3_options.encodingmode == Settings.AudioEncodingModes.ABR)
                {
                    combo_bitrate.SelectedItem = outstream.bitrate;
                    m.mp3_options.minb         = 32;
                    m.mp3_options.maxb         = 320;
                }
                else
                {
                    combo_bitrate.SelectedItem = 192;
                    outstream.bitrate          = 192;
                    //combo_bitrate.SelectedItem = outstream.bitrate;
                }

                root_window.UpdateOutSize();
                root_window.UpdateManualProfile();
            }

            if (combo_mode.SelectedIndex != -1)
            {
                text_bitrate.Content = (combo_mode.SelectedIndex == 1) ? str_quality : str_bitrate;
            }
        }
Exemple #6
0
        private void combo_mode_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if ((combo_mode.IsDropDownOpen || combo_mode.IsSelectionBoxHighlighted) && combo_mode.SelectedItem != null)
            {
                string mode = combo_mode.SelectedItem.ToString();
                if (mode == "CBR")
                {
                    m.qaac_options.encodingmode = Settings.AudioEncodingModes.CBR;
                }
                else if (mode == "ABR")
                {
                    m.qaac_options.encodingmode = Settings.AudioEncodingModes.ABR;
                }
                else if (mode == "Constrained VBR")
                {
                    m.qaac_options.encodingmode = Settings.AudioEncodingModes.CVBR;
                }
                else if (mode == "Lossless (ALAC)")
                {
                    m.qaac_options.encodingmode = Settings.AudioEncodingModes.ALAC;
                }
                else
                {
                    m.qaac_options.encodingmode = Settings.AudioEncodingModes.VBR;
                    if (combo_aac_profile.SelectedIndex == 1)
                    {
                        //AAC-HE запрещен при True VBR
                        combo_aac_profile.SelectedIndex = 0;
                        m.qaac_options.aacprofile       = "AAC-LC";
                    }
                }

                LoadBitrates();

                AudioStream outstream = (AudioStream)m.outaudiostreams[m.outaudiostream];
                if (m.qaac_options.encodingmode == Settings.AudioEncodingModes.VBR)
                {
                    combo_bitrate.SelectedIndex = m.qaac_options.quality;
                }
                else if (m.qaac_options.encodingmode == Settings.AudioEncodingModes.ALAC)
                {
                    combo_bitrate.SelectedIndex = combo_bitrate.Items.Count - 1;
                }
                else
                {
                    combo_bitrate.SelectedItem = outstream.bitrate;
                }

                root_window.UpdateOutSize();
                root_window.UpdateManualProfile();
            }

            if (combo_mode.SelectedIndex != -1)
            {
                if (combo_mode.SelectedIndex < 3)
                {
                    combo_bitrate.ToolTip       = combo_bitrate.Tag;
                    combo_aac_profile.IsEnabled = true;
                    text_bitrate.Content        = str_bitrate + " (?)";
                }
                else
                {
                    combo_bitrate.ToolTip       = null;
                    combo_aac_profile.IsEnabled = false;
                    text_bitrate.Content        = (combo_mode.SelectedIndex == 3) ? str_quality : str_bitrate;
                }

                if (combo_aac_profile.SelectedIndex == 1 ||  //AAC-HE
                    combo_mode.SelectedIndex == 4)           //ALAC
                {
                    m.qaac_options.no_delay  = false;
                    check_no_delay.IsChecked = false;
                    check_no_delay.IsEnabled = false;
                }
                else
                {
                    check_no_delay.IsEnabled = true;
                }

                combo_bitrate.IsEnabled = combo_accuracy.IsEnabled = (combo_mode.SelectedIndex != 4);
            }
        }