diff --git a/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt b/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt index 899235e..375d18d 100644 --- a/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt +++ b/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt @@ -6,6 +6,7 @@ retorte laboratories (retorte.ch) IntervalMusicCompositor change log FIX #41 System diagnosis string shows wrong hdd space. FIX #40 Sound effect start time not properly retrieved. FIX #42 NPE when leaving a field (e.g. sound period duration) empty. +IMP #43 Add better debug output for compilation generation. 2017-11-11 2.8.1 diff --git a/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/compilation/Compilation.java b/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/compilation/Compilation.java index aca4ad3..04798c2 100644 --- a/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/compilation/Compilation.java +++ b/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/compilation/Compilation.java @@ -114,6 +114,8 @@ private byte[] getPlaylistItemDataFrom(Playlist playlist, PlaylistItem playlistI } int musicSamples = soundHelper.getSamplesFromSeconds(musicExtractDurationS); + addDebugMessage("Processing next playlist item starting at " + timeSoFarMs + " ms"); + // Any fade out from the previous track if (playlist.isCrossFadingMode()) { @@ -123,6 +125,7 @@ private byte[] getPlaylistItemDataFrom(Playlist playlist, PlaylistItem playlistI // The music part + addDebugMessage("Adding music track '" + musicFragment + "' at " + timeSoFarMs + " ms"); byte[] musicData = getMusicBytesFrom(playlist, musicFragment); arrayMerge16bit(musicData, 0, playlistItemData, 0, musicData.length); @@ -142,6 +145,7 @@ private byte[] getPlaylistItemDataFrom(Playlist playlist, PlaylistItem playlistI arrayMerge16bit(fadeOutBytes, 0, playlistItemData, musicSamples, fadeOutBytes.length); } + addDebugMessage("Adding break track '" + breakFragment + "' at " + (timeSoFarMs + (int)(musicExtractDurationS * 1000)) + " ms"); byte[] breakData = getMusicBytesFrom(playlist, breakFragment); arrayMerge16bit(breakData, 0, playlistItemData, musicSamples, breakData.length); } @@ -154,7 +158,7 @@ private byte[] getPlaylistItemDataFrom(Playlist playlist, PlaylistItem playlistI } for (SoundEffectOccurrence effect : playlistItem.getSoundEffects()) { - addDebugMessage("Adding sound effect " + effect.getSoundEffect().getId() + " at " + (timeSoFarMs + effect.getTimeMillis())); + addDebugMessage("Adding sound effect " + effect.getSoundEffect().getId() + " at " + (timeSoFarMs + effect.getTimeMillis()) + " ms"); addSoundEffectTo(playlistItemData, effect); } diff --git a/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistItemFragment.java b/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistItemFragment.java index b7806db..be51110 100644 --- a/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistItemFragment.java +++ b/intervalmusiccompositor.core/src/main/java/ch/retorte/intervalmusiccompositor/playlist/PlaylistItemFragment.java @@ -7,10 +7,20 @@ */ public class PlaylistItemFragment { + //---- Static + + private static final String SILENT_BREAK_TRACK_NAME = "Silent Break"; + + + //---- Fields + private final IAudioFile audioFile; private final long extractStartInMilliseconds; private final long extractEndInMilliseconds; + + //---- Constructor + PlaylistItemFragment(IAudioFile audioFile, long extractStartInMilliseconds, long extractEndInMilliseconds) { this.audioFile = audioFile; this.extractStartInMilliseconds = extractStartInMilliseconds; @@ -21,6 +31,9 @@ public class PlaylistItemFragment { } } + + //---- Methods + public boolean isSilentBreak() { return audioFile == null; } @@ -55,7 +68,7 @@ long getExtractEndInMilliseconds() { @Override public String toString() { - String fileName = "Break"; + String fileName = SILENT_BREAK_TRACK_NAME; if (!isSilentBreak()) { fileName = getAudioFile().getDisplayName(); }