13
0

GenericUI: replace if() by assert()

It makes no sense to check for the validity of mcontrol only for
controller creation, since the remainder of the code assumes that the
controller will have been created correctly.

Replace that by an assert.
This commit is contained in:
Julien "_FrnchFrgg_" RIVAUD 2016-07-28 23:50:33 +02:00
parent 3365722b8b
commit a7b29d7966

View File

@ -696,6 +696,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
return control_ui;
}
assert(mcontrol);
/* See if there any named values for our input value */
control_ui->scale_points = desc.scale_points;
@ -744,9 +745,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
* destructor, and manage() reports object hierarchy
* ambiguity.
*/
if (mcontrol) {
control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), desc, mcontrol, use_knob);
}
control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), desc, mcontrol, use_knob);
/* XXX this code is not right yet, because it doesn't handle
the absence of bounds in any sensible fashion.