summaryrefslogtreecommitdiff
path: root/src/drumgizmo.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-06-29 21:46:10 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-06-29 21:46:10 +0200
commit1827f1ab9bf44490cf24779e0eab8533845b4a77 (patch)
treed374c7cc1aed4af9d351113cd43178a7e1f4b5f9 /src/drumgizmo.h
parentd6b684158d3549f343d1f4d22f4eefba7c873837 (diff)
New inter-thread message system.
Diffstat (limited to 'src/drumgizmo.h')
-rw-r--r--src/drumgizmo.h44
1 files changed, 5 insertions, 39 deletions
diff --git a/src/drumgizmo.h b/src/drumgizmo.h
index ffb9b07..31c192c 100644
--- a/src/drumgizmo.h
+++ b/src/drumgizmo.h
@@ -43,9 +43,11 @@
#include "message.h"
+#include "messagereceiver.h"
+
#define MAX_NUM_CHANNELS 512
-class DrumGizmo {
+class DrumGizmo : public MessageReceiver {
public:
DrumGizmo(AudioOutputEngine *outputengine,
AudioInputEngine *inputengine);
@@ -69,50 +71,14 @@ public:
std::string kitfile;
- /*
- * Receive message from the engine. The caller takes over the memory.
- */
- Message *receiveGUIMessage();
-
- /*
- * Receive message from the engine without removing it from the queue.
- */
- Message *peekGUIMessage();
-
- /*
- * Add a message to the GUI message queue.
- */
- void sendEngineMessage(Message *msg);
-
- /*
- * Receive message from the engine. The caller takes over the memory.
- */
- Message *receiveEngineMessage();
-
- /*
- * Receive message from the engine without removing it from the queue.
- */
- Message *peekEngineMessage();
-
- /*
- * Add a message to the GUI message queue.
- */
- void sendGUIMessage(Message *msg);
+ void handleMessage(Message *msg);
private:
- void handleEngineEvents();
-
- Mutex gui_message_mutex;
- std::list<Message *> gui_message_queue;
-
- Mutex engine_message_mutex;
- std::list<Message *> engine_message_queue;
-
DrumKitLoader loader;
Mutex mutex;
bool is_running;
-
+
AudioOutputEngine *oe;
AudioInputEngine *ie;