aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-09-08 09:35:11 +0200
committercbdev <cb@cbcdn.com>2019-09-08 09:35:11 +0200
commit2822e7b6d10084adac5d35f26c2b158ccb91cd50 (patch)
tree3ae7c2715a4c26b336b3a9fabd7c22c3cadfa7cd
parentf19e3fe0d131c68d1e77fcd8706b260c28f508b8 (diff)
downloadmidimonster-2822e7b6d10084adac5d35f26c2b158ccb91cd50.tar.gz
midimonster-2822e7b6d10084adac5d35f26c2b158ccb91cd50.tar.bz2
midimonster-2822e7b6d10084adac5d35f26c2b158ccb91cd50.zip
Fix duplicate poll requests
-rw-r--r--backends/maweb.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/backends/maweb.c b/backends/maweb.c
index ca8a47d..905a1eb 100644
--- a/backends/maweb.c
+++ b/backends/maweb.c
@@ -346,8 +346,6 @@ static int maweb_process_playback(instance* inst, int64_t page, maweb_channel_ty
exec_blocks += json_obj_offset(payload + exec_blocks, "items");
}
- //TODO detect unused faders
-
//iterate over executor blocks
for(offset = json_array_offset(payload + exec_blocks, block); offset; offset = json_array_offset(payload + exec_blocks, block)){
control = exec_blocks + offset + json_obj_offset(payload + exec_blocks + offset, "fader");
@@ -362,6 +360,7 @@ static int maweb_process_playback(instance* inst, int64_t page, maweb_channel_ty
}
}
else{
+ //block input immediately after channel set to prevent feedback loops
data->channel[channel_index].input_blocked--;
}
}
@@ -508,9 +507,19 @@ static int maweb_request_playbacks(instance* inst){
snprintf(item_counts, sizeof(item_indices), "[%" PRIsize_t "]", ((channels / 5) * 5 + 5));
}
+ DBGPF("maweb poll range first %d: %d.%d last %d: %d.%d next %d: %d.%d\n",
+ data->channel[channel].type, data->channel[channel].page, data->channel[channel].index,
+ data->channel[channel + channel_offset - 1].type, data->channel[channel + channel_offset - 1].page, data->channel[channel + channel_offset - 1].index,
+ data->channel[channel + channel_offset].type, data->channel[channel + channel_offset].page, data->channel[channel + channel_offset].index);
+
//advance base channel
channel += channel_offset - 1;
+ //fader flash buttons have the same type as button execs, but can't be requested
+ if(data->channel[channel].index < 100 && data->channel[channel].type == exec_button){
+ continue;
+ }
+
//send current request
snprintf(xmit_buffer, sizeof(xmit_buffer),
"{"