aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alMidi.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alMidi.c')
-rw-r--r--OpenAL32/alMidi.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c
index 2f87faad..cf634617 100644
--- a/OpenAL32/alMidi.c
+++ b/OpenAL32/alMidi.c
@@ -345,13 +345,8 @@ static void FSynth_stop(FSynth *self)
static void FSynth_reset(FSynth *self)
{
- ALsizei chan;
- /* All sounds off + reset all controllers */
- for(chan = 0;chan < 16;chan++)
- {
- fluid_synth_cc(self->Synth, chan, 120, 0);
- fluid_synth_cc(self->Synth, chan, 121, 0);
- }
+ /* Reset to power-up status. */
+ fluid_synth_system_reset(self->Synth);
MidiSynth_reset(STATIC_CAST(MidiSynth, self));
}
@@ -795,6 +790,29 @@ AL_API void AL_APIENTRY alMidiStopSOFT(void)
ALCcontext_DecRef(context);
}
+AL_API void AL_APIENTRY alMidiResetSOFT(void)
+{
+ ALCdevice *device;
+ ALCcontext *context;
+ MidiSynth *synth;
+
+ context = GetContextRef();
+ if(!context) return;
+
+ device = context->Device;
+ synth = device->Synth;
+
+ WriteLock(&synth->Lock);
+ V(synth,setState)(AL_INITIAL);
+
+ ALCdevice_Lock(device);
+ V0(synth,reset)();
+ ALCdevice_Unlock(device);
+ WriteUnlock(&synth->Lock);
+
+ ALCcontext_DecRef(context);
+}
+
AL_API void AL_APIENTRY alMidiGainSOFT(ALfloat value)
{