Skip to content

Commit

Permalink
Add better debug output for compilation generation (fixes #43).
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaldispuehl committed Nov 16, 2017
1 parent b245868 commit f828f6f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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);

Expand All @@ -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);
}
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,6 +31,9 @@ public class PlaylistItemFragment {
}
}


//---- Methods

public boolean isSilentBreak() {
return audioFile == null;
}
Expand Down Expand Up @@ -55,7 +68,7 @@ long getExtractEndInMilliseconds() {

@Override
public String toString() {
String fileName = "Break";
String fileName = SILENT_BREAK_TRACK_NAME;
if (!isSilentBreak()) {
fileName = getAudioFile().getDisplayName();
}
Expand Down

0 comments on commit f828f6f

Please sign in to comment.