diff options
author | Robin Gareus <robin@gareus.org> | 2015-04-13 16:20:40 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-04-12 23:40:35 +0200 |
commit | d00ab0221ad6e257fe9868890b54324454b6462b (patch) | |
tree | 8af3829d13d1b108e9016e81981d8c2aa3cffc6d | |
parent | aef680511477a925dd07e290d06f68dbc044ac27 (diff) |
allow to set/change loop-range via OSC
-rw-r--r-- | libs/surfaces/control_protocol/basic_ui.cc | 14 | ||||
-rw-r--r-- | libs/surfaces/control_protocol/control_protocol/basic_ui.h | 1 | ||||
-rw-r--r-- | libs/surfaces/osc/osc.cc | 1 | ||||
-rw-r--r-- | libs/surfaces/osc/osc.h | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 98e7adf949..bf6bb25f2c 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -80,6 +80,20 @@ BasicUI::loop_toggle () } void +BasicUI::loop_location (framepos_t start, framepos_t end) +{ + Location* tll; + if ((tll = session->locations()->auto_loop_location()) == 0) { + Location* loc = new Location (*session, start, end, _("Loop"), Location::IsAutoLoop); + session->locations()->add (loc, true); + session->set_auto_loop_location (loc); + } else { + tll->set_hidden (false, this); + tll->set (start, end); + } +} + +void BasicUI::goto_start () { session->goto_start (); diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index 277a7f8ecd..6053614a0c 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -49,6 +49,7 @@ class LIBCONTROLCP_API BasicUI { /* transport control */ void loop_toggle (); + void loop_location (framepos_t start, framepos_t end); void access_action ( std::string action_path ); static PBD::Signal2<void,std::string,std::string> AccessAction; void goto_start (); diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 5def3149b5..1fcf64bd30 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -344,6 +344,7 @@ OSC::register_callbacks() REGISTER_CALLBACK (serv, "/ardour/add_marker", "", add_marker); REGISTER_CALLBACK (serv, "/ardour/access_action", "s", access_action); REGISTER_CALLBACK (serv, "/ardour/loop_toggle", "", loop_toggle); + REGISTER_CALLBACK (serv, "/ardour/loop_location", "ii", loop_location); REGISTER_CALLBACK (serv, "/ardour/goto_start", "", goto_start); REGISTER_CALLBACK (serv, "/ardour/goto_end", "", goto_end); REGISTER_CALLBACK (serv, "/ardour/rewind", "", rewind); diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h index 2479eceaff..884b89c6a2 100644 --- a/libs/surfaces/osc/osc.h +++ b/libs/surfaces/osc/osc.h @@ -208,6 +208,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest> } PATH_CALLBACK2(locate,i,i); + PATH_CALLBACK2(loop_location,i,i); PATH_CALLBACK2(route_mute,i,i); PATH_CALLBACK2(route_solo,i,i); PATH_CALLBACK2(route_recenable,i,i); |