mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:27:46 +00:00
Piano: Fix insertion and deletion of notes
On mouse move the pressed button is not present in the event argument which causes the corresponding code to never fire. Instead it now stores the original mouse down event and acts according to that on mouse move.
This commit is contained in:
parent
4ab7216827
commit
815442b2b5
6 changed files with 71 additions and 46 deletions
|
@ -146,6 +146,16 @@ void AudioTrack::compute_current_clips_signal()
|
|||
TODO();
|
||||
}
|
||||
|
||||
Optional<RollNote> NoteTrack::note_at(u32 time, u8 pitch) const
|
||||
{
|
||||
for (auto& clip : m_clips) {
|
||||
if (time >= clip.start() && time <= clip.end())
|
||||
return clip.note_at(time, pitch);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void NoteTrack::set_note(RollNote note)
|
||||
{
|
||||
for (auto& clip : m_clips) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue