Remove unnecessary tests for touch-state

This commit is contained in:
Robin Gareus 2017-07-25 20:16:04 +02:00
parent bde3edf1c8
commit 2fa34614d0
4 changed files with 13 additions and 39 deletions

View file

@ -331,9 +331,7 @@ FaderPort8::button_solo_clear ()
if (!ac) { if (!ac) {
continue; continue;
} }
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
cl->push_back (ac); cl->push_back (ac);
} }
if (!cl->empty()) { if (!cl->empty()) {
@ -358,9 +356,7 @@ FaderPort8::button_mute_clear ()
continue; continue;
} }
cl->push_back (ac); cl->push_back (ac);
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
} }
if (!cl->empty()) { if (!cl->empty()) {
session->set_controls (cl, 1.0, PBD::Controllable::NoGroup); session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
@ -400,9 +396,7 @@ FaderPort8::handle_encoder_pan (int steps)
ac = s->pan_azimuth_control (); ac = s->pan_azimuth_control ();
} }
if (ac) { if (ac) {
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
if (steps == 0) { if (steps == 0) {
ac->set_value (ac->normal(), PBD::Controllable::UseGroup); ac->set_value (ac->normal(), PBD::Controllable::UseGroup);
} else { } else {
@ -426,9 +420,7 @@ FaderPort8::handle_encoder_link (int steps)
} }
double v = ac->internal_to_interface (ac->get_value()); double v = ac->internal_to_interface (ac->get_value());
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
if (steps == 0) { if (steps == 0) {
ac->set_value (ac->normal(), PBD::Controllable::UseGroup); ac->set_value (ac->normal(), PBD::Controllable::UseGroup);
@ -535,9 +527,7 @@ FaderPort8::button_encoder ()
ac = session->master_out()->gain_control (); ac = session->master_out()->gain_control ();
} }
if (ac) { if (ac) {
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
ac->set_value (ac->normal(), PBD::Controllable::NoGroup); ac->set_value (ac->normal(), PBD::Controllable::NoGroup);
} }
} }
@ -617,9 +607,7 @@ FaderPort8::encoder_navigate (bool neg, int steps)
if (ac) { if (ac) {
double v = ac->internal_to_interface (ac->get_value()); double v = ac->internal_to_interface (ac->get_value());
v = std::max (0.0, std::min (1.0, v + steps * (neg ? -.01 : .01))); v = std::max (0.0, std::min (1.0, v + steps * (neg ? -.01 : .01)));
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
ac->set_value (ac->interface_to_internal(v), PBD::Controllable::NoGroup); ac->set_value (ac->interface_to_internal(v), PBD::Controllable::NoGroup);
} }
} }

View file

@ -297,9 +297,7 @@ FP8Strip::midi_touch (bool t)
return false; return false;
} }
if (t) { if (t) {
if (!ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
} else { } else {
ac->stop_touch (ac->session().transport_frame()); ac->stop_touch (ac->session().transport_frame());
} }
@ -317,9 +315,7 @@ FP8Strip::midi_fader (float val)
if (!ac) { if (!ac) {
return false; return false;
} }
if (ac->automation_state() == Touch && !ac->touching ()) { ac->start_touch (ac->session().transport_frame());
ac->start_touch (ac->session().transport_frame());
}
ac->set_value (ac->interface_to_internal (val), group_mode ()); ac->set_value (ac->interface_to_internal (val), group_mode ());
return true; return true;
} }
@ -344,9 +340,7 @@ FP8Strip::set_mute (bool on)
if (!_mute_ctrl) { if (!_mute_ctrl) {
return; return;
} }
if (_mute_ctrl->automation_state() == Touch && !_mute_ctrl->touching ()) { _mute_ctrl->start_touch (_mute_ctrl->session().transport_frame());
_mute_ctrl->start_touch (_mute_ctrl->session().transport_frame());
}
_mute_ctrl->set_value (on ? 1.0 : 0.0, group_mode ()); _mute_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
} }
@ -356,9 +350,7 @@ FP8Strip::set_solo (bool on)
if (!_solo_ctrl) { if (!_solo_ctrl) {
return; return;
} }
if (_solo_ctrl->automation_state() == Touch && !_solo_ctrl->touching ()) { _solo_ctrl->start_touch (_solo_ctrl->session().transport_frame());
_solo_ctrl->start_touch (_solo_ctrl->session().transport_frame());
}
_solo_ctrl->set_value (on ? 1.0 : 0.0, group_mode ()); _solo_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
} }
@ -379,9 +371,7 @@ FP8Strip::set_select ()
assert (!_x_select_ctrl); assert (!_x_select_ctrl);
_select_plugin_functor (); _select_plugin_functor ();
} else if (_x_select_ctrl) { } else if (_x_select_ctrl) {
if (_x_select_ctrl->automation_state() == Touch && !_x_select_ctrl->touching ()) { _x_select_ctrl->start_touch (_x_select_ctrl->session().transport_frame());
_x_select_ctrl->start_touch (_x_select_ctrl->session().transport_frame());
}
const bool on = !select_button ().is_active(); const bool on = !select_button ().is_active();
_x_select_ctrl->set_value (on ? 1.0 : 0.0, group_mode ()); _x_select_ctrl->set_value (on ? 1.0 : 0.0, group_mode ());
} }

View file

@ -1240,9 +1240,7 @@ GenericMidiControlProtocol::maybe_start_touch (Controllable* controllable)
{ {
AutomationControl *actl = dynamic_cast<AutomationControl*> (controllable); AutomationControl *actl = dynamic_cast<AutomationControl*> (controllable);
if (actl) { if (actl) {
if (actl->automation_state() == Touch && !actl->touching()) { actl->start_touch (session->audible_frame ());
actl->start_touch (session->audible_frame ());
}
} }
} }

View file

@ -2833,9 +2833,7 @@ OSC::touch_detect (const char *path, const char* types, lo_arg **argv, int argc,
if (control) { if (control) {
if (touch) { if (touch) {
//start touch //start touch
if (control->automation_state() == Touch && !control->touching ()) { control->start_touch (control->session().transport_frame());
control->start_touch (control->session().transport_frame());
}
ret = 0; ret = 0;
} else { } else {
// end touch // end touch