Clarify usage of Mixer->audioDevName()

This commit is contained in:
Lukas W
2017-03-23 12:40:26 +01:00
parent e89e52aaa2
commit a5aa5e7d08
3 changed files with 8 additions and 3 deletions

View File

@@ -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;

View File

@@ -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<AudioJack*>(Engine::mixer()->audioDev());
if( m_jackAudio )
{
// if a jack connection has been created for audio we use that
m_jackAudio = dynamic_cast<AudioJack*>(Engine::mixer()->audioDev())->addMidiClient(this);
m_jackAudio->addMidiClient(this);
}else{
m_jackAudio = NULL;
m_jackClient = jack_client_open(probeDevice().toLatin1().data(),

View File

@@ -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 )