mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
Piano: Highlight pressed key in roll widget
This commit is contained in:
parent
0c5497829e
commit
01bff0141e
Notes:
sideshowbarker
2024-07-19 01:55:52 +09:00
Author: https://github.com/petelliott
Commit: 01bff0141e
Pull-request: https://github.com/SerenityOS/serenity/pull/3746
6 changed files with 25 additions and 1 deletions
|
@ -63,6 +63,17 @@ void KeysWidget::set_key(int key, Switch switch_key)
|
|||
m_track_manager.set_note_current_octave(key, switch_key);
|
||||
}
|
||||
|
||||
bool KeysWidget::note_is_set(int note) const
|
||||
{
|
||||
if (note < m_track_manager.octave_base())
|
||||
return false;
|
||||
|
||||
if (note >= m_track_manager.octave_base() + note_count)
|
||||
return false;
|
||||
|
||||
return m_key_on[note - m_track_manager.octave_base()] != 0;
|
||||
}
|
||||
|
||||
int KeysWidget::key_code_to_key(int key_code) const
|
||||
{
|
||||
switch (key_code) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue