Skip to content

Commit

Permalink
issue #6 (westlicht#373) Song Mode sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mebitek committed Jan 3, 2024
1 parent e305085 commit 72d0b76
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/apps/sequencer/engine/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ void Engine::togglePlay(bool shift) {

void Engine::clockStart() {
_clock.masterStart();

int slotCount = _project.song().slotCount();

if (slotCount>0 && !_project.playState().songState().playing()) {
int _selectedSlot = slotCount > 0 ? clamp(1, 0, slotCount - 1) : -1;
_project.playState().playSong(_selectedSlot, PlayState::ExecuteType::Immediate);
}

}

void Engine::clockStop() {
Expand All @@ -251,6 +259,10 @@ void Engine::clockContinue() {

void Engine::clockReset() {
_clock.masterReset();

if (_project.playState().songState().playing()) {
_project.playState().stopSong();
}
}

bool Engine::clockRunning() const {
Expand Down

0 comments on commit 72d0b76

Please sign in to comment.