The codebase to run the *spark d-fuser controller www.sparkav.co.uk/dvimixer
Dependencies: SPK-TVOne DMX DmxArtNet NetServicesMin OSC PinDetect mRotaryEncoder iniparser mbed spk_oled_ssd1305 filter
Diff: spk_utils.h
- Revision:
- 49:16309f39cead
- Parent:
- 48:c0fedfa8c525
- Child:
- 51:98cc27390484
--- a/spk_utils.h Mon Dec 10 16:45:03 2012 +0000 +++ b/spk_utils.h Tue Dec 11 18:05:32 2012 +0000 @@ -65,28 +65,34 @@ class SPKMenuItem { public: - enum itemType { changesToMenu, sendsCommand }; + enum itemType { changesToMenu, sendsCommand, hasHandler }; itemType type; string text; - bool handlingControls; + void (*handler)(int, bool); union { SPKMenu* menu; int32_t command[2]; + void (*handler)(int, bool); } payload; - SPKMenuItem(string title, SPKMenu* menu, bool handlesControls = false) + SPKMenuItem(string title, SPKMenu* menu) { text = title; type = changesToMenu; - handlingControls = handlesControls; payload.menu = menu; } + SPKMenuItem(void (*menuItemHandler)(int, bool)) + { + text = "[has handler]"; + type = hasHandler; + payload.handler = menuItemHandler; + } + SPKMenuItem(string title, int32_t command) { text = title; type = sendsCommand; - handlingControls = false; payload.command[0] = command; payload.command[1] = 0; } @@ -95,7 +101,6 @@ { text = title; type = sendsCommand; - handlingControls = false; payload.command[0] = command1; payload.command[1] = command2; }