mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-17 13:32:34 +02:00
don't require RtMidi if it isn't present
This commit is contained in:
parent
6665a9427a
commit
15619b5a98
3 changed files with 16 additions and 2 deletions
|
@ -398,9 +398,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
|
||||
_trayIcon->show();
|
||||
|
||||
#ifdef HAVE_RTMIDI
|
||||
// setup the MIDIManager
|
||||
MIDIManager& midiManagerInstance = MIDIManager::getInstance();
|
||||
midiManagerInstance.openDefaultPort();
|
||||
#endif
|
||||
}
|
||||
|
||||
Application::~Application() {
|
||||
|
@ -3630,7 +3632,10 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript
|
|||
scriptEngine->registerGlobalObject("AnimationCache", &_animationCache);
|
||||
scriptEngine->registerGlobalObject("AudioReflector", &_audioReflector);
|
||||
scriptEngine->registerGlobalObject("Account", AccountScriptingInterface::getInstance());
|
||||
|
||||
#ifdef HAVE_RTMIDI
|
||||
scriptEngine->registerGlobalObject("MIDI", &MIDIManager::getInstance());
|
||||
#endif
|
||||
|
||||
QThread* workerThread = new QThread(this);
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
#include "MIDIManager.h"
|
||||
|
||||
#ifdef HAVE_RTMIDI
|
||||
|
||||
MIDIManager& MIDIManager::getInstance() {
|
||||
static MIDIManager sharedInstance;
|
||||
return sharedInstance;
|
||||
|
@ -61,4 +63,6 @@ void MIDIManager::openDefaultPort() {
|
|||
_midiInput = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -12,6 +12,8 @@
|
|||
#ifndef hifi_MIDIManager_h
|
||||
#define hifi_MIDIManager_h
|
||||
|
||||
#ifdef HAVE_RTMIDI
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtScript/QScriptEngine>
|
||||
|
||||
|
@ -47,5 +49,8 @@ private:
|
|||
RtMidiIn* _midiInput;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // hifi_MIDIManager_h
|
||||
|
||||
#endif // hifi_MIDIManager_h
|
Loading…
Reference in a new issue