13
0

NO-OP: re-order code, add comments

This commit is contained in:
Robin Gareus 2017-04-20 17:19:03 +02:00
parent 8add4eefad
commit b6c222555f
4 changed files with 43 additions and 27 deletions

View File

@ -48,6 +48,11 @@ using namespace ArdourSurface::FP8Types;
_ctrls.button (ID).pressed.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_user, this, true, ID)); \
_ctrls.button (ID).released.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_user, this, false, ID));
/* Bind button signals (press, release) to callback methods
* (called once after constructing buttons).
* Bound actions are handled the the ctrl-surface thread.
*/
void
FaderPort8::setup_actions ()
{
@ -101,6 +106,10 @@ FaderPort8::setup_actions ()
}
}
/* ****************************************************************************
* Direct control callback Actions
*/
void
FaderPort8::button_play ()
{
@ -254,28 +263,34 @@ FaderPort8::button_mute_clear ()
session->set_controls (cl, 0.0, PBD::Controllable::UseGroup);
}
void
FaderPort8::button_arm (bool press)
{
FaderMode fadermode = _ctrls.fader_mode ();
if (fadermode == ModeTrack || fadermode == ModePan) {
_ctrls.button (FP8Controls::BtnArm).set_active (press);
ARMButtonChange (press);
}
}
void
FaderPort8::button_arm_all ()
{
BasicUI::all_tracks_rec_in ();
}
/* access generic action */
void
FaderPort8::button_action (const std::string& group, const std::string& item)
{
AccessAction (group, item);
}
/* ****************************************************************************
* Mode specific and internal callbacks
*/
/* handle "ARM" press -- act like shift, change "Select" button mode */
void
FaderPort8::button_arm (bool press)
{
FaderMode fadermode = _ctrls.fader_mode ();
if (fadermode == ModeTrack || fadermode == ModePan) {
_ctrls.button (FP8Controls::BtnArm).set_active (press);
ARMButtonChange (press); /* EMIT SIGNAL */
}
}
void
FaderPort8::button_prev_next (bool next)
{

View File

@ -31,7 +31,7 @@ namespace ArdourSurface {
#define fp8_context() dynamic_cast<BaseUI*>(&_base)
#define fp8_protocol() dynamic_cast<ControlProtocol*>(&_base)
/** Virtual abstracte base of the FaderPort8 control surface
/** Virtual abstract base of the FaderPort8 control surface
*
* This is passed as handle to all elements (buttons, lights,..)
* to inteface common functionality for the current instance:

View File

@ -276,6 +276,7 @@ FP8Controls::initialize ()
FP8ButtonInterface::force_change = false;
}
void
FP8Controls::all_lights_off () const
{

View File

@ -315,32 +315,35 @@ FP8Strip::group_mode () const
void
FP8Strip::set_mute (bool on)
{
if (_mute_ctrl) {
if (_mute_ctrl->automation_state() == Touch && !_mute_ctrl->touching ()) {
_mute_ctrl->start_touch (_mute_ctrl->session().transport_frame());
}
_mute_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
if (!_mute_ctrl) {
return;
}
if (_mute_ctrl->automation_state() == Touch && !_mute_ctrl->touching ()) {
_mute_ctrl->start_touch (_mute_ctrl->session().transport_frame());
}
_mute_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
}
void
FP8Strip::set_solo (bool on)
{
if (_solo_ctrl) {
if (_solo_ctrl->automation_state() == Touch && !_solo_ctrl->touching ()) {
_solo_ctrl->start_touch (_solo_ctrl->session().transport_frame());
}
_solo_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
if (!_solo_ctrl) {
return;
}
if (_solo_ctrl->automation_state() == Touch && !_solo_ctrl->touching ()) {
_solo_ctrl->start_touch (_solo_ctrl->session().transport_frame());
}
_solo_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
}
void
FP8Strip::set_recarm ()
{
if (_rec_ctrl) {
const bool on = !recarm_button ().is_active();
_rec_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
if (!_rec_ctrl) {
return;
}
const bool on = !recarm_button ().is_active();
_rec_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
}
void
@ -431,8 +434,6 @@ FP8Strip::notify_x_select_changed ()
select_button ().set_active (_x_select_ctrl->get_value() > 0.);
select_button ().set_color (0xffff00ff);
select_button ().set_blinking (false);
} else {
; // leave alone.
}
}
@ -562,7 +563,6 @@ FP8Strip::set_strip_mode (uint8_t strip_mode, bool clear)
}
_strip_mode = strip_mode;
_base.tx_sysex (3, 0x13, _id, (_strip_mode & 0x07) | (clear ? 0x10 : 0));
//_base.tx_midi3 (0xb0, 0x38 + _id, _bar_mode);
}
void