Esempio n. 1
0
        private void HideShowFontFXControls()
        {
            if (cmbOutStream.SelectedItem != null && MidiPlay.IsBuiltIn((string)cmbOutStream.SelectedItem))
            {
                lblcmbFontStream.Show();
                cmbFontStream.Show();
                cmdFXStream.Show();
                PopulateCmbFonts(cmbFontStream, Cfg.SoundFontStream, clsBassMidiInOut.eType.OutStream);
            }
            else
            {
                lblcmbFontStream.Hide();
                cmbFontStream.Hide();
                cmdFXStream.Hide();
            }

            if (cmbOutKB.SelectedItem != null && MidiPlay.IsBuiltIn((string)cmbOutKB.SelectedItem))
            {
                lblcmbFontKB.Show();
                cmbFontKB.Show();
                cmdFXKB.Show();
                PopulateCmbFonts(cmbFontKB, Cfg.SoundFontKB, clsBassMidiInOut.eType.OutKB);
                //if (MidiPlay.OutMKB != null) trkMidiOutKBVol.Value = MidiPlay.OutMKB.GetStreamVol();
            }
            else
            {
                lblcmbFontKB.Hide();
                cmbFontKB.Hide();
                cmdFXKB.Hide();
            }
        }
Esempio n. 2
0
        private void PopulateCmbMidi(ComboBox cmb, clsMDevs devs, clsBassMidiInOut midi)
        {
            cmb.Items.Clear();
            string[] devnames;
            try {
                devnames = devs.GetDevs();
            }
            catch (MidiIOException) {
                return;
            }

            clsMidiInOut.eType type;
            if (cmb == cmbOutStream)
            {
                type = clsMidiInOut.eType.OutStream;
            }
            else if (cmb == cmbOutKB)
            {
                type = clsMidiInOut.eType.OutKB;
            }
            else if (cmb == cmbInKB)
            {
                type = clsMidiInOut.eType.InKB;
            }
            else
            {
                type = clsMidiInOut.eType.InSync;
            }

            foreach (string name in devnames)
            {
                if (cmb == cmbOutKB && name == "BuiltIn Synth (Stream)")
                {
                    continue;
                }
                if (cmb == cmbOutStream && name == "BuiltIn Synth (KB)")
                {
                    continue;
                }
                cmb.Items.Add(name);
                if (midi == null)
                {
                    if (MidiPlay.IsBuiltIn(name))
                    {
                        cmb.SelectedItem = clsMidiInOut.GetMidiDevName(type);
                    }
                    else
                    {
                        //cmb.SelectedItem = "None";
                        cmb.SelectedIndex = (cmb.Items.Count > 0) ? 0 : -1;
                    }
                }
                else if (name == midi.MidiDevName)
                {
                    cmb.SelectedItem = name;
                }
            }
        }