diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-11 20:18:01 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-11 20:18:01 +0000 |
commit | 5ae258e23b4faa49936fedc2030ba2eb58e581fd (patch) | |
tree | 34a15bba3ac3ed4b9b3e923cbbb1a1368953d987 /libs/surfaces/control_protocol/basic_ui.cc | |
parent | b2cd8b004ceb5052c2226505ac0ecadce59ba2de (diff) |
MCP: share add-marker code with BasicUI; don't allow route locking if the strip has no current route
git-svn-id: svn://localhost/ardour2/branches/3.0@11916 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/control_protocol/basic_ui.cc')
-rw-r--r-- | libs/surfaces/control_protocol/basic_ui.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 0019efb918..2ed82cd8c3 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -19,6 +19,7 @@ */ #include "pbd/pthread_utils.h" +#include "pbd/memento_command.h" #include "ardour/session.h" #include "ardour/location.h" @@ -91,10 +92,16 @@ BasicUI::goto_end () } void -BasicUI::add_marker () -{ - framepos_t when = session->audible_frame(); - session->locations()->add (new Location (*session, when, when, _("unnamed"), Location::IsMark)); +BasicUI::add_marker (const std::string& markername) +{ + framepos_t where = session->audible_frame(); + Location *location = new Location (*session, where, where, markername, Location::IsMark); + session->begin_reversible_command (_("add marker")); + XMLNode &before = session->locations()->get_state(); + session->locations()->add (location, true); + XMLNode &after = session->locations()->get_state(); + session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after)); + session->commit_reversible_command (); } void |