Fix "Dummy" actually using ALSA

This commit is contained in:
M374LX
2015-11-11 22:49:23 -02:00
parent 2284a8c353
commit ccb2f73dc0
3 changed files with 19 additions and 10 deletions

View File

@@ -175,6 +175,10 @@ public:
{
return m_audioDevName;
}
inline bool audioDevStartFailed() const
{
return m_audioDevStartFailed;
}
void setAudioDevice( AudioDevice * _dev );
void setAudioDevice( AudioDevice * _dev,
@@ -421,6 +425,7 @@ private:
AudioDevice * m_audioDev;
AudioDevice * m_oldAudioDev;
QString m_audioDevName;
bool m_audioDevStartFailed;
// MIDI device stuff
MidiClient * m_midiClient;

View File

@@ -71,6 +71,7 @@ Mixer::Mixer( bool renderOnly ) :
m_masterGain( 1.0f ),
m_audioDev( NULL ),
m_oldAudioDev( NULL ),
m_audioDevStartFailed( false ),
m_globalMutex( QMutex::Recursive ),
m_profiler(),
m_metronomeActive(false)
@@ -717,10 +718,7 @@ AudioDevice * Mixer::tryAudioDevices()
AudioDevice * dev = NULL;
QString dev_name = ConfigManager::inst()->value( "mixer", "audiodev" );
if( dev_name == AudioDummy::name() )
{
dev_name = "";
}
m_audioDevStartFailed = false;
#ifdef LMMS_HAVE_SDL
if( dev_name == AudioSdl::name() || dev_name == "" )
@@ -828,9 +826,14 @@ AudioDevice * Mixer::tryAudioDevices()
//}
//delete dev
printf( "No audio-driver working - falling back to dummy-audio-"
"driver\nYou can render your songs and listen to the output "
"files...\n" );
if( dev_name != AudioDummy::name() )
{
printf( "No audio-driver working - falling back to dummy-audio-"
"driver\nYou can render your songs and listen to the output "
"files...\n" );
m_audioDevStartFailed = true;
}
m_audioDevName = AudioDummy::name();

View File

@@ -559,10 +559,11 @@ void MainWindow::finalize()
SetupDialog sd;
sd.exec();
}
// look whether mixer could use a audio-interface beside AudioDummy
else if( Engine::mixer()->audioDevName() == AudioDummy::name() )
// look whether mixer failed to start the audio device selected by the
// user and is using AudioDummy as a fallback
else if( Engine::mixer()->audioDevStartFailed() )
{
// no, so we offer setup-dialog with audio-settings...
// if so, offer the audio settings section of the setup dialog
SetupDialog sd( SetupDialog::AudioSettings );
sd.exec();
}