diff options
author | Chris Robinson <[email protected]> | 2015-10-20 17:41:53 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-10-20 18:01:27 -0700 |
commit | 6689c61ff474657109c5a73827b8733aba7dfd45 (patch) | |
tree | 3c9a3371b1be3085ec4a298148bd45ebf495c44f /Alc/midi/dummy.c | |
parent | d9a77a7edc309f399ce257f4b69d240008f47b49 (diff) |
Remove the MIDI code
The extension's not going anywhere, and it can't do anything fluidsynth can't.
The code maintenance and bloat is not worth keeping around, and ideally the AL
API would be able to facilitate MIDI-like behavior anyway (envelopes, start-at-
time, etc).
Diffstat (limited to 'Alc/midi/dummy.c')
-rw-r--r-- | Alc/midi/dummy.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/Alc/midi/dummy.c b/Alc/midi/dummy.c deleted file mode 100644 index 23c0d2cb..00000000 --- a/Alc/midi/dummy.c +++ /dev/null @@ -1,76 +0,0 @@ - -#include "config.h" - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <limits.h> - -#include "alMain.h" -#include "alError.h" -#include "evtqueue.h" -#include "rwlock.h" -#include "alu.h" - -#include "midi/base.h" - -typedef struct DSynth { - DERIVE_FROM_TYPE(MidiSynth); -} DSynth; - -static void DSynth_Construct(DSynth *self, ALCdevice *device); -static DECLARE_FORWARD(DSynth, MidiSynth, void, Destruct) -static DECLARE_FORWARD3(DSynth, MidiSynth, ALenum, selectSoundfonts, ALCcontext*, ALsizei, const ALuint*) -static DECLARE_FORWARD1(DSynth, MidiSynth, void, setGain, ALfloat) -static DECLARE_FORWARD(DSynth, MidiSynth, void, stop) -static DECLARE_FORWARD(DSynth, MidiSynth, void, reset) -static DECLARE_FORWARD1(DSynth, MidiSynth, void, update, ALCdevice*) -static void DSynth_process(DSynth *self, ALuint SamplesToDo, ALfloat (*restrict DryBuffer)[BUFFERSIZE], ALuint NumChannels); -DECLARE_DEFAULT_ALLOCATORS(DSynth) -DEFINE_MIDISYNTH_VTABLE(DSynth); - - -static void DSynth_Construct(DSynth *self, ALCdevice *device) -{ - MidiSynth_Construct(STATIC_CAST(MidiSynth, self), device); - SET_VTABLE2(DSynth, MidiSynth, self); -} - - -static void DSynth_processQueue(DSynth *self, ALuint64 time) -{ - EvtQueue *queue = &STATIC_CAST(MidiSynth, self)->EventQueue; - - while(queue->pos < queue->size && queue->events[queue->pos].time <= time) - queue->pos++; -} - -static void DSynth_process(DSynth *self, ALuint SamplesToDo, ALfloatBUFFERSIZE*restrict UNUSED(DryBuffer), ALuint UNUSED(NumChannels)) -{ - MidiSynth *synth = STATIC_CAST(MidiSynth, self); - ALuint64 curtime; - - if(synth->State != AL_PLAYING) - return; - - synth->SamplesDone += SamplesToDo; - synth->ClockBase += (synth->SamplesDone/synth->SampleRate) * MIDI_CLOCK_RES; - synth->SamplesDone %= synth->SampleRate; - - curtime = MidiSynth_getTime(synth); - DSynth_processQueue(self, maxi64(curtime-1, 0)); -} - - -MidiSynth *DSynth_create(ALCdevice *device) -{ - DSynth *synth; - - NEW_OBJ(synth, DSynth)(device); - if(!synth) - { - ERR("Failed to allocate DSynth\n"); - return NULL; - } - return STATIC_CAST(MidiSynth, synth); -} |