Skip to content

Feature/fix scene reset#102

Merged
malisimat merged 5 commits into
masterfrom
feature/fix-scene-reset
May 31, 2026
Merged

Feature/fix scene reset#102
malisimat merged 5 commits into
masterfrom
feature/fix-scene-reset

Conversation

@malisimat

Copy link
Copy Markdown
Owner

Make scene resetting (after last loop is ditched) reliable. Ref issue #97

Copilot AI review requested due to automatic review settings May 31, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes unreliable scene reset (issue #97) so that ditching the last loop consistently resets quantisation regardless of trigger source. Previously only the keyboard OnAction path checked for ditch-to-zero; the MIDI and serial dispatch paths neither cleared _isSceneReset on ACTIVATE nor invoked the reset check on DITCH, leaving the scene's master length/grain stuck.

Changes:

  • Extract the post-action "reset scene if no takes remain" logic into a new _ResetIfEmpty() helper.
  • Apply the activate/ditch bookkeeping (clear _isSceneReset, set MIDI quantisation grain on activate, trigger _ResetIfEmpty() on ditch) in _DispatchMidiTriggerEvent and _PumpSerial.
  • Add gtest coverage for key/MIDI/serial ditch-to-empty paths and a debounced-ditch-via-OnTick case; expose IsSceneResetForTest() on TestScene.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
JammaLib/src/engine/Scene.h Declares the new _ResetIfEmpty() helper.
JammaLib/src/engine/Scene.cpp Replaces inline check in OnAction with the helper and mirrors the activate/ditch handling in MIDI and serial dispatch.
test/JammaLib_Tests/src/engine/Trigger_Tests.cpp Adds SceneReset tests for key, MIDI and serial trigger paths, plus a debounced-ditch case; adds IsSceneResetForTest() accessor.
.gitignore Re-groups .copilot/* ignore with an allowlist for .copilot/plan.md.

@malisimat malisimat merged commit 373e0b7 into master May 31, 2026
1 check passed
@malisimat malisimat deleted the feature/fix-scene-reset branch May 31, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants