Пример #1
0
        /// <summary>
        /// Loads the values out of the settings.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="numPadControl">The num pad control.</param>
        /// <remarks>Documented by Dev05, 2007-08-07</remarks>
        private void LoadValues()
        {
            loading = true;

            checkBoxMultipleAssignment.Checked = settings.AllowMultipleAssignment;
            checkBoxPresenter.Checked          = settings.PresenterActivated;

            comboBoxDecimal.Tag  = Keys.Decimal;
            comboBoxDivide.Tag   = Keys.Divide;
            comboBoxEnter.Tag    = Keys.Enter;
            comboBoxMinus.Tag    = Keys.Subtract;
            comboBoxMultiply.Tag = Keys.Multiply;
            comboBoxNum0.Tag     = Keys.NumPad0;
            comboBoxNum1.Tag     = Keys.NumPad1;
            comboBoxNum2.Tag     = Keys.NumPad2;
            comboBoxNum3.Tag     = Keys.NumPad3;
            comboBoxNum4.Tag     = Keys.NumPad4;
            comboBoxNum5.Tag     = Keys.NumPad5;
            comboBoxNum6.Tag     = Keys.NumPad6;
            comboBoxNum7.Tag     = Keys.NumPad7;
            comboBoxNum8.Tag     = Keys.NumPad8;
            comboBoxNum9.Tag     = Keys.NumPad9;
            comboBoxPlus.Tag     = Keys.Add;

            comboBoxSpace.Tag = Keys.Space;
            comboBoxC.Tag     = Keys.C;
            comboBoxV.Tag     = Keys.V;
            comboBoxB.Tag     = Keys.B;
            comboBoxN.Tag     = Keys.N;
            comboBoxM.Tag     = Keys.M;

            foreach (Control control in tabPageNumPad.Controls)
            {
                if (control.GetType() == typeof(ComboBox))
                {
                    ComboBox comboBox = (ComboBox)control;

                    if (comboBox.Tag is Keys)
                    {
                        comboBox.Items.Clear();
                        comboBox.Items.Add("");
                        comboBox.Items.Add(Function.Backward);
                        comboBox.Items.Add(Function.Forward);
                        comboBox.Items.Add(Function.Play);
                        comboBox.Items.Add(Function.Record);

                        if (settings.KeyFunctions.ContainsKey((Keys)comboBox.Tag))
                        {
                            comboBox.SelectedItem = settings.KeyFunctions[(Keys)comboBox.Tag];
                        }
                    }
                }
            }

            foreach (Control control in tabPageKeyboard.Controls)
            {
                if (control.GetType() == typeof(ComboBox))
                {
                    ComboBox comboBox = (ComboBox)control;

                    if (comboBox.Tag is Keys)
                    {
                        comboBox.Items.Clear();
                        comboBox.Items.Add("");
                        comboBox.Items.Add(Function.Backward);
                        comboBox.Items.Add(Function.Forward);
                        comboBox.Items.Add(Function.Play);
                        comboBox.Items.Add(Function.Record);

                        if (settings.KeyboardFunctions.ContainsKey((Keys)comboBox.Tag))
                        {
                            comboBox.SelectedItem = settings.KeyboardFunctions[(Keys)comboBox.Tag];
                        }
                    }
                }
            }

            if (!settings.AllowMultipleAssignment)
            {
                RemoveDoubleAssignemts();
            }

            numericUpDownStartDelay.Value = settings.StartDelay;
            numericUpDownStopDelay.Value  = settings.StopDelay;

            listViewElementsToRecord.Items.Clear();

            questionItem         = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_QUESTION_TEXT, dictionaryManager.QuestionCaption));
            questionItem.Checked = settings.RecordQuestion;
            questionItem.Tag     = MediaItemType.Question;

            questionExampleItem         = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_EXQUESTION_TEXT, dictionaryManager.QuestionCaption));
            questionExampleItem.Checked = settings.RecordQuestionExample;
            questionExampleItem.Tag     = MediaItemType.QuestionExample;

            answerItem         = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_ANSWER_TEXT, dictionaryManager.AnswerCaption));
            answerItem.Checked = settings.RecordAnswer;
            answerItem.Tag     = MediaItemType.Answer;

            answerExampleItem         = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_EXANSWER_TEXT, dictionaryManager.AnswerCaption));
            answerExampleItem.Checked = settings.RecordAnswerExample;
            answerExampleItem.Tag     = MediaItemType.AnswerExample;

            checkBoxDelayActive.Checked = settings.DelaysActive;
            checkBoxDelayActive.Focus();

            comboBoxKeyboardMode.SelectedIndex = (settings.KeyboardLayout ? 1 : 0);

            for (int i = 0; i < settings.RecordingOrder.Length; i++)
            {
                switch (settings.RecordingOrder[i])
                {
                case MediaItemType.Question:
                    listViewElementsToRecord.Items.Add(questionItem);
                    break;

                case MediaItemType.QuestionExample:
                    listViewElementsToRecord.Items.Add(questionExampleItem);
                    break;

                case MediaItemType.Answer:
                    listViewElementsToRecord.Items.Add(answerItem);
                    break;

                case MediaItemType.AnswerExample:
                    listViewElementsToRecord.Items.Add(answerExampleItem);
                    break;
                }
            }

            ////load cbr/vbr settings
            //checkBoxVBR.Checked = settings.MP3Settings.VBR_enabled;

            ////fill bitrates combobox and select current setting
            //comboBoxCBRBitrate.Items.Clear();
            //foreach (string bitrateString in Properties.Resources.ENCODING_AVAILABLE_BITRATES.Split('|'))
            //{
            //    Bitrate bitrate = new Bitrate(bitrateString);
            //    comboBoxCBRBitrate.Items.Add(bitrate);

            //    if (bitrate.Value == settings.MP3Settings.Bitrate)
            //        comboBoxCBRBitrate.SelectedItem = bitrate;
            //}

            ////fill vbr quality combobox
            //colorSliderVBRQuality.Value = 10 - settings.MP3Settings.VBR_Quality;
            //colorSliderVBRQuality_Scroll(colorSliderVBRQuality, new ScrollEventArgs(ScrollEventType.ThumbPosition, colorSliderVBRQuality.Value));

            //fill samplingrates combobox and select current setting
            comboBoxSamplingRate.Items.Clear();
            foreach (string samplingRateString in Resources.ENCODING_AVAILABLE_SAMPLING_RATES.Split('|'))
            {
                SamplingRate samplingRate = new SamplingRate(samplingRateString);
                comboBoxSamplingRate.Items.Add(samplingRate);

                if (samplingRate.Value == settings.SamplingRate)
                {
                    comboBoxSamplingRate.SelectedItem = samplingRate;
                }
            }

            //fill channels combobox and select current setting
            comboBoxChannels.Items.Clear();
            foreach (string channelString in Resources.ENCODING_AVAILABLE_CHANNELS.Split('|'))
            {
                comboBoxChannels.Items.Add(int.Parse(channelString));
            }
            comboBoxChannels.SelectedItem = settings.Channels;

            RefillEncoderCombobox();
            LoadCultures();
            loading = false;
        }
Пример #2
0
        /// <summary>
        /// Loads the values out of the settings.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="numPadControl">The num pad control.</param>
        /// <remarks>Documented by Dev05, 2007-08-07</remarks>
        private void LoadValues()
        {
            loading = true;

            checkBoxMultipleAssignment.Checked = settings.AllowMultipleAssignment;
            checkBoxPresenter.Checked = settings.PresenterActivated;

            comboBoxDecimal.Tag = Keys.Decimal;
            comboBoxDivide.Tag = Keys.Divide;
            comboBoxEnter.Tag = Keys.Enter;
            comboBoxMinus.Tag = Keys.Subtract;
            comboBoxMultiply.Tag = Keys.Multiply;
            comboBoxNum0.Tag = Keys.NumPad0;
            comboBoxNum1.Tag = Keys.NumPad1;
            comboBoxNum2.Tag = Keys.NumPad2;
            comboBoxNum3.Tag = Keys.NumPad3;
            comboBoxNum4.Tag = Keys.NumPad4;
            comboBoxNum5.Tag = Keys.NumPad5;
            comboBoxNum6.Tag = Keys.NumPad6;
            comboBoxNum7.Tag = Keys.NumPad7;
            comboBoxNum8.Tag = Keys.NumPad8;
            comboBoxNum9.Tag = Keys.NumPad9;
            comboBoxPlus.Tag = Keys.Add;

            comboBoxSpace.Tag = Keys.Space;
            comboBoxC.Tag = Keys.C;
            comboBoxV.Tag = Keys.V;
            comboBoxB.Tag = Keys.B;
            comboBoxN.Tag = Keys.N;
            comboBoxM.Tag = Keys.M;

            foreach (Control control in tabPageNumPad.Controls)
            {
                if (control.GetType() == typeof(ComboBox))
                {
                    ComboBox comboBox = (ComboBox)control;

                    if (comboBox.Tag is Keys)
                    {
                        comboBox.Items.Clear();
                        comboBox.Items.Add("");
                        comboBox.Items.Add(Function.Backward);
                        comboBox.Items.Add(Function.Forward);
                        comboBox.Items.Add(Function.Play);
                        comboBox.Items.Add(Function.Record);

                        if (settings.KeyFunctions.ContainsKey((Keys)comboBox.Tag))
                            comboBox.SelectedItem = settings.KeyFunctions[(Keys)comboBox.Tag];
                    }
                }
            }

            foreach (Control control in tabPageKeyboard.Controls)
            {
                if (control.GetType() == typeof(ComboBox))
                {
                    ComboBox comboBox = (ComboBox)control;

                    if (comboBox.Tag is Keys)
                    {
                        comboBox.Items.Clear();
                        comboBox.Items.Add("");
                        comboBox.Items.Add(Function.Backward);
                        comboBox.Items.Add(Function.Forward);
                        comboBox.Items.Add(Function.Play);
                        comboBox.Items.Add(Function.Record);

                        if (settings.KeyboardFunctions.ContainsKey((Keys)comboBox.Tag))
                            comboBox.SelectedItem = settings.KeyboardFunctions[(Keys)comboBox.Tag];
                    }
                }
            }

            if (!settings.AllowMultipleAssignment)
                RemoveDoubleAssignemts();

            numericUpDownStartDelay.Value = settings.StartDelay;
            numericUpDownStopDelay.Value = settings.StopDelay;

            listViewElementsToRecord.Items.Clear();

            questionItem = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_QUESTION_TEXT, dictionaryManager.QuestionCaption));
            questionItem.Checked = settings.RecordQuestion;
            questionItem.Tag = MediaItemType.Question;

            questionExampleItem = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_EXQUESTION_TEXT, dictionaryManager.QuestionCaption));
            questionExampleItem.Checked = settings.RecordQuestionExample;
            questionExampleItem.Tag = MediaItemType.QuestionExample;

            answerItem = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_ANSWER_TEXT, dictionaryManager.AnswerCaption));
            answerItem.Checked = settings.RecordAnswer;
            answerItem.Tag = MediaItemType.Answer;

            answerExampleItem = new ListViewItem(string.Format(Resources.LISTBOXFIELDS_EXANSWER_TEXT, dictionaryManager.AnswerCaption));
            answerExampleItem.Checked = settings.RecordAnswerExample;
            answerExampleItem.Tag = MediaItemType.AnswerExample;

            checkBoxDelayActive.Checked = settings.DelaysActive;
            checkBoxDelayActive.Focus();

            comboBoxKeyboardMode.SelectedIndex = (settings.KeyboardLayout ? 1 : 0);

            for (int i = 0; i < settings.RecordingOrder.Length; i++)
            {
                switch (settings.RecordingOrder[i])
                {
                    case MediaItemType.Question:
                        listViewElementsToRecord.Items.Add(questionItem);
                        break;
                    case MediaItemType.QuestionExample:
                        listViewElementsToRecord.Items.Add(questionExampleItem);
                        break;
                    case MediaItemType.Answer:
                        listViewElementsToRecord.Items.Add(answerItem);
                        break;
                    case MediaItemType.AnswerExample:
                        listViewElementsToRecord.Items.Add(answerExampleItem);
                        break;
                }
            }

            ////load cbr/vbr settings
            //checkBoxVBR.Checked = settings.MP3Settings.VBR_enabled;

            ////fill bitrates combobox and select current setting
            //comboBoxCBRBitrate.Items.Clear();
            //foreach (string bitrateString in Properties.Resources.ENCODING_AVAILABLE_BITRATES.Split('|'))
            //{
            //    Bitrate bitrate = new Bitrate(bitrateString);
            //    comboBoxCBRBitrate.Items.Add(bitrate);

            //    if (bitrate.Value == settings.MP3Settings.Bitrate)
            //        comboBoxCBRBitrate.SelectedItem = bitrate;
            //}

            ////fill vbr quality combobox
            //colorSliderVBRQuality.Value = 10 - settings.MP3Settings.VBR_Quality;
            //colorSliderVBRQuality_Scroll(colorSliderVBRQuality, new ScrollEventArgs(ScrollEventType.ThumbPosition, colorSliderVBRQuality.Value));

            //fill samplingrates combobox and select current setting
            comboBoxSamplingRate.Items.Clear();
            foreach (string samplingRateString in Resources.ENCODING_AVAILABLE_SAMPLING_RATES.Split('|'))
            {
                SamplingRate samplingRate = new SamplingRate(samplingRateString);
                comboBoxSamplingRate.Items.Add(samplingRate);

                if (samplingRate.Value == settings.SamplingRate)
                    comboBoxSamplingRate.SelectedItem = samplingRate;
            }

            //fill channels combobox and select current setting
            comboBoxChannels.Items.Clear();
            foreach (string channelString in Resources.ENCODING_AVAILABLE_CHANNELS.Split('|'))
                comboBoxChannels.Items.Add(int.Parse(channelString));
            comboBoxChannels.SelectedItem = settings.Channels;

            RefillEncoderCombobox();
            LoadCultures();
            loading = false;
        }