mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-04-04 19:55:32 +00:00
Rather than checking key codes and mouse positions, we should have a more general way to play notes. You can call note() either with a KeyCode or a PianoKey directly. Additionally, m_note_on[] is now an array of integers instead of bools. This allows multiple sources to play a note. This is kind of like a "reference counted note": two sources can increment the note and it will only turn off once they have both decremented it back to 0. We are now only using keys[] to prevent multiple consecutive calls to keydown_event() (when a key is held), since that would result in playing a note many times.