diff --git a/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt b/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt index c8af81c..282fe04 100644 --- a/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt +++ b/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt @@ -1,6 +1,11 @@ retorte laboratories (retorte.ch) IntervalMusicCompositor change log -------------------------------------------------------------------------------- +2019-xx-xx 2.9.2 [not yet released] +-------------------------------------------------------------------------------- +FIX #56 Continuous enumeration crashes on playlist repeating. + + 2018-11-15 2.9.1 -------------------------------------------------------------------------------- FIX #50 Stale output directory yields error. diff --git a/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/Playlist.java b/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/Playlist.java index 333d050..30da354 100644 --- a/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/Playlist.java +++ b/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/Playlist.java @@ -139,6 +139,7 @@ private List createMusicPlaylist(List musicFil if (newMusicTrack != null) { musicPlaylist.add(newMusicTrack); musicPatternCounter++; + skippedTracks = 0; } else { skippedTracks++; @@ -187,6 +188,7 @@ private List createBreakPlaylist(List breakFil PlaylistItemFragment newBreakTrack = createPlaylistItemFrom(currentBreakFile, volume, currentBreakPatternMs); if (newBreakTrack != null) { breakPlaylist.add(new BreakPlaylistItemFragment(newBreakTrack)); + skippedTracks = 0; } else { skippedTracks++; diff --git a/intervalmusiccompositor.core/src/test/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistTest.java b/intervalmusiccompositor.core/src/test/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistTest.java index f303e3a..93f9132 100644 --- a/intervalmusiccompositor.core/src/test/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistTest.java +++ b/intervalmusiccompositor.core/src/test/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistTest.java @@ -50,6 +50,7 @@ public class PlaylistTest { private IAudioFile musicTrack40s = createAudioFileMockWithLength(sec(40), MUSIC); private IAudioFile musicTrack60s = createAudioFileMockWithLength(sec(60), MUSIC); private IAudioFile breakTrack = createAudioFileMockWithLength(sec(60), BREAK); + private IAudioFile breakTrack20s = createAudioFileMockWithLength(sec(20), BREAK); private SoundEffect soundEffect1 = mock(SoundEffect.class); @@ -388,6 +389,22 @@ public void shouldNotThrowExceptionInContinuousShuffleMode() { assertThat(tracks.get(2).getMusicFragment().getAudioFile(), is(musicTrack20s)); } + @Test + public void shouldLoopMusicWithContinuousExtract() { + // given + Playlist playlist = new Playlist(SEPARATE, 0d, CONTINUOUS, SORT, msgPrd); + musicList.add(musicTrack20s); + breakList.add(breakTrack20s); + + musicPattern = pattern(10); + breakPattern = pattern(10); + + // when + List tracks = playlist.generatePlaylistFrom(musicList, musicPattern, breakList, breakPattern, 1, 4, soundEffectOccurrences); + + // then + assertThat(tracks.size(), is(4)); + } //---- Helper methods