diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/maweb.c | 27 | ||||
-rw-r--r-- | backends/maweb.md | 6 |
2 files changed, 30 insertions, 3 deletions
diff --git a/backends/maweb.c b/backends/maweb.c index be4c2ac..38d3d69 100644 --- a/backends/maweb.c +++ b/backends/maweb.c @@ -218,10 +218,15 @@ static channel* maweb_channel(instance* inst, char* spec){ next_token += 5; } else if(!strncmp(next_token, "button", 6)){ - ident.fields.type = exec_fader; + ident.fields.type = exec_button; next_token += 6; } ident.fields.index = strtoul(next_token, NULL, 10); + + //fix up the identifiers for button execs + if(ident.fields.index > 100){ + ident.fields.index -= 100; + } } else{ for(n = 0; n < sizeof(cmdline_keys) / sizeof(char*); n++){ @@ -568,6 +573,26 @@ static int maweb_set(instance* inst, size_t num, channel** c, channel_value* v){ fprintf(stderr, "maweb out %s\n", xmit_buffer); maweb_send_frame(inst, ws_text, (uint8_t*) xmit_buffer, strlen(xmit_buffer)); break; + case exec_button: + snprintf(xmit_buffer, sizeof(xmit_buffer), + "{\"requestType\":\"playbacks_userInput\"," + //"\"cmdline\":\"\"," + "\"execIndex\":%d," + "\"pageIndex\":%d," + "\"buttonId\":%d," + "\"pressed\":%s," + "\"released\":%s," + "\"type\":0," + "\"session\":%ld" + "}", ident.fields.index + 100, + ident.fields.page, + 0, + (v[n].normalised > 0.9) ? "true" : "false", + (v[n].normalised > 0.9) ? "false" : "true", + data->session); + fprintf(stderr, "maweb out %s\n", xmit_buffer); + maweb_send_frame(inst, ws_text, (uint8_t*) xmit_buffer, strlen(xmit_buffer)); + break; case cmdline_button: snprintf(xmit_buffer, sizeof(xmit_buffer), "{\"keyname\":\"%s\"," diff --git a/backends/maweb.md b/backends/maweb.md index 3a7372c..096f69c 100644 --- a/backends/maweb.md +++ b/backends/maweb.md @@ -27,7 +27,9 @@ Currently, three types of channels can be assigned ##### Executors -Executors are arranged in pages, with each page having 90 fader executors and 90 button executors. +Executors are arranged in pages, with each page having 90 fader executors (numbered 1 through 90) and +90 button executors (numbered 101 through 190). + Note that when creating a new show, only the first page is created and active. A fader executor consists of a fader, two buttons (`upper`, `lower`) above it and one `flash` button below it. @@ -42,7 +44,7 @@ mw1.page3.lower3 > mw1.page2.flash2 A button executor can likewise be mapped using the syntax ``` -mw1.page2.button3 > mw1.page3.button1 +mw1.page2.button103 > mw1.page3.button101 ``` ##### Command line buttons |