GUI: prepare for API changes
remove use of - unbound_min/max - list->default_value and min/max_y
This commit is contained in:
parent
fe83e1e2ed
commit
555fcb89e5
@ -1225,7 +1225,7 @@ AutomationLine::view_to_model_coord_y (double& y) const
|
||||
y = max ((double) _desc.lower, y);
|
||||
y = min ((double) _desc.upper, y);
|
||||
} else {
|
||||
y = y * (double)(alist->get_max_y() - alist->get_min_y()) + alist->get_min_y();
|
||||
y = y * (double)(_desc.upper - _desc.lower) + _desc.lower;
|
||||
if (_desc.integer_step) {
|
||||
y = round(y);
|
||||
} else if (_desc.toggled) {
|
||||
@ -1255,7 +1255,7 @@ AutomationLine::model_to_view_coord_y (double& y) const
|
||||
} else if (alist->parameter().type() == PanWidthAutomation) {
|
||||
y = .5 + y * .5;
|
||||
} else {
|
||||
y = (y - alist->get_min_y()) / (double)(alist->get_max_y() - alist->get_min_y());
|
||||
y = (y - _desc.lower) / (double)(_desc.upper - _desc.lower);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4949,7 +4949,7 @@ Editor::reset_point_selection ()
|
||||
{
|
||||
for (PointSelection::iterator i = selection->points.begin(); i != selection->points.end(); ++i) {
|
||||
ARDOUR::AutomationList::iterator j = (*i)->model ();
|
||||
(*j)->value = (*i)->line().the_list()->default_value ();
|
||||
(*j)->value = (*i)->line().the_list()->descriptor ().normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -902,12 +902,6 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
|
||||
UIConfiguration::instance().color ("meter background top")
|
||||
);
|
||||
|
||||
info->min_unbound = desc.min_unbound;
|
||||
info->max_unbound = desc.max_unbound;
|
||||
|
||||
info->min = desc.lower;
|
||||
info->max = desc.upper;
|
||||
|
||||
control_ui->label.set_angle(90);
|
||||
|
||||
HBox* center = manage (new HBox);
|
||||
@ -1094,27 +1088,12 @@ GenericPluginUI::output_update ()
|
||||
buf[len] = '\0';
|
||||
(*i)->display_label->set_text (buf);
|
||||
|
||||
/* autoscaling for the meter */
|
||||
if ((*i)->meterinfo && (*i)->meterinfo->packed) {
|
||||
|
||||
if (val < (*i)->meterinfo->min) {
|
||||
if ((*i)->meterinfo->min_unbound)
|
||||
(*i)->meterinfo->min = val;
|
||||
else
|
||||
val = (*i)->meterinfo->min;
|
||||
}
|
||||
|
||||
if (val > (*i)->meterinfo->max) {
|
||||
if ((*i)->meterinfo->max_unbound)
|
||||
(*i)->meterinfo->max = val;
|
||||
else
|
||||
val = (*i)->meterinfo->max;
|
||||
}
|
||||
|
||||
if ((*i)->meterinfo->max > (*i)->meterinfo->min ) {
|
||||
float lval = (val - (*i)->meterinfo->min) / ((*i)->meterinfo->max - (*i)->meterinfo->min) ;
|
||||
(*i)->meterinfo->meter->set (lval );
|
||||
}
|
||||
const float upper = c->desc().upper;
|
||||
const float lower = c->desc().lower;
|
||||
val = std::min (upper, std::max (lower, val));
|
||||
float lval = (val - lower / (upper - lower));
|
||||
(*i)->meterinfo->meter->set (lval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,20 +206,11 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
|
||||
|
||||
struct MeterInfo {
|
||||
Gtkmm2ext::FastMeter *meter;
|
||||
|
||||
float min;
|
||||
float max;
|
||||
bool min_unbound;
|
||||
bool max_unbound;
|
||||
bool packed;
|
||||
|
||||
MeterInfo () {
|
||||
meter = 0;
|
||||
packed = false;
|
||||
min = 1.0e10;
|
||||
max = -1.0e10;
|
||||
min_unbound = false;
|
||||
max_unbound = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user