static void next_effect() { if (active_effect+1 == master_playlist_len || active_effect+1 == pgm_get(playlists[active_playlist+1],byte)) { // End reached. Go to the first item of the playlist. select_playlist_item(pgm_get(playlists[active_playlist],byte)); } else { // Advance to the next item in playlist select_playlist_item(active_effect + 1); } }
static void pick_startup_mode(void) { cube_start(0); // Quick fix to start in kiosk mode mode = MODE_PLAYLIST; select_playlist_item(playlists[0]); init_current_effect(); }
uint8_t change_playlist(uint8_t i) { if (i >= playlists_len) { return 1; } // Change mode and run init mode = MODE_PLAYLIST; select_playlist_item(playlists[i]); init_current_effect(); return 0; }
uint8_t change_playlist(uint8_t i) { if (i >= playlists_len) { return 1; } active_playlist = i; // Change mode and run init mode = MODE_PLAYLIST; select_playlist_item(pgm_get(playlists[i],byte)); init_current_effect(); return 0; }
void use_stored_playlist(void) { if (mode != MODE_PLAYLIST) return; if (!(modified.playlist || modified.mode)) return; uint8_t new_playlist = read_playlist(); // Avoid dangling pointers and extra initialization if (new_playlist >= playlists_len) new_playlist = 0; // Activate active_playlist = new_playlist; select_playlist_item(pgm_get(playlists[new_playlist],byte)); init_current_effect(); }
static void pick_startup_mode(void) { // Start normally cube_start(0); mode = simulation_mode; switch (mode) { case MODE_EFFECT: effect = effects + simulation_effect; init_current_effect(); break; case MODE_PLAYLIST: select_playlist_item(playlists[0]); init_current_effect(); break; default: mode = MODE_IDLE; } }
static void init_playlist(void) { select_playlist_item(0); }
static void next_effect() { if(active_effect + 1 == master_playlist_len) select_playlist_item(0); else select_playlist_item(active_effect + 1); }