mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 20:56:28 +01:00
push2: make octave buttons actually work, with shift-press to reset to zero
This commit is contained in:
parent
6b080bf6ec
commit
c4602603b4
2 changed files with 11 additions and 3 deletions
|
|
@ -503,20 +503,28 @@ Push2::start_press_timeout (Button& button, ButtonID id)
|
||||||
void
|
void
|
||||||
Push2::button_octave_down ()
|
Push2::button_octave_down ()
|
||||||
{
|
{
|
||||||
|
if (_modifier_state & ModShift) {
|
||||||
|
octave_shift = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int os = (max (-4, octave_shift - 1));
|
int os = (max (-4, octave_shift - 1));
|
||||||
if (os != octave_shift) {
|
if (os != octave_shift) {
|
||||||
octave_shift = os;
|
octave_shift = os;
|
||||||
build_pad_table ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Push2::button_octave_up ()
|
Push2::button_octave_up ()
|
||||||
{
|
{
|
||||||
|
if (_modifier_state & ModShift) {
|
||||||
|
octave_shift = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int os = (min (4, octave_shift + 1));
|
int os = (min (4, octave_shift + 1));
|
||||||
if (os != octave_shift) {
|
if (os != octave_shift) {
|
||||||
octave_shift = os;
|
octave_shift = os;
|
||||||
build_pad_table ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1256,7 +1256,7 @@ Push2::pad_filter (MidiBuffer& in, MidiBuffer& out) const
|
||||||
Pad const * pad = nni->second;
|
Pad const * pad = nni->second;
|
||||||
/* shift for output to the shadow port */
|
/* shift for output to the shadow port */
|
||||||
if (pad->filtered >= 0) {
|
if (pad->filtered >= 0) {
|
||||||
(*ev).set_note (pad->filtered);
|
(*ev).set_note (pad->filtered + (octave_shift*12));
|
||||||
out.push_back (*ev);
|
out.push_back (*ev);
|
||||||
/* shift back so that the pads light correctly */
|
/* shift back so that the pads light correctly */
|
||||||
(*ev).set_note (n);
|
(*ev).set_note (n);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue