2016-06-16 14:06:16 -04:00
|
|
|
#include "ardour/session.h"
|
|
|
|
|
|
|
|
#include "push2.h"
|
|
|
|
|
|
|
|
using namespace ArdourSurface;
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_play ()
|
|
|
|
{
|
|
|
|
if (session->transport_rolling ()) {
|
|
|
|
transport_stop ();
|
|
|
|
} else {
|
|
|
|
transport_play ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_recenable ()
|
|
|
|
{
|
|
|
|
rec_enable_toggle ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_up ()
|
|
|
|
{
|
|
|
|
scroll_up_1_track ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_down ()
|
|
|
|
{
|
|
|
|
scroll_dn_1_track ();
|
|
|
|
}
|
2016-06-16 17:45:41 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_right ()
|
|
|
|
{
|
|
|
|
ScrollTimeline (0.75);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_left ()
|
|
|
|
{
|
|
|
|
ScrollTimeline (-0.75);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_repeat ()
|
|
|
|
{
|
|
|
|
loop_toggle ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_metronome ()
|
|
|
|
{
|
|
|
|
toggle_click ();
|
|
|
|
}
|
2016-06-16 23:31:51 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_solo ()
|
|
|
|
{
|
|
|
|
cancel_all_solo ();
|
|
|
|
}
|
2016-06-17 00:15:55 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_new ()
|
|
|
|
{
|
|
|
|
access_action ("Editor/start-range-from-playhead");
|
|
|
|
|
|
|
|
id_button_map[New]->set_color (LED::White);
|
|
|
|
id_button_map[New]->set_state (LED::NoTransition);
|
|
|
|
write (id_button_map[New]->state_msg());
|
|
|
|
|
|
|
|
/* blink the button for the other half of this operation */
|
|
|
|
|
|
|
|
id_button_map[FixedLength]->set_color (LED::White);
|
|
|
|
id_button_map[FixedLength]->set_state (LED::Blinking4th);
|
|
|
|
write (id_button_map[FixedLength]->state_msg());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
Push2::button_fixed_length ()
|
|
|
|
{
|
|
|
|
access_action ("Editor/finish-range-from-playhead");
|
|
|
|
|
|
|
|
/* turn off both buttons for this operation */
|
|
|
|
|
|
|
|
id_button_map[New]->set_color (LED::Black);
|
|
|
|
id_button_map[New]->set_state (LED::NoTransition);
|
|
|
|
write (id_button_map[New]->state_msg());
|
|
|
|
id_button_map[FixedLength]->set_color (LED::Black);
|
|
|
|
id_button_map[FixedLength]->set_state (LED::NoTransition);
|
|
|
|
write (id_button_map[FixedLength]->state_msg());
|
|
|
|
}
|