示例#1
0
        private void ConnectOutStream()
        {
            //* assumes device already closed
            if (cmbOutStream.SelectedIndex < 0)
            {
                MessageBox.Show("Error: OutStream device not selected");
                return;
            }
            if (cmbFontStream.Enabled)
            {
                Cfg.SoundFontStream = (string)cmbFontStream.SelectedItem;
            }
            if (Cfg.SoundFontStream == null)
            {
                Cfg.SoundFontStream = "";
            }
            string devnameoutstream = GetSelectedDevName(cmbOutStream);

            try {
                MidiPlay.OpenMidiDev(clsMidiInOut.eType.OutStream, devnameoutstream, false);
            }
            catch (AudioIOException exc) {
                MessageBox.Show("Audio IO Exception: " + exc.Message);
                return;
            }
            catch (MidiIOException exc) {
                MessageBox.Show("Midi IO Exception: " + exc.Message);
                return;
            }

            if (P.BASSOutDev == null && devnameoutstream == "BuiltIn Synth (Stream)")
            {
                MidiPlay.OpenAudioDevs();
            }
            if (MidiPlay.OutMStream != null)
            {
                MidiPlay.OutMStream.SetFineTuning(trkMidiStreamFineTuning.Value);
            }
            Cfg.MidiOutStream = GetSelectedDevName(cmbOutStream);
            PostApply();
        }
示例#2
0
        //private void cmdDisconnect_Click(object sender, EventArgs e) {
        //  using (new clsWaitCursor()) {
        //    MidiPlay.CloseAllMidi();
        //    ShowCurrentConnection();
        //  }
        //  SetStates();
        //}

        //private void cmdApply_Click(object sender, EventArgs e) {
        //  using (new clsWaitCursor()) {
        //    Apply();
        //    //PlayableForms.CmdState_Set();
        //  }
        //  SetStates();
        //}

        private void ConnectInKB()
        {
            //* assumes device already closed
            if (cmbInKB.SelectedIndex < 0)
            {
                MessageBox.Show("Error: InMidiKB device not selected");
                return;
            }
            string devnameinkb = GetSelectedDevName(cmbInKB);

            try {
                MidiPlay.OpenMidiDev(clsMidiInOut.eType.InKB, devnameinkb, false);
            }
            catch (AudioIOException exc) {
                MessageBox.Show("Audio IO Exception: " + exc.Message);
                return;
            }
            catch (MidiIOException exc) {
                MessageBox.Show("Midi IO Exception: " + exc.Message);
                return;
            }
            Cfg.MidiInKB = GetSelectedDevName(cmbInKB);
            PostApply();
        }