diff --git a/src/kits/midi/SoftSynth.cpp b/src/kits/midi/SoftSynth.cpp index 7ff6e9b28a..2c45368837 100644 --- a/src/kits/midi/SoftSynth.cpp +++ b/src/kits/midi/SoftSynth.cpp @@ -254,7 +254,8 @@ BSoftSynth::SetReverb(reverb_mode mode) if (fSynth) { // We access the table using "mode - 1" because B_REVERB_NONE == 1 ReverbSettings *rvb = &gReverbSettings[mode - 1]; - fluid_synth_set_reverb(fSynth, rvb->room, rvb->damp, rvb->width, rvb->level); + fluid_synth_set_reverb(fSynth, rvb->room, rvb->damp, rvb->width, + rvb->level); } } @@ -521,15 +522,18 @@ BSoftSynth::_Done() void -BSoftSynth::PlayBuffer(void * cookie, void * data, size_t size, const media_raw_audio_format & format) +BSoftSynth::PlayBuffer(void* cookie, void* data, size_t size, + const media_raw_audio_format& format) { - BSoftSynth *synth = (BSoftSynth *)cookie; + BSoftSynth* synth = (BSoftSynth*)cookie; // we use float samples - if (synth->fSynth) - fluid_synth_write_float(synth->fSynth, size / sizeof(float) / format.channel_count, + if (synth->fSynth) { + fluid_synth_write_float( + synth->fSynth, size / sizeof(float) / format.channel_count, data, 0, format.channel_count, data, 1, format.channel_count); + } } diff --git a/src/kits/midi/SoftSynth.h b/src/kits/midi/SoftSynth.h index 1e162d34c1..58b1f0b5ed 100644 --- a/src/kits/midi/SoftSynth.h +++ b/src/kits/midi/SoftSynth.h @@ -29,10 +29,8 @@ class BSynth; namespace BPrivate { -class BSoftSynth -{ +class BSoftSynth { public: - bool InitCheck(); void Unload(); @@ -93,7 +91,8 @@ private: void _Init(); void _Done(); - static void PlayBuffer(void * cookie, void * data, size_t size, const media_raw_audio_format & format); + static void PlayBuffer(void* cookie, void* data, size_t size, + const media_raw_audio_format& format); bool fInitCheck; char* fInstrumentsFile; @@ -104,10 +103,10 @@ private: reverb_mode fReverbMode; bool fReverbEnabled; - fluid_synth_t *fSynth; + fluid_synth_t* fSynth; fluid_settings_t* fSettings; - BSoundPlayer *fSoundPlayer; + BSoundPlayer* fSoundPlayer; }; } // namespace BPrivate