case Rewind:
button_state = (tb->value ? ButtonState (button_state|RewindDown) : ButtonState (button_state&~RewindDown));
break;
+ case User:
+ button_state = (tb->value ? ButtonState (button_state|UserDown) : ButtonState (button_state&~UserDown));
+ break;
case FaderTouch:
fader_is_touched = tb->value;
if (_current_route) {
if (_current_route) {
- if ( (button_state & ShiftDown) == ShiftDown ) { //shift+encoder = input trim
+ ButtonState trim_modifier;
+ ButtonState width_modifier;
+
+ if (Profile->get_mixbus()) {
+ trim_modifier = ShiftDown;
+ width_modifier = ButtonState (0);
+ } else {
+ trim_modifier = UserDown;
+ width_modifier = ShiftDown;
+ }
+
+ if ((button_state & trim_modifier) == trim_modifier ) { // mod+encoder = input trim
boost::shared_ptr<AutomationControl> gain = _current_route->trim()->gain_control ();
if (gain) {
float val = gain->get_user(); //for gain elements, the "user" value is in dB
val += delta;
gain->set_user(val);
}
- } else { //pan / balance
+ } else if (width_modifier && ((button_state & width_modifier) == width_modifier)) {
+ ardour_pan_width (delta);
+
+ } else { // pan/balance
if (!Profile->get_mixbus()) {
- ardour_pan (delta);
+ ardour_pan_azimuth (delta);
} else {
mixbus_pan (delta);
}
mp->cut_control()->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_cut, this), this);
}
}
-
+
//ToDo: subscribe to the fader automation modes so we can light the LEDs
map_route_state ();
}
void
-FaderPort::ardour_pan (int delta)
+FaderPort::ardour_pan_azimuth (int delta)
{
if (!_current_route) {
return;
azimuth->set_value (azimuth->interface_to_internal (azimuth->internal_to_interface (azimuth->get_value()) + (delta / 64.0)));
}
+
+void
+FaderPort::ardour_pan_width(int delta)
+{
+ if (!_current_route) {
+ return;
+ }
+
+ boost::shared_ptr<Pannable> pannable = _current_route->pannable ();
+
+ if (!pannable) {
+ return;
+ }
+
+ boost::shared_ptr<AutomationControl> width = pannable->pan_width_control;
+
+ if (!width) {
+ return;
+ }
+
+ width->set_value (width->interface_to_internal (width->internal_to_interface (width->get_value()) + (delta / 64.0)));
+}
+
void
FaderPort::mixbus_pan (int delta)
{