commit 3a734ed06d829dae5e48c0290a6d7269a117dba2 parent 4dfccacdd7d6538d2073a020a1b7f7d1fb4bf774 Author: Olav Sørensen <olav.sorensen@live.no> Date: Tue, 17 Dec 2019 21:03:00 +0100 Quick fix for very recent v1.04 release Diffstat:
M | src/ft2_pattern_ed.c | | | 82 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- |
1 file changed, 65 insertions(+), 17 deletions(-)
diff --git a/src/ft2_pattern_ed.c b/src/ft2_pattern_ed.c @@ -1904,29 +1904,55 @@ static void updatePtnLen(void) uint16_t len = pattLens[editor.editPattern]; song.pattLen = len; - editor.pattPos = song.pattPos = CLAMP(song.pattPos, 0, len - 1); + if (song.pattPos >= len) + { + song.pattPos = len - 1; + editor.pattPos = song.pattPos; + } checkMarkLimits(); } void pbEditPattUp(void) { - if (editor.editPattern == 255) - return; + if (songPlaying) + { + if (song.pattNr == 255) + return; + } + else + { + if (editor.editPattern == 255) + return; + } bool audioWasntLocked = !audio.locked; if (audioWasntLocked) lockAudio(); - if (editor.editPattern < 255) + if (songPlaying) + { + if (song.pattNr < 255) + { + song.pattNr++; + updatePtnLen(); + + editor.ui.updatePatternEditor = true; + editor.ui.updatePosSections = true; + } + } + else { - editor.editPattern++; + if (editor.editPattern < 255) + { + editor.editPattern++; - song.pattNr = editor.editPattern; - updatePtnLen(); + song.pattNr = editor.editPattern; + updatePtnLen(); - editor.ui.updatePatternEditor = true; - editor.ui.updatePosSections = true; + editor.ui.updatePatternEditor = true; + editor.ui.updatePosSections = true; + } } if (audioWasntLocked) @@ -1935,22 +1961,44 @@ void pbEditPattUp(void) void pbEditPattDown(void) { - if (editor.editPattern == 0) - return; + if (songPlaying) + { + if (song.pattNr == 0) + return; + } + else + { + if (editor.editPattern == 0) + return; + } bool audioWasntLocked = !audio.locked; if (audioWasntLocked) lockAudio(); - if (editor.editPattern > 0) + if (songPlaying) { - editor.editPattern--; + if (song.pattNr > 0) + { + song.pattNr--; + updatePtnLen(); - song.pattNr = editor.editPattern; - updatePtnLen(); + editor.ui.updatePatternEditor = true; + editor.ui.updatePosSections = true; + } + } + else + { + if (editor.editPattern > 0) + { + editor.editPattern--; - editor.ui.updatePatternEditor = true; - editor.ui.updatePosSections = true; + song.pattNr = editor.editPattern; + updatePtnLen(); + + editor.ui.updatePatternEditor = true; + editor.ui.updatePosSections = true; + } } if (audioWasntLocked)