when selecting one of a set of variable I/O configs for an AudioUnit so that its...
[ardour.git] / libs / surfaces / control_protocol / basic_ui.cc
index 0019efb91801e3bda4cce815b8d8c66720389e4e..2ed82cd8c328d6a6f1d12d4e1ac766a6a4c87897 100644 (file)
@@ -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