Faderport: use well-known-controls API
This commit is contained in:
@@ -468,14 +468,10 @@ FaderPort::encoder_handler (MIDI::Parser &, MIDI::pitchbend_t pb)
|
||||
trim->set_value (dB_to_coefficient (val), Controllable::UseGroup);
|
||||
}
|
||||
} else if (width_modifier && ((button_state & width_modifier) == width_modifier)) {
|
||||
ardour_pan_width (delta);
|
||||
pan_width (delta);
|
||||
|
||||
} else { // pan/balance
|
||||
if (!Profile->get_mixbus()) {
|
||||
ardour_pan_azimuth (delta);
|
||||
} else {
|
||||
mixbus_pan (delta);
|
||||
}
|
||||
pan_azimuth (delta);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -328,9 +328,8 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
|
||||
void mute ();
|
||||
void rec_enable ();
|
||||
|
||||
void ardour_pan_azimuth (int);
|
||||
void ardour_pan_width (int);
|
||||
void mixbus_pan (int);
|
||||
void pan_azimuth (int);
|
||||
void pan_width (int);
|
||||
|
||||
void punch ();
|
||||
};
|
||||
|
||||
@@ -205,7 +205,7 @@ FaderPort::use_monitor ()
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort::ardour_pan_azimuth (int delta)
|
||||
FaderPort::pan_azimuth (int delta)
|
||||
{
|
||||
if (!_current_stripable) {
|
||||
return;
|
||||
@@ -217,13 +217,7 @@ FaderPort::ardour_pan_azimuth (int delta)
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Pannable> pannable = r->pannable ();
|
||||
|
||||
if (!pannable) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> azimuth = pannable->pan_azimuth_control;
|
||||
boost::shared_ptr<AutomationControl> azimuth = r->pan_azimuth_control ();
|
||||
|
||||
if (!azimuth) {
|
||||
return;
|
||||
@@ -234,7 +228,7 @@ FaderPort::ardour_pan_azimuth (int delta)
|
||||
|
||||
|
||||
void
|
||||
FaderPort::ardour_pan_width(int delta)
|
||||
FaderPort::pan_width(int delta)
|
||||
{
|
||||
if (!_current_stripable) {
|
||||
return;
|
||||
@@ -246,13 +240,7 @@ FaderPort::ardour_pan_width(int delta)
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Pannable> pannable = r->pannable ();
|
||||
|
||||
if (!pannable) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> width = pannable->pan_width_control;
|
||||
boost::shared_ptr<AutomationControl> width = r->pan_width_control ();
|
||||
|
||||
if (!width) {
|
||||
return;
|
||||
@@ -261,37 +249,6 @@ FaderPort::ardour_pan_width(int delta)
|
||||
width->set_value (width->interface_to_internal (width->internal_to_interface (width->get_value()) + (delta / encoder_divider)), Controllable::NoGroup);
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort::mixbus_pan (int delta)
|
||||
{
|
||||
#ifdef MIXBUS
|
||||
if (!_current_stripable) {
|
||||
return;
|
||||
}
|
||||
boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (_current_stripable);
|
||||
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const uint32_t port_channel_post_pan = 2; // gtk2_ardour/mixbus_ports.h
|
||||
boost::shared_ptr<ARDOUR::PluginInsert> plug = r->ch_post();
|
||||
|
||||
if (!plug) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<AutomationControl> azimuth = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (plug->control (Evoral::Parameter (ARDOUR::PluginAutomation, 0, port_channel_post_pan)));
|
||||
|
||||
if (!azimuth) {
|
||||
return;
|
||||
}
|
||||
|
||||
azimuth->set_value (azimuth->interface_to_internal (azimuth->internal_to_interface (azimuth->get_value()) + (delta / encoder_divider)), Controllable::NoGroup);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort::punch ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user