+ case TrimAutomation:
+ _trim_mode = TrimAutomation;
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
+ /* gain to vpot, trim to fader */
+ _vpot->set_control (_route->gain_control());
+ control_by_parameter[GainAutomation] = _vpot;
+ if (_route->trim() && route()->trim()->active()) {
+ _fader->set_control (_route->trim_control());
+ control_by_parameter[TrimAutomation] = _fader;
+ } else {
+ _fader->set_control (boost::shared_ptr<AutomationControl>());
+ control_by_parameter[TrimAutomation] = 0;
+ }
+ } else {
+ /* gain to fader, trim to vpot */
+ _fader->set_control (_route->gain_control());
+ control_by_parameter[GainAutomation] = _fader;
+ if (_route->trim() && route()->trim()->active()) {
+ _vpot->set_control (_route->trim_control());
+ control_by_parameter[TrimAutomation] = _vpot;
+ } else {
+ _vpot->set_control (boost::shared_ptr<AutomationControl>());
+ control_by_parameter[TrimAutomation] = 0;
+ }
+ }
+ break;
+ case PhaseAutomation:
+ _trim_mode = PhaseAutomation;
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
+ /* gain to vpot, phase to fader */
+ _vpot->set_control (_route->gain_control());
+ control_by_parameter[GainAutomation] = _vpot;
+ if (_route->phase_invert().size()) {
+ _fader->set_control (_route->phase_control());
+ control_by_parameter[PhaseAutomation] = _fader;
+ } else {
+ _fader->set_control (boost::shared_ptr<AutomationControl>());
+ control_by_parameter[PhaseAutomation] = 0;
+ }
+ } else {
+ /* gain to fader, phase to vpot */
+ _fader->set_control (_route->gain_control());
+ control_by_parameter[GainAutomation] = _fader;
+ if (_route->phase_invert().size()) {
+ _vpot->set_control (_route->phase_control());
+ control_by_parameter[PhaseAutomation] = _vpot;
+ } else {
+ _vpot->set_control (boost::shared_ptr<AutomationControl>());
+ control_by_parameter[PhaseAutomation] = 0;
+ }
+ }
+ break;
+ case SendAutomation:
+ // deal with sends ... needs sends yet :)
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
+ // gain to vpot, trim to fader
+ _vpot->set_control (_route->gain_control());
+ control_by_parameter[GainAutomation] = _vpot;
+ _fader->set_control (boost::shared_ptr<AutomationControl>());
+ } else {
+ // gain to fader, trim to vpot
+ _fader->set_control (_route->gain_control());
+ control_by_parameter[GainAutomation] = _fader;
+ _vpot->set_control (boost::shared_ptr<AutomationControl>());
+ }
+ break;
+ default:
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("vpot mode %1 not known.\n", p));
+ break;
+