13
0

WS: Use Ardour native scale for pan knobs

This commit is contained in:
Luciano Iam 2020-07-19 16:31:31 +02:00 committed by Robin Gareus
parent 1109fc7983
commit e7e4fb3a81
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 5 additions and 9 deletions

View File

@ -90,8 +90,7 @@ ArdourMixer::strip_pan (uint32_t strip_n) const
/* TODO: inform GUI that strip has no panner */
return 0;
}
/* scale from [0.0 ; 1.0] to [-1.0 ; 1.0] */
return 2.0 * ac->get_value () - 1.0; //TODO: prefer ac->internal_to_interface (c->get_value ());
return ac->internal_to_interface (ac->get_value ());
}
void
@ -101,9 +100,7 @@ ArdourMixer::set_strip_pan (uint32_t strip_n, double value)
if (!ac) {
return;
}
/* TODO: prefer ac->set_value (ac->interface_to_internal (value), NoGroup); */
value = (value + 1.0) / 2.0;
ac->set_value (value, PBD::Controllable::NoGroup);
ac->set_value (ac->interface_to_internal (value), PBD::Controllable::NoGroup);
}
bool

View File

@ -170,14 +170,13 @@ export class DiscreteKnob extends Knob {
}
// TODO: consider switching to [0-1.0] pan scale in Ardour surface code
export class PanKnob extends Knob {
constructor () {
super({
scale: 'linear',
min: -1.0,
//scale: 'linear',
scale: (k) => 1.0 - k,
min: 0,
max: 1.0
});
}