Exemple #1
0
 public HotkeyEditAudioAutoTunePassthroughForm()
 {
     InitializeComponent();
     AutoTuneViewModel     = new AutoTuneViewModel();
     cbCommand.DataSource  = Enum.GetValues(typeof(HotkeyTypeEnum));
     cbModifier.DataSource = Enum.GetValues(typeof(KeyModifier));
     cbKey.DataSource      = Enum.GetValues(typeof(Keys));
 }
Exemple #2
0
        public HotkeyEditAudioAutoTunePassthroughForm(Hotkey hotkey)
        {
            InitializeComponent();
            AutoTuneViewModel     = new AutoTuneViewModel();
            cbCommand.DataSource  = Enum.GetValues(typeof(HotkeyTypeEnum));
            cbModifier.DataSource = Enum.GetValues(typeof(KeyModifier));
            cbKey.DataSource      = Enum.GetValues(typeof(Keys));

            foreach (HotkeyAudioDevice currentDevice in MainAudio.Instance.AudioInputDevices)
            {
                cbInputDeviceOne.Items.Add(currentDevice.AudioDeviceName);
            }

            foreach (HotkeyAudioDevice currentDevice in MainAudio.Instance.AudioOutputDevices)
            {
                cbOutputDeviceOne.Items.Add(currentDevice.AudioDeviceName);
            }

            foreach (string currentScale in AutoTuneViewModel.Scales)
            {
                cbScale.Items.Add(currentScale);
            }

            string trbAttackValue = hotkey.GetAdditionalData(HotkeyAdditionalDataType.AutoTuneAttack);

            if (trbAttackValue != null)
            {
                trBAttack.Value   = int.Parse(trbAttackValue);
                lblAttackVal.Text = trbAttackValue + "ms";
            }

            string vibratoRate = hotkey.GetAdditionalData(HotkeyAdditionalDataType.AutoTuneVibratoRate);

            if (vibratoRate != null)
            {
                tbVibratoRate.Text = vibratoRate;
            }

            foreach (NoteViewModel pitch in AutoTuneViewModel.Pitches)
            {
                HotkeyAdditionalDataType pitchAddtDataType = GetAddtDataTypeFromPitch(pitch);
                string   pitchAddt = hotkey.GetAdditionalData(pitchAddtDataType);
                CheckBox pitchCb   = GetCheckboxFromPitch(pitch);
                if (pitchAddt != null && pitchCb != null)
                {
                    pitchCb.Checked = bool.Parse(pitchAddt);
                    pitch.Selected  = bool.Parse(pitchAddt);
                }
            }

            string selectedScale = AutoTuneViewModel.GetScaleFromSelectedPitches();

            if (!String.IsNullOrWhiteSpace(selectedScale))
            {
                cbScale.SelectedItem = selectedScale;
            }

            cbCommand.SelectedItem  = (HotkeyTypeEnum)hotkey.Command;
            cbCommand.Enabled       = false;
            cbModifier.SelectedItem = (KeyModifier)hotkey.Modifier;
            cbKey.SelectedItem      = (Keys)hotkey.Key;


            cbInputDeviceOne.SelectedItem  = hotkey.ExtraData1;
            cbOutputDeviceOne.SelectedItem = hotkey.ExtraData2;
        }