diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index fc798b9074..bb9e65e3a3 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -355,6 +355,9 @@ OSC::register_callbacks() REGISTER_CALLBACK (serv, "/set_surface", "iiii", set_surface); REGISTER_CALLBACK (serv, "/set_surface/feedback", "i", set_surface_feedback); + REGISTER_CALLBACK (serv, "/set_surface/bank_size", "i", set_surface_bank_size); + REGISTER_CALLBACK (serv, "/set_surface/gainmode", "i", set_surface_gainmode); + REGISTER_CALLBACK (serv, "/set_surface/strip_types", "i", set_surface_strip_types); REGISTER_CALLBACK (serv, "/strip/list", "", routes_list); REGISTER_CALLBACK (serv, "/add_marker", "", add_marker); REGISTER_CALLBACK (serv, "/add_marker", "f", add_marker); @@ -1049,16 +1052,55 @@ OSC::set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gm, lo return 0; } +int +OSC::set_surface_bank_size (uint32_t bs, lo_message msg) +{ + OSCSurface *s = get_surface(lo_message_get_source (msg)); + s->bank_size = bs; + + // set bank and strip feedback + set_bank(s->bank, msg); + return 0; +} + + +int +OSC::set_surface_strip_types (uint32_t st, lo_message msg) +{ + OSCSurface *s = get_surface(lo_message_get_source (msg)); + s->strip_types = st; + + // set bank and strip feedback + set_bank(s->bank, msg); + return 0; +} + + int OSC::set_surface_feedback (uint32_t fb, lo_message msg) { OSCSurface *s = get_surface(lo_message_get_source (msg)); s->feedback = fb; + + // set bank and strip feedback + set_bank(s->bank, msg); + + // Set global/master feedback + global_feedback (s->feedback, msg, s->gainmode); + return 0; +} + + +int +OSC::set_surface_gainmode (uint32_t gm, lo_message msg) +{ + OSCSurface *s = get_surface(lo_message_get_source (msg)); + s->gainmode = gm; + // set bank and strip feedback set_bank(s->bank, msg); // Set global/master feedback - // global_feedback should include s->feedback in whole. global_feedback (s->feedback, msg, s->gainmode); return 0; } diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index 555c79c4f4..6d33fabd4e 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -318,7 +318,10 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI return 0; \ } + PATH_CALLBACK1_MSG(set_surface_bank_size,i); + PATH_CALLBACK1_MSG(set_surface_strip_types,i); PATH_CALLBACK1_MSG(set_surface_feedback,i); + PATH_CALLBACK1_MSG(set_surface_gainmode,i); #define PATH_CALLBACK2(name,arg1type,arg2type) \ static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \ @@ -412,7 +415,10 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI int bank_up (lo_message msg); int bank_down (lo_message msg); int set_surface (uint32_t b_size, uint32_t strips, uint32_t fb, uint32_t gmode, lo_message msg); + int set_surface_bank_size (uint32_t bs, lo_message msg); + int set_surface_strip_types (uint32_t st, lo_message msg); int set_surface_feedback (uint32_t fb, lo_message msg); + int set_surface_gainmode (uint32_t gm, lo_message msg); int master_set_gain (float dB); int master_set_fader (uint32_t position);