From 39b66ff402cc4b1c566301d01133e39bcc894a4c Mon Sep 17 00:00:00 2001 From: John Anderson Date: Wed, 11 Apr 2007 21:17:20 +0000 Subject: button to add new marker location at current transport position git-svn-id: svn://localhost/ardour2/trunk@1704 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/bcf_surface.cc | 12 ++++++------ libs/surfaces/mackie/mackie_control_protocol.cc | 25 +++++++++++++++++++++++++ libs/surfaces/mackie/mackie_control_protocol.h | 4 ++++ libs/surfaces/mackie/scripts/bcf-controls.csv | 4 ++-- manual/xml/mackie.xml | 15 ++++++++++----- 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 #include #include +#include #include #include @@ -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(*(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. - / nothing + / global solo @@ -158,7 +158,9 @@ - loop (shift2: punch in) + loop + shift 1: marker + shift 2: punch in @@ -176,7 +178,8 @@ - click (shift2: punch out) + click + shift 2: punch out @@ -210,11 +213,13 @@ - previous bank (shift 1: previous route) + previous bank + shift 1: previous route - next bank (shift 1: next route) + next bank + shift 1: next route -- cgit v1.2.3