From 7fa70010daf92f90bf47933e846c0ded239a98f7 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Mon, 14 Feb 2011 18:38:39 +0000 Subject: WillyFoobar patch --- muse2/synti/simpledrums2/simpledrums.cpp | 33 +++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'muse2/synti') diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp index 54db77ef..ecd03d35 100644 --- a/muse2/synti/simpledrums2/simpledrums.cpp +++ b/muse2/synti/simpledrums2/simpledrums.cpp @@ -1041,10 +1041,19 @@ void SimpleSynth::parseInitData(const unsigned char* data) if (SS_DEBUG_INIT) { printf("Channel %d:\n", ch); + //willyfoobar-2011-02-13 + // ptr-data might be long long on 64 bit machine --> cast to "long" + // *(ptr+...) has type byte --> use %hhd as format item + /* old code printf("buffer[%ld] - channels[ch].volume_ctrlval = \t%d\n", ptr-data, *ptr); printf("buffer[%ld] - channels[ch].pan = \t\t%d\n", ptr-data+1, *(ptr+1)); printf("buffer[%ld] - channels[ch].noteoff_ignore = \t%d\n", ptr-data+2, *(ptr+2)); printf("buffer[%ld] - channels[ch].channel_on = \t%d\n", ptr-data+3, *(ptr+3)); + */ + printf("buffer[%ld] - channels[ch].volume_ctrlval = \t%hhd\n", long(ptr-data), *ptr); + printf("buffer[%ld] - channels[ch].pan = \t\t%hhd\n", long(ptr-data+1), *(ptr+1)); + printf("buffer[%ld] - channels[ch].noteoff_ignore = \t%hhd\n", long(ptr-data+2), *(ptr+2)); + printf("buffer[%ld] - channels[ch].channel_on = \t%hhd\n", long(ptr-data+3), *(ptr+3)); } updateVolume(ch, *(ptr)); guiUpdateVolume(ch, *(ptr)); @@ -1117,8 +1126,13 @@ void SimpleSynth::parseInitData(const unsigned char* data) ptr++; for (int i=0; iwriteEvent(ev); for (int j=0; jconvertGuiControlValue(j, *(ptr))); ptr++; } @@ -1271,7 +1290,11 @@ static void* loadSampleThread(void* p) smp->samples = smp->frames * smp->channels; if (SS_DEBUG) { - printf("Resampling from %ld frames to %ld frames - srcration: %lf\n", sfi.frames, smp->frames, srcratio); + //wilyfoobar-2011-02-13 + // arg2 :sfi.frames is of type sf_count_t (== 64 bit) (long long) + // this requires format %lld (twice 'l' in format string (arg1) + // old code//printf("Resampling from %ld frames to %ld frames - srcration: %lf\n", sfi.frames, smp->frames, srcratio); + printf("Resampling from %lld frames to %ld frames - srcration: %lf\n", sfi.frames, smp->frames, srcratio); printf("Nr of new samples: %ld\n", smp->samples); } -- cgit v1.2.3