From 171660ded7db19ed6ac7f44cdde6f5719c40ecca Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Jul 2014 09:52:50 -0700 Subject: [PATCH] fix stubbing of MIDIManager if HAVE_RTMIDI not defined --- interface/src/devices/MIDIManager.cpp | 12 +++++++----- interface/src/devices/MIDIManager.h | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/interface/src/devices/MIDIManager.cpp b/interface/src/devices/MIDIManager.cpp index 38dd6a9760..52ae2eb645 100644 --- a/interface/src/devices/MIDIManager.cpp +++ b/interface/src/devices/MIDIManager.cpp @@ -13,14 +13,13 @@ #include "MIDIManager.h" -#ifdef HAVE_RTMIDI - MIDIManager& MIDIManager::getInstance() { static MIDIManager sharedInstance; return sharedInstance; } void MIDIManager::midiCallback(double deltaTime, std::vector* message, void* userData) { +#ifdef HAVE_RTMIDI MIDIEvent callbackEvent; callbackEvent.deltaTime = deltaTime; @@ -36,15 +35,19 @@ void MIDIManager::midiCallback(double deltaTime, std::vector* mes } emit getInstance().midiEvent(callbackEvent); +#endif } MIDIManager::~MIDIManager() { +#ifdef HAVE_RTMIDI delete _midiInput; +#endif } const int DEFAULT_MIDI_PORT = 0; void MIDIManager::openDefaultPort() { +#ifdef HAVE_RTMIDI if (!_midiInput) { _midiInput = new RtMidiIn(); @@ -63,6 +66,5 @@ void MIDIManager::openDefaultPort() { _midiInput = NULL; } } -} - -#endif \ No newline at end of file +#endif +} \ No newline at end of file diff --git a/interface/src/devices/MIDIManager.h b/interface/src/devices/MIDIManager.h index 886b0adb00..f9bd8ed4c7 100644 --- a/interface/src/devices/MIDIManager.h +++ b/interface/src/devices/MIDIManager.h @@ -12,15 +12,17 @@ #ifndef hifi_MIDIManager_h #define hifi_MIDIManager_h -#ifdef HAVE_RTMIDI - #include #include #include +#ifdef HAVE_RTMIDI + #include +#endif + class MIDIManager : public QObject { Q_OBJECT @@ -46,11 +48,11 @@ signals: void midiEvent(const MIDIEvent& event); private: +#ifdef HAVE_RTMIDI RtMidiIn* _midiInput; +#endif HAVE_RTMIDI }; -#endif - #endif // hifi_MIDIManager_h