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 */ /* TODO: inform GUI that strip has no panner */
return 0; return 0;
} }
/* scale from [0.0 ; 1.0] to [-1.0 ; 1.0] */ return ac->internal_to_interface (ac->get_value ());
return 2.0 * ac->get_value () - 1.0; //TODO: prefer ac->internal_to_interface (c->get_value ());
} }
void void
@ -101,9 +100,7 @@ ArdourMixer::set_strip_pan (uint32_t strip_n, double value)
if (!ac) { if (!ac) {
return; return;
} }
/* TODO: prefer ac->set_value (ac->interface_to_internal (value), NoGroup); */ ac->set_value (ac->interface_to_internal (value), PBD::Controllable::NoGroup);
value = (value + 1.0) / 2.0;
ac->set_value (value, PBD::Controllable::NoGroup);
} }
bool 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 { export class PanKnob extends Knob {
constructor () { constructor () {
super({ super({
scale: 'linear', //scale: 'linear',
min: -1.0, scale: (k) => 1.0 - k,
min: 0,
max: 1.0 max: 1.0
}); });
} }