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(); }
internal void OpenAllStreams() //called from Apply() { try { MidiPlay.OpenAudioDevs(); if (P.F != null && P.F.AudioSync != null && P.F.AudioSync.MP3Player != null) { if (P.F.AudioSync.MP3Player is clsMP3Bass) { P.BASSOutDev.ConnectFile((clsMP3Bass)P.F.AudioSync.MP3Player); P.F.AudioSync.MP3Player.Vol = P.frmSC.trkAudioVol.Value; } } //MidiPlay.OpenMidiDevs(true); //non-audio already open } catch (AudioIOException exc) { MessageBox.Show("Audio IO Exception: " + exc.Message); return; } catch (MidiIOException exc) { MessageBox.Show("Midi IO Exception: " + exc.Message); return; } }