button to add new marker location at current transport position

git-svn-id: svn://localhost/ardour2/trunk@1704 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
John Anderson 2007-04-11 21:17:20 +00:00
parent 60b97472b1
commit 39b66ff402
5 changed files with 47 additions and 13 deletions

View file

@ -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;

View file

@ -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;
}

View file

@ -179,6 +179,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
void create_ports();

View file

@ -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

Can't render this file because it has a wrong number of fields in line 2.

View file

@ -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>