MCP: map the well-known EQ knobs more explicitly, not heuristically.

This commit is contained in:
Ben Loftis 2017-05-17 15:53:14 -05:00
parent f2aac0bcae
commit 60cc2823f3

View file

@ -1645,112 +1645,97 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Stripable> r)
void void
Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r) Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
{ {
uint32_t bands = r->eq_band_cnt ();
if (bands == 0) {
/* should never get here */
return;
}
/* figure out how many params per band are available */
boost::shared_ptr<AutomationControl> pc; boost::shared_ptr<AutomationControl> pc;
uint32_t params_per_band = 0;
if ((pc = r->eq_gain_controllable (0))) {
params_per_band += 1;
}
if ((pc = r->eq_freq_controllable (0))) {
params_per_band += 1;
}
if ((pc = r->eq_q_controllable (0))) {
params_per_band += 1;
}
if ((pc = r->eq_shape_controllable (0))) {
params_per_band += 1;
}
/* pick the one for this strip, based on its global position across
* all surfaces
*/
pc.reset ();
const uint32_t total_band_parameters = bands * params_per_band;
const uint32_t global_pos = _surface->mcp().global_index (*this); const uint32_t global_pos = _surface->mcp().global_index (*this);
AutomationType param = NullAutomation; AutomationType param = NullAutomation;
int eq_band = -1;
string band_name; string band_name;
eq_band = -1; #ifdef MIXBUS
if ( r->is_input_strip() ) {
if (global_pos < total_band_parameters) { #ifdef MIXBUS32C
switch (global_pos) {
/* show a parameter for an EQ band */ case 0:
case 2:
const uint32_t parameter = global_pos % params_per_band; case 4:
eq_band = global_pos / params_per_band; case 6:
band_name = r->eq_band_name (eq_band); eq_band = global_pos / 2;
pc = r->eq_freq_controllable (eq_band);
switch (parameter) { band_name = r->eq_band_name (eq_band);
#ifdef MIXBUS32C //in 32C, we swap the order of freq/gain to match the GUI param = EQFrequency;
case 0: break;
pc = r->eq_freq_controllable (eq_band); case 1:
param = EQFrequency; case 3:
break; case 5:
case 1: case 7:
pc = r->eq_gain_controllable (eq_band); eq_band = global_pos / 2;
param = EQGain; pc = r->eq_gain_controllable (eq_band);
break; band_name = r->eq_band_name (eq_band);
#else param = EQGain;
case 0: break;
pc = r->eq_gain_controllable (eq_band); case 8:
param = EQGain; pc = r->eq_shape_controllable(0); //low band "bell" button
break; band_name = "lo";
case 1: param = EQShape;
pc = r->eq_freq_controllable (eq_band); break;
param = EQFrequency; case 9:
break; pc = r->eq_shape_controllable(3); //high band "bell" button
#endif band_name = "hi";
case 2: param = EQShape;
pc = r->eq_q_controllable (eq_band); break;
param = EQQ; case 10:
break; pc = r->eq_enable_controllable();
case 3: param = EQEnable;
pc = r->eq_shape_controllable (eq_band); break;
param = EQShape;
break;
} }
} else { #else //regular Mixbus channel EQ
/* show a non-band parameter (HPF or enable) switch (global_pos) {
*/ case 0:
case 2:
uint32_t parameter = global_pos - total_band_parameters; case 4:
eq_band = global_pos / 2;
switch (parameter) { pc = r->eq_gain_controllable (eq_band);
#ifndef MIXBUS32C band_name = r->eq_band_name (eq_band);
case 0: /* first control after band parameters */ param = EQGain;
pc = r->filter_freq_controllable(true); break;
param = EQHPF; case 1:
break; case 3:
case 1: /* second control after band parameters */ case 5:
pc = r->eq_enable_controllable(); eq_band = global_pos / 2;
param = EQEnable; pc = r->eq_freq_controllable (eq_band);
break; band_name = r->eq_band_name (eq_band);
#endif param = EQFrequency;
default: break;
/* nothing to control */ case 6:
_vpot->set_control (boost::shared_ptr<AutomationControl>()); pc = r->eq_enable_controllable();
pending_display[0] = string(); param = EQEnable;
pending_display[1] = string(); break;
/* done */ case 7:
return; pc = r->filter_freq_controllable(true);
break; param = EQHPF;
break;
} }
#endif
} else { //mixbus or master bus ( these are currently the same for MB & 32C )
switch (global_pos) {
case 0:
case 1:
case 2:
eq_band = global_pos;
pc = r->eq_gain_controllable (eq_band);
param = EQGain;
break;
}
} }
#endif
//If a controllable was found, connect it up, and put the labels in the display.
if (pc) { if (pc) {
pc->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_eq_change, this, param, eq_band, false), ui_context()); pc->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_eq_change, this, param, eq_band, false), ui_context());
_vpot->set_control (pc); _vpot->set_control (pc);
@ -1771,13 +1756,11 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
pot_id = band_name + " Shp"; pot_id = band_name + " Shp";
break; break;
case EQEnable: case EQEnable:
pot_id = "on/off"; pot_id = "EQ";
break; break;
#ifndef MIXBUS32C
case EQHPF: case EQHPF:
pot_id = "HPFreq"; pot_id = "HP Freq";
break; break;
#endif
default: default:
break; break;
} }
@ -1787,9 +1770,14 @@ Strip::setup_eq_vpot (boost::shared_ptr<Stripable> r)
} else { } else {
pending_display[0] = string(); pending_display[0] = string();
} }
notify_eq_change (param, eq_band, true); } else { //no controllable was found; just clear this knob
_vpot->set_control (boost::shared_ptr<AutomationControl>());
pending_display[0] = string();
pending_display[1] = string();
} }
notify_eq_change (param, eq_band, true);
} }
void void