summaryrefslogtreecommitdiff
path: root/src/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/message.h')
-rw-r--r--src/message.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/message.h b/src/message.h
index 4ce65ef..d51c263 100644
--- a/src/message.h
+++ b/src/message.h
@@ -27,6 +27,10 @@
#ifndef __DRUMGIZMO_MESSAGE_H__
#define __DRUMGIZMO_MESSAGE_H__
+#include <string>
+
+class MessageHandler;
+
class Message {
public:
typedef enum {
@@ -39,15 +43,24 @@ public:
LoadMidimap, // Signal engine to load midimap.
EngineSettingsMessage, // Request or receive engine settings.
ChangeSettingMessage, // Update named setting in engine.
+ RegisterUIMessage, // Register new UI message handler
} type_t;
+ typedef enum {
+ NormalProcessing, // Just add to the queue
+ FilterMultiple, // Ignore top message if it has the same type.
+ // SyncWait, // Block the send call until the message has been handled by the receiver.
+ } processing_mode_t;
+
virtual ~Message() {}
virtual type_t type() = 0;
+ virtual processing_mode_t processing_mode() { return NormalProcessing; }
};
class LoadStatusMessage : public Message {
public:
type_t type() { return Message::LoadStatus; }
+ processing_mode_t processing_mode() { return FilterMultiple; }
unsigned int number_of_files;
unsigned int numer_of_files_loaded;
std::string current_file;
@@ -106,4 +119,10 @@ public:
float value;
};
+class RegisterUIMessage : public Message {
+public:
+ type_t type() { return Message::RegisterUIMessage; }
+ MessageHandler *messagehandler;
+};
+
#endif/*__DRUMGIZMO_MESSAGE_H__*/