Skip to content

Commit 2d086df

Browse files
authored
Merge pull request #126 from OpenSourceLightshows/kurt/aeos/autoplay-or-complete-color-set-cycle
kurt/aeos/autoplay-or-complete-color-set-cycle
2 parents 804ed69 + 2afcfec commit 2d086df

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Helios/Helios.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,17 @@ void Helios::handle_state_modes()
288288
return;
289289
}
290290

291-
// Check for autoplay mode switching
292-
if (has_flag(FLAG_AUTOPLAY) && hasReleased && !Button::isPressed()) {
291+
// This handles iterating the mode forward when the autoplay feature is
292+
// enabled. The modes automatically cycle forward every AUTOPLAY_DURATION ticks
293+
// but only if the button isn't pressed to avoid iterating while opening menus
294+
if (has_flag(FLAG_AUTOPLAY) && !Button::isPressed()) {
293295
uint32_t current_time = Time::getCurtime();
294296
if (current_time - last_mode_switch_time >= AUTOPLAY_DURATION) {
295-
load_next_mode();
297+
// If a pattern has a single cycle that is longer than the autoplay duration,
298+
// prevent the mode switch from interrupting the pattern so the full cycle can be seen.
299+
if (pat.colorset().numColors() <= 1 || pat.colorset().onStart()) {
300+
load_next_mode();
301+
}
296302
}
297303
}
298304

0 commit comments

Comments
 (0)