1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:38:10 +00:00

Piano+LibDSP: Move Track to LibDSP

This is a tangly commit and it fixes all the bugs that a plain move
would have caused (i.e. we need to touch other logic which had wrong
assumptions).
This commit is contained in:
kleines Filmröllchen 2022-07-13 12:44:19 +02:00 committed by Linus Groh
parent 125122a9ab
commit 4941cffdd0
29 changed files with 322 additions and 413 deletions

View file

@ -16,7 +16,7 @@ void Keyboard::set_keyboard_note(u8 pitch, Keyboard::Switch note_switch)
VERIFY(pitch < note_frequencies.size());
if (note_switch == Switch::Off) {
m_pressed_notes.remove(pitch);
m_pressed_notes[pitch] = {};
return;
}
@ -27,7 +27,7 @@ void Keyboard::set_keyboard_note(u8 pitch, Keyboard::Switch note_switch)
.velocity = NumericLimits<i8>::max(),
};
m_pressed_notes.set(pitch, fake_note);
m_pressed_notes[pitch] = fake_note;
}
void Keyboard::set_keyboard_note_in_active_octave(i8 octave_offset, Switch note_switch)
{
@ -57,7 +57,7 @@ ErrorOr<void> Keyboard::set_virtual_keyboard_octave(u8 octave)
bool Keyboard::is_pressed(u8 pitch) const
{
return m_pressed_notes.get(pitch).has_value() && m_pressed_notes.get(pitch)->is_playing(m_transport->time());
return m_pressed_notes[pitch].has_value() && m_pressed_notes[pitch]->is_playing(m_transport->time());
}
bool Keyboard::is_pressed_in_active_octave(i8 octave_offset) const