diff options
author | Len Ovens <len@ovenwerks.net> | 2018-02-18 09:15:35 -0800 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2018-02-18 09:16:16 -0800 |
commit | a9d041c62ef209c861a41dd65e39ad62058fd523 (patch) | |
tree | 51d24ed7c134425df20ec8db77536455a98d5336 /libs | |
parent | 08632d623e2a9bf515520ed6450ad9f86ed9b3d8 (diff) |
OSC: allow setting of marker name
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 332ea54067..14cdf04bd8 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -2932,13 +2932,24 @@ OSC::set_marker (const char* types, lo_arg **argv, int argc, lo_message msg) switch (types[0]) { case 's': - for (Locations::LocationList::const_iterator l = ll.begin(); l != ll.end(); ++l) { - if ((*l)->is_mark ()) { - if (strcmp (&argv[0]->s, (*l)->name().c_str()) == 0) { - session->request_locate ((*l)->start (), false); - return 0; + { + Location *cur_mark = 0; + for (Locations::LocationList::const_iterator l = ll.begin(); l != ll.end(); ++l) { + if ((*l)->is_mark ()) { + if (strcmp (&argv[0]->s, (*l)->name().c_str()) == 0) { + session->request_locate ((*l)->start (), false); + return 0; + } else if ((*l)->start () == session->transport_sample()) { + cur_mark = (*l); + } } } + if (cur_mark) { + cur_mark->set_name (&argv[0]->s); + return 0; + } + PBD::warning << string_compose ("Marker: \"%1\" - does not exist", &argv[0]->s) << endmsg; + return -1; } break; case 'i': @@ -2979,7 +2990,6 @@ OSC::group_list (lo_message msg) int OSC::send_group_list (lo_address addr) { - //std::list<RouteGroup*> const & route_groups () const { lo_message reply; reply = lo_message_new (); |