mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
OSC: Add /group/list so surface can get a list of groups
This commit is contained in:
parent
b9c9777b9a
commit
3ac47220a0
4 changed files with 52 additions and 0 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include "ardour/amp.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/route_group.h"
|
||||
#include "ardour/audio_track.h"
|
||||
#include "ardour/midi_track.h"
|
||||
#include "ardour/vca.h"
|
||||
|
|
@ -415,6 +416,8 @@ OSC::register_callbacks()
|
|||
REGISTER_CALLBACK (serv, "/refresh", "f", refresh_surface);
|
||||
REGISTER_CALLBACK (serv, "/strip/list", "", routes_list);
|
||||
REGISTER_CALLBACK (serv, "/strip/list", "f", routes_list);
|
||||
REGISTER_CALLBACK (serv, "/group/list", "", group_list);
|
||||
REGISTER_CALLBACK (serv, "/group/list", "f", group_list);
|
||||
REGISTER_CALLBACK (serv, "/strip/custom/mode", "f", custom_mode);
|
||||
REGISTER_CALLBACK (serv, "/strip/custom/clear", "f", custom_clear);
|
||||
REGISTER_CALLBACK (serv, "/strip/custom/clear", "", custom_clear);
|
||||
|
|
@ -2963,6 +2966,31 @@ OSC::set_marker (const char* types, lo_arg **argv, int argc, lo_message msg)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
OSC::group_list (lo_message msg)
|
||||
{
|
||||
return send_group_list (get_address (msg));
|
||||
}
|
||||
|
||||
int
|
||||
OSC::send_group_list (lo_address addr)
|
||||
{
|
||||
//std::list<RouteGroup*> const & route_groups () const {
|
||||
lo_message reply;
|
||||
reply = lo_message_new ();
|
||||
|
||||
lo_message_add_string (reply, X_("none"));
|
||||
|
||||
std::list<RouteGroup*> groups = session->route_groups ();
|
||||
for (std::list<RouteGroup *>::iterator i = groups.begin(); i != groups.end(); ++i) {
|
||||
RouteGroup *rg = *i;
|
||||
lo_message_add_string (reply, rg->name().c_str());
|
||||
}
|
||||
lo_send_message (addr, X_("/group/list"), reply);
|
||||
lo_message_free (reply);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
OSC::click_level (float position)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
int int_message_with_id (std::string, uint32_t ssid, int value, bool in_line, lo_address addr);
|
||||
int text_message_with_id (std::string path, uint32_t ssid, std::string val, bool in_line, lo_address addr);
|
||||
|
||||
int send_group_list (lo_address addr);
|
||||
|
||||
int start ();
|
||||
int stop ();
|
||||
|
||||
|
|
@ -301,6 +303,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
int route_get_sends (lo_message msg);
|
||||
int route_get_receives(lo_message msg);
|
||||
void routes_list (lo_message msg);
|
||||
int group_list (lo_message msg);
|
||||
void surface_list (lo_message msg);
|
||||
void transport_sample (lo_message msg);
|
||||
void transport_speed (lo_message msg);
|
||||
|
|
@ -348,6 +351,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
|
|||
PATH_CALLBACK_MSG(route_get_sends);
|
||||
PATH_CALLBACK_MSG(route_get_receives);
|
||||
PATH_CALLBACK_MSG(routes_list);
|
||||
PATH_CALLBACK_MSG(group_list);
|
||||
PATH_CALLBACK_MSG(surface_list);
|
||||
PATH_CALLBACK_MSG(transport_sample);
|
||||
PATH_CALLBACK_MSG(transport_speed);
|
||||
|
|
|
|||
|
|
@ -127,6 +127,11 @@ OSCGlobalObserver::OSCGlobalObserver (OSC& o, Session& s, ArdourSurface::OSC::OS
|
|||
click_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCGlobalObserver::send_change_message, this, X_("/click/level"), click_controllable), OSC::instance());
|
||||
send_change_message ("/click/level", click_controllable);
|
||||
|
||||
session->route_group_added.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSCGlobalObserver::group_changed, this, _1), OSC::instance());
|
||||
session->route_group_removed.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSCGlobalObserver::group_changed, this), OSC::instance());
|
||||
session->route_groups_reordered.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSCGlobalObserver::group_changed, this), OSC::instance());
|
||||
_osc.send_group_list (addr);
|
||||
|
||||
extra_check ();
|
||||
jog_mode (jogmode);
|
||||
|
||||
|
|
@ -205,6 +210,7 @@ OSCGlobalObserver::clear_observer ()
|
|||
_osc.float_message (X_("/toggle_punch_in"), 0, addr);
|
||||
_osc.float_message (X_("/toggle_click"), 0, addr);
|
||||
_osc.float_message (X_("/click/level"), 0, addr);
|
||||
_osc.text_message (X_("/group/list"), " ", addr);
|
||||
_osc.text_message (X_("/jog/mode/name"), " ", addr);
|
||||
_osc.int_message (X_("/jog/mode"), 0, addr);
|
||||
|
||||
|
|
@ -547,3 +553,15 @@ OSCGlobalObserver::jog_mode (uint32_t jogmode)
|
|||
_osc.int_message (X_("/jog/mode"), jogmode, addr);
|
||||
}
|
||||
|
||||
void
|
||||
OSCGlobalObserver::group_changed (ARDOUR::RouteGroup *rg)
|
||||
{
|
||||
_osc.send_group_list (addr);
|
||||
}
|
||||
|
||||
void
|
||||
OSCGlobalObserver::group_changed ()
|
||||
{
|
||||
_osc.send_group_list (addr);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ class OSCGlobalObserver
|
|||
void extra_check (void);
|
||||
void marks_changed (void);
|
||||
void mark_update (void);
|
||||
void group_changed (ARDOUR::RouteGroup*);
|
||||
void group_changed (void);
|
||||
};
|
||||
|
||||
#endif /* __osc_oscglobalobserver_h__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue