summaryrefslogtreecommitdiff
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
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
-rw-r--r--libs/surfaces/mackie/bcf_surface.cc12
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc25
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h4
-rw-r--r--libs/surfaces/mackie/scripts/bcf-controls.csv4
-rw-r--r--manual/xml/mackie.xml15
5 files changed, 47 insertions, 13 deletions
diff --git a/libs/surfaces/mackie/bcf_surface.cc b/libs/surfaces/mackie/bcf_surface.cc
index 7e58209c36..45b5ad85fa 100644
--- a/libs/surfaces/mackie/bcf_surface.cc
+++ b/libs/surfaces/mackie/bcf_surface.cc
@@ -615,8 +615,8 @@ void Mackie::BcfSurface::init_controls()
group->add( *control );
group = groups["modifiers"];
- control = new Button ( 71, 1, "option", *group );
- buttons[0x47] = control;
+ control = new Button ( 80, 1, "option", *group );
+ buttons[0x50] = control;
controls.push_back( control );
controls_by_name["option"] = control;
group->add( *control );
@@ -664,8 +664,8 @@ void Mackie::BcfSurface::init_controls()
group->add( *control );
group = groups["functions"];
- control = new Button ( 80, 1, "marker", *group );
- buttons[0x50] = control;
+ control = new Button ( 71, 1, "marker", *group );
+ buttons[0x47] = control;
controls.push_back( control );
controls_by_name["marker"] = control;
group->add( *control );
@@ -1182,7 +1182,7 @@ void Mackie::BcfSurface::handle_button( MackieButtonHandler & mbh, ButtonState b
}
break;
- case 0x47: // option
+ case 0x50: // option
switch ( bs ) {
case press: ls = mbh.option_press( button ); break;
case release: ls = mbh.option_release( button ); break;
@@ -1238,7 +1238,7 @@ void Mackie::BcfSurface::handle_button( MackieButtonHandler & mbh, ButtonState b
}
break;
- case 0x50: // marker
+ case 0x47: // marker
switch ( bs ) {
case press: ls = mbh.marker_press( button ); break;
case release: ls = mbh.marker_release( button ); break;
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;
+}
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index f204ae4269..de44075262 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -178,6 +178,10 @@ class MackieControlProtocol
virtual Mackie::LedState global_solo_press( Mackie::Button & );
virtual Mackie::LedState global_solo_release( Mackie::Button & );
+
+ // function buttons
+ virtual Mackie::LedState marker_press( Mackie::Button & );
+ virtual Mackie::LedState marker_release( Mackie::Button & );
protected:
// create instances of MackiePort, depending on what's found in ardour.rc
diff --git a/libs/surfaces/mackie/scripts/bcf-controls.csv b/libs/surfaces/mackie/scripts/bcf-controls.csv
index 8949e1486b..e22965a906 100644
--- a/libs/surfaces/mackie/scripts/bcf-controls.csv
+++ b/libs/surfaces/mackie/scripts/bcf-controls.csv
@@ -49,14 +49,14 @@ button,1,,F15,1,0,0x44
button,1,,F16,1,0,0x45
# turn on/off all solos
button,1,,global_solo,1,0,0x27
-button,1,modifiers,option,1,0,0x47
+button,1,modifiers,option,1,0,0x50
button,1,modifiers,cmd_alt,1,0,0x49
button,1,automation,on,1,1,0x4a
button,1,automation,rec_ready,1,1,0x4b
button,1,functions,undo,1,1,0x4c
button,1,automation,snapshot,1,1,0x4d
button,1,functions,redo,1,1,0x4f
-button,1,functions,marker,1,1,0x50
+button,1,functions,marker,1,1,0x47
button,1,functions,enter,1,1,0x51
button,1,functions,cancel,1,0,0x52
button,1,functions,mixer,1,0,0x53
diff --git a/manual/xml/mackie.xml b/manual/xml/mackie.xml
index a8a3ca012c..829ccb4d5d 100644
--- a/manual/xml/mackie.xml
+++ b/manual/xml/mackie.xml
@@ -136,7 +136,7 @@
Making a pot pretend to be a shuttle wheel doesn't work
very well.
</para>
- </footnote> / nothing
+ </footnote> / global solo
</entry>
<entry namest="Buttons 1" nameend="Buttons 2">
@@ -158,7 +158,9 @@
</entry>
<entry>
- loop (shift2: punch in)
+ <para>loop</para>
+ <para>shift 1: marker</para>
+ <para>shift 2: punch in</para>
</entry>
</row>
@@ -176,7 +178,8 @@
</entry>
<entry>
- click (shift2: punch out)
+ <para>click</para>
+ <para>shift 2: punch out</para>
</entry>
</row>
@@ -210,11 +213,13 @@
<row>
<entry>
- previous bank (shift 1: previous route)
+ <para>previous bank</para>
+ <para>shift 1: previous route</para>
</entry>
<entry>
- next bank (shift 1: next route)
+ <para>next bank</para>
+ <para>shift 1: next route</para>
</entry>
</row>