summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorWilliam McPherson <willmcpherson2@gmail.com>2021-03-03 00:03:48 +1100
committerAndreas Kling <kling@serenityos.org>2021-03-02 14:44:42 +0100
commitc7777ff2890f77c7b492b752c062b342abb22f68 (patch)
treeb415593807d0e732abe8d19bf8d1763cb803605c /Userland
parentdce030eefca7316ba47cc7a6151f1563a5626245 (diff)
downloadserenity-c7777ff2890f77c7b492b752c062b342abb22f68.zip
Piano: Reset position in piano roll when exporting
When you reset() a Track, you need to set the piano roll iterators back to the first notes. Fixes #2578. The bug was due to pressing export between 2 notes - the tracks were never told to go back to the first note.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/Piano/Track.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/Piano/Track.cpp b/Userland/Applications/Piano/Track.cpp
index b560889339..d4abcb4ed2 100644
--- a/Userland/Applications/Piano/Track.cpp
+++ b/Userland/Applications/Piano/Track.cpp
@@ -134,6 +134,9 @@ void Track::reset()
memset(m_note_on, 0, sizeof(m_note_on));
memset(m_power, 0, sizeof(m_power));
memset(m_envelope, 0, sizeof(m_envelope));
+
+ for (size_t note = 0; note < note_count; ++note)
+ m_roll_iters[note] = m_roll_notes[note].begin();
}
String Track::set_recorded_sample(const StringView& path)