From 5e536319b77548718c6b7bdd770cdbce3f5bcf3b Mon Sep 17 00:00:00 2001 From: Paul Batchelor Date: Sat, 4 Mar 2017 22:10:36 -0800 Subject: [PATCH] when rendering, use dummy Audio/MIDI devices --- include/Mixer.h | 2 +- src/core/Engine.cpp | 2 +- src/core/Mixer.cpp | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/Mixer.h b/include/Mixer.h index d25da0d6b..a57bf125d 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -157,7 +157,7 @@ public: } } ; - void initDevices(); + void initDevices( bool renderOnly ); void clear(); diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index b5ba50194..27656b90f 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -70,7 +70,7 @@ void LmmsCore::init( bool renderOnly ) s_projectJournal->setJournalling( true ); emit engine->initProgress(tr("Opening audio and midi devices")); - s_mixer->initDevices(); + s_mixer->initDevices( renderOnly ); PresetPreviewPlayHandle::init(); s_dummyTC = new DummyTrackContainer; diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 33ffe45a8..03845316d 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -203,10 +203,18 @@ Mixer::~Mixer() -void Mixer::initDevices() +void Mixer::initDevices( bool renderOnly ) { - m_audioDev = tryAudioDevices(); - m_midiClient = tryMidiClients(); + bool success_ful = false; + if( renderOnly ) { + m_audioDev = new AudioDummy( success_ful, this ); + m_audioDevName = AudioDummy::name(); + m_midiClient = new MidiDummy; + m_midiClientName = MidiDummy::name(); + } else { + m_audioDev = tryAudioDevices(); + m_midiClient = tryMidiClients(); + } }