Skip to content

Commit

Permalink
Fix "Dummy" actually using ALSA
Browse files Browse the repository at this point in the history
Detect whether "Dummy" is selected explicitly or used as a fallback

Coding conventions adjustments

Update

Delete "build"
  • Loading branch information
M374LX committed Nov 11, 2015
1 parent 4639e37 commit f1d1754
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 19 deletions.
Binary file added data/locale/ca.qm
Binary file not shown.
Binary file added data/locale/cs.qm
Binary file not shown.
Binary file added data/locale/de.qm
Binary file not shown.
1 change: 1 addition & 0 deletions data/locale/en.qm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<�d��!�`���
Binary file added data/locale/es.qm
Binary file not shown.
Binary file added data/locale/fa.qm
Binary file not shown.
Binary file added data/locale/fr.qm
Binary file not shown.
Binary file added data/locale/gl.qm
Binary file not shown.
Binary file added data/locale/it.qm
Binary file not shown.
Binary file added data/locale/ja.qm
Binary file not shown.
Binary file added data/locale/ko.qm
Binary file not shown.
Binary file added data/locale/nl.qm
Binary file not shown.
Binary file added data/locale/pl.qm
Binary file not shown.
Binary file added data/locale/pt.qm
Binary file not shown.
Binary file added data/locale/ru.qm
Binary file not shown.
Binary file added data/locale/sv.qm
Binary file not shown.
Binary file added data/locale/uk.qm
Binary file not shown.
Binary file added data/locale/zh.qm
Binary file not shown.
13 changes: 8 additions & 5 deletions include/Mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ class EXPORT Mixer : public QObject
{
return m_audioDevName;
}
inline bool audioDevStartFailed() const
{
return m_audioDevStartFailed;
}

void setAudioDevice( AudioDevice * _dev );
void setAudioDevice( AudioDevice * _dev,
Expand All @@ -186,7 +190,6 @@ class EXPORT Mixer : public QObject
return m_audioDev;
}


// audio-port-stuff
inline void addAudioPort( AudioPort * _port )
{
Expand Down Expand Up @@ -368,10 +371,10 @@ class EXPORT Mixer : public QObject
private:
typedef fifoBuffer<surroundSampleFrame *> fifo;

class fifoWriter : public QThread
class FifoWriterThread : public QThread
{
public:
fifoWriter( Mixer * _mixer, fifo * _fifo );
FifoWriterThread( Mixer * _mixer, fifo * _fifo );

void finish();

Expand All @@ -396,7 +399,6 @@ class EXPORT Mixer : public QObject
AudioDevice * tryAudioDevices();
MidiClient * tryMidiClients();


const surroundSampleFrame * renderNextBuffer();


Expand Down Expand Up @@ -444,6 +446,7 @@ class EXPORT Mixer : public QObject
AudioDevice * m_audioDev;
AudioDevice * m_oldAudioDev;
QString m_audioDevName;
bool m_audioDevStartFailed;


MidiClient * m_midiClient;
Expand All @@ -456,7 +459,7 @@ class EXPORT Mixer : public QObject
QMutex m_playHandleRemovalMutex;

fifo * m_fifo;
fifoWriter * m_fifoWriter;
FifoWriterThread * m_fifoWriter;

MixerProfiler m_profiler;

Expand Down
25 changes: 14 additions & 11 deletions src/core/Mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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)
Expand Down Expand Up @@ -201,7 +202,7 @@ void Mixer::startProcessing( bool _needs_fifo )
{
if( _needs_fifo )
{
m_fifoWriter = new fifoWriter( this, m_fifo );
m_fifoWriter = new FifoWriterThread( this, m_fifo );
m_fifoWriter->start( QThread::HighPriority );
}
else
Expand Down Expand Up @@ -742,10 +743,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_ALSA
if( dev_name == AudioAlsa::name() || dev_name == "" )
Expand Down Expand Up @@ -839,9 +837,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();

Expand Down Expand Up @@ -934,7 +937,7 @@ MidiClient * Mixer::tryMidiClients()



Mixer::fifoWriter::fifoWriter( Mixer* mixer, fifo * _fifo ) :
Mixer::FifoWriterThread::FifoWriterThread( Mixer* mixer, fifo * _fifo ) :
m_mixer( mixer ),
m_fifo( _fifo ),
m_writing( true )
Expand All @@ -944,15 +947,15 @@ Mixer::fifoWriter::fifoWriter( Mixer* mixer, fifo * _fifo ) :



void Mixer::fifoWriter::finish()
void Mixer::FifoWriterThread::finish()
{
m_writing = false;
}




void Mixer::fifoWriter::run()
void Mixer::FifoWriterThread::run()
{
disable_denormals();

Expand Down
7 changes: 4 additions & 3 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit f1d1754

Please sign in to comment.