diff --git a/include/Mixer.h b/include/Mixer.h index da6df29d2..18510f363 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -158,6 +158,9 @@ public: // audio-device-stuff + + // Returns the current audio device's name. This is not necessarily + // the user's preferred audio device, in case you were thinking that. inline const QString & audioDevName() const { return m_audioDevName; diff --git a/src/core/midi/MidiJack.cpp b/src/core/midi/MidiJack.cpp index b6bae166d..cea7f7381 100644 --- a/src/core/midi/MidiJack.cpp +++ b/src/core/midi/MidiJack.cpp @@ -65,15 +65,16 @@ MidiJack::MidiJack() : m_output_port( NULL ), m_quit( false ) { - // if jack is used for audio then we share the connection + // if jack is currently used for audio then we share the connection // AudioJack creates and maintains the jack connection // and also handles the callback, we pass it our address // so that we can also process during the callback - if(Engine::mixer()->audioDevName() == AudioJack::name() ) + m_jackAudio = dynamic_cast(Engine::mixer()->audioDev()); + if( m_jackAudio ) { // if a jack connection has been created for audio we use that - m_jackAudio = dynamic_cast(Engine::mixer()->audioDev())->addMidiClient(this); + m_jackAudio->addMidiClient(this); }else{ m_jackAudio = NULL; m_jackClient = jack_client_open(probeDevice().toLatin1().data(), diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 5da148bd0..f2fb66cd3 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -808,6 +808,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_audioInterfaces->addItem( it.key() ); } + // If no preferred audio device is saved, save the current one QString audioDevName = ConfigManager::inst()->value( "mixer", "audiodev" ); if( audioDevName.length() == 0 )