summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/mackie_control_protocol.cc
diff options
context:
space:
mode:
authorJohn Anderson <ardour@semiosix.com>2007-04-11 21:17:20 +0000
committerJohn Anderson <ardour@semiosix.com>2007-04-11 21:17:20 +0000
commit39b66ff402cc4b1c566301d01133e39bcc894a4c (patch)
treec83db8599e0e0f5eb9469394c629ae7ba187cde6 /libs/surfaces/mackie/mackie_control_protocol.cc
parent60b97472b1e99c75fe68dd20de59d105c09b6c4e (diff)
button to add new marker location at current transport position
git-svn-id: svn://localhost/ardour2/trunk@1704 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/mackie/mackie_control_protocol.cc')
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index aa037ff60e..b1c8ef2ff8 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -37,6 +37,7 @@
#include <midi++/manager.h>
#include <pbd/pthread_utils.h>
#include <pbd/error.h>
+#include <pbd/memento_command.h>
#include <ardour/route.h>
#include <ardour/session.h>
@@ -1408,3 +1409,27 @@ LedState MackieControlProtocol::channel_right_release( Button & button )
{
return off;
}
+
+/////////////////////////////////////
+// Functions
+/////////////////////////////////////
+LedState MackieControlProtocol::marker_press( Button & button )
+{
+ // cut'n'paste from LocationUI::add_new_location()
+ string markername;
+ nframes_t where = session->audible_frame();
+ session->locations()->next_available_name(markername,"mcu");
+ Location *location = new Location (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 ();
+ return on;
+}
+
+LedState MackieControlProtocol::marker_release( Button & button )
+{
+ return off;
+}