provide sensible default step and page sizes for AutomationControllers based on parameter max and min values (used to 1.0 for step and 0 for page)

git-svn-id: svn://localhost/ardour2/branches/3.0@10902 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-12-05 18:14:20 +00:00
parent 5547744d85
commit 0e92aee0b1

View file

@ -76,7 +76,10 @@ AutomationController::create(
const Evoral::Parameter& param, const Evoral::Parameter& param,
boost::shared_ptr<AutomationControl> ac) boost::shared_ptr<AutomationControl> ac)
{ {
Gtk::Adjustment* adjustment = manage (new Gtk::Adjustment (param.normal(), param.min(), param.max())); Gtk::Adjustment* adjustment = manage (new Gtk::Adjustment (param.normal(), param.min(), param.max(),
(param.max() - param.min())/100.0,
(param.max() - param.min())/10.0));
assert (ac); assert (ac);
assert(ac->parameter() == param); assert(ac->parameter() == param);
return boost::shared_ptr<AutomationController>(new AutomationController(printer, ac, adjustment)); return boost::shared_ptr<AutomationController>(new AutomationController(printer, ac, adjustment));