X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fsurfaces%2Ffaderport%2Foperations.cc;h=ad0bf3ebd9f398061daafce00c55ab863fdd78be;hb=e52c8e376a068c11a9a771a15977a65c067c71e6;hp=592b26da23068979341cba81f810458d7d5f64c0;hpb=653ae4acd639fef149314fe6f8c7a0d862afae40;p=ardour.git diff --git a/libs/surfaces/faderport/operations.cc b/libs/surfaces/faderport/operations.cc index 592b26da23..ad0bf3ebd9 100644 --- a/libs/surfaces/faderport/operations.cc +++ b/libs/surfaces/faderport/operations.cc @@ -22,6 +22,7 @@ #include "ardour/pannable.h" #include "ardour/plugin_insert.h" #include "ardour/rc_configuration.h" +#include "ardour/record_enable_control.h" #include "ardour/session.h" #include "ardour/track.h" #include "ardour/types.h" @@ -40,7 +41,7 @@ static const double encoder_divider = 24.0; void FaderPort::left () { - access_action ("Editor/select-prev-route"); + access_action ("Editor/select-prev-stripable"); //ToDo: bank by 8? //if ( (button_state & ShiftDown) == ShiftDown ) @@ -50,7 +51,7 @@ FaderPort::left () void FaderPort::right () { - access_action ("Editor/select-next-route"); + access_action ("Editor/select-next-stripable"); //ToDo: bank by 8? //if ( (button_state & ShiftDown) == ShiftDown ) @@ -60,8 +61,8 @@ FaderPort::right () void FaderPort::read () { - if (_current_route) { - boost::shared_ptr gain = _current_route->gain_control (); + if (_current_stripable) { + boost::shared_ptr gain = _current_stripable->gain_control (); if (gain) { gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Play ); } @@ -71,8 +72,8 @@ FaderPort::read () void FaderPort::write () { - if (_current_route) { - boost::shared_ptr gain = _current_route->gain_control (); + if (_current_stripable) { + boost::shared_ptr gain = _current_stripable->gain_control (); if (gain) { gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Write ); } @@ -82,8 +83,8 @@ FaderPort::write () void FaderPort::touch () { - if (_current_route) { - boost::shared_ptr gain = _current_route->gain_control (); + if (_current_stripable) { + boost::shared_ptr gain = _current_stripable->gain_control (); if (gain) { gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Touch ); } @@ -93,8 +94,8 @@ FaderPort::touch () void FaderPort::off () { - if (_current_route) { - boost::shared_ptr gain = _current_route->gain_control (); + if (_current_stripable) { + boost::shared_ptr gain = _current_stripable->gain_control (); if (gain) { gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Off ); } @@ -119,47 +120,37 @@ FaderPort::redo () void FaderPort::mute () { - if (!_current_route) { + if (!_current_stripable) { return; } - if (_current_route == session->monitor_out()) { - boost::shared_ptr mp = _current_route->monitor_control(); + if (_current_stripable == session->monitor_out()) { + boost::shared_ptr mp = _current_stripable->monitor_control(); mp->set_cut_all (!mp->cut_all()); return; } - boost::shared_ptr cl (new ControlList); - cl->push_back (_current_route->mute_control()); - session->set_controls (cl, !_current_route->muted(), PBD::Controllable::UseGroup); + _current_stripable->mute_control()->set_value (!_current_stripable->mute_control()->muted(), PBD::Controllable::UseGroup); } void FaderPort::solo () { - if (!_current_route) { + if (!_current_stripable) { return; } - bool yn; - - if (Config->get_solo_control_is_listen_control()) { - yn = !_current_route->listening_via_monitor(); - } else { - yn = !_current_route->soloed(); - } - - _current_route->solo_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::UseGroup); + session->set_control (_current_stripable->solo_control(), !_current_stripable->solo_control()->self_soloed(), PBD::Controllable::UseGroup); } void FaderPort::rec_enable () { - if (!_current_route) { + if (!_current_stripable) { return; } - boost::shared_ptr t = boost::dynamic_pointer_cast(_current_route); + boost::shared_ptr t = boost::dynamic_pointer_cast(_current_stripable); if (!t) { return; @@ -171,18 +162,18 @@ FaderPort::rec_enable () void FaderPort::use_master () { - boost::shared_ptr r = session->master_out(); + boost::shared_ptr r = session->master_out(); if (r) { - if (_current_route == r) { - r = pre_master_route.lock(); - set_current_route (r); + if (_current_stripable == r) { + r = pre_master_stripable.lock(); + set_current_stripable (r); get_button(Output).set_led_state (_output_port, false); blinkers.remove (Output); } else { - if (_current_route != session->master_out() && _current_route != session->monitor_out()) { - pre_master_route = boost::weak_ptr (_current_route); + if (_current_stripable != session->master_out() && _current_stripable != session->monitor_out()) { + pre_master_stripable = boost::weak_ptr (_current_stripable); } - set_current_route (r); + set_current_stripable (r); get_button(Output).set_led_state (_output_port, true); blinkers.remove (Output); } @@ -192,19 +183,19 @@ FaderPort::use_master () void FaderPort::use_monitor () { - boost::shared_ptr r = session->monitor_out(); + boost::shared_ptr r = session->monitor_out(); if (r) { - if (_current_route == r) { - r = pre_monitor_route.lock(); - set_current_route (r); + if (_current_stripable == r) { + r = pre_monitor_stripable.lock(); + set_current_stripable (r); get_button(Output).set_led_state (_output_port, false); blinkers.remove (Output); } else { - if (_current_route != session->master_out() && _current_route != session->monitor_out()) { - pre_monitor_route = boost::weak_ptr (_current_route); + if (_current_stripable != session->master_out() && _current_stripable != session->monitor_out()) { + pre_monitor_stripable = boost::weak_ptr (_current_stripable); } - set_current_route (r); + set_current_stripable (r); get_button(Output).set_led_state (_output_port, true); blinkers.push_back (Output); } @@ -215,11 +206,17 @@ FaderPort::use_monitor () void FaderPort::ardour_pan_azimuth (int delta) { - if (!_current_route) { + if (!_current_stripable) { + return; + } + + boost::shared_ptr r = boost::dynamic_pointer_cast (_current_stripable); + + if (!r) { return; } - boost::shared_ptr pannable = _current_route->pannable (); + boost::shared_ptr pannable = r->pannable (); if (!pannable) { return; @@ -238,11 +235,17 @@ FaderPort::ardour_pan_azimuth (int delta) void FaderPort::ardour_pan_width(int delta) { - if (!_current_route) { + if (!_current_stripable) { return; } - boost::shared_ptr pannable = _current_route->pannable (); + boost::shared_ptr r = boost::dynamic_pointer_cast (_current_stripable); + + if (!r) { + return; + } + + boost::shared_ptr pannable = r->pannable (); if (!pannable) { return; @@ -261,12 +264,18 @@ void FaderPort::mixbus_pan (int delta) { #ifdef MIXBUS - if (!_current_route) { + if (!_current_stripable) { return; } + boost::shared_ptr r = boost::dynamic_pointer_cast (_current_stripable); + + if (!r) { + return; + } + const uint32_t port_channel_post_pan = 2; // gtk2_ardour/mixbus_ports.h - boost::shared_ptr plug = _current_route->ch_post(); + boost::shared_ptr plug = r->ch_post(); if (!plug) { return;