aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-08-12 20:58:04 +0200
committercbdev <cb@cbcdn.com>2019-08-12 20:58:04 +0200
commitbad0fdac1e725b4b2efbbbfff4cef74c2e05efb8 (patch)
tree4a600f429ed92efe2959e5a3b8c223e32e9d2b4c
parentcc3aa7d8c1d680e75374a0c296a34d66a919f201 (diff)
downloadmidimonster-bad0fdac1e725b4b2efbbbfff4cef74c2e05efb8.tar.gz
midimonster-bad0fdac1e725b4b2efbbbfff4cef74c2e05efb8.tar.bz2
midimonster-bad0fdac1e725b4b2efbbbfff4cef74c2e05efb8.zip
Fix maweb button execs
-rw-r--r--backends/maweb.c27
-rw-r--r--backends/maweb.md6
-rw-r--r--monster.cfg2
3 files changed, 31 insertions, 4 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
diff --git a/monster.cfg b/monster.cfg
index d272cee..e6258a7 100644
--- a/monster.cfg
+++ b/monster.cfg
@@ -36,4 +36,4 @@ bcf.channel{0..7}.pitch > ma.page1.fader{1..8}
bcf.channel0.note{16..23} > ma.page1.upper{1..8}
bcf.channel0.note{24..31} > ma.page1.lower{1..8}
mouse.EV_REL.REL_Y > ma.page1.fader1
-mouse.EV_KEY.BTN_LEFT > ma.ASSIGN
+mouse.EV_KEY.BTN_LEFT > ma.page2.button102