aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/midi
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-29 06:02:48 -0800
committerChris Robinson <[email protected]>2013-12-29 06:02:48 -0800
commit6b2d3c3cfa06485171bd813ce190c0b0ed87410c (patch)
treedd599abca17c9a38557892c61ffccc1c52b81cf5 /Alc/midi
parent396a2f1595b5296af9f23e115fa02090c0f43353 (diff)
Remove some unused MIDI backend methods
Diffstat (limited to 'Alc/midi')
-rw-r--r--Alc/midi/base.h6
-rw-r--r--Alc/midi/dummy.c38
-rw-r--r--Alc/midi/fluidsynth.c42
3 files changed, 0 insertions, 86 deletions
diff --git a/Alc/midi/base.h b/Alc/midi/base.h
index a5b76dfe..dd7788e6 100644
--- a/Alc/midi/base.h
+++ b/Alc/midi/base.h
@@ -74,8 +74,6 @@ ALenum MidiSynth_insertSysExEvent(MidiSynth *self, ALuint64 time, const ALbyte *
struct MidiSynthVtable {
void (*const Destruct)(MidiSynth *self);
- ALboolean (*const isSoundfont)(MidiSynth *self, const char *filename);
- ALenum (*const loadSoundfont)(MidiSynth *self, const char *filename);
ALenum (*const selectSoundfonts)(MidiSynth *self, ALCdevice *device, ALsizei count, const ALuint *ids);
void (*const setGain)(MidiSynth *self, ALfloat gain);
@@ -92,8 +90,6 @@ struct MidiSynthVtable {
#define DEFINE_MIDISYNTH_VTABLE(T) \
DECLARE_THUNK(T, MidiSynth, void, Destruct) \
-DECLARE_THUNK1(T, MidiSynth, ALboolean, isSoundfont, const char*) \
-DECLARE_THUNK1(T, MidiSynth, ALenum, loadSoundfont, const char*) \
DECLARE_THUNK3(T, MidiSynth, ALenum, selectSoundfonts, ALCdevice*, ALsizei, const ALuint*) \
DECLARE_THUNK1(T, MidiSynth, void, setGain, ALfloat) \
DECLARE_THUNK1(T, MidiSynth, void, setState, ALenum) \
@@ -106,8 +102,6 @@ DECLARE_THUNK(T, MidiSynth, void, Delete) \
static const struct MidiSynthVtable T##_MidiSynth_vtable = { \
T##_MidiSynth_Destruct, \
\
- T##_MidiSynth_isSoundfont, \
- T##_MidiSynth_loadSoundfont, \
T##_MidiSynth_selectSoundfonts, \
T##_MidiSynth_setGain, \
T##_MidiSynth_setState, \
diff --git a/Alc/midi/dummy.c b/Alc/midi/dummy.c
index 3b72b63f..760aed74 100644
--- a/Alc/midi/dummy.c
+++ b/Alc/midi/dummy.c
@@ -20,8 +20,6 @@ typedef struct DSynth {
static void DSynth_Construct(DSynth *self, ALCdevice *device);
static DECLARE_FORWARD(DSynth, MidiSynth, void, Destruct)
-static ALboolean DSynth_isSoundfont(DSynth *self, const char *filename);
-static ALenum DSynth_loadSoundfont(DSynth *self, const char *filename);
static DECLARE_FORWARD3(DSynth, MidiSynth, ALenum, selectSoundfonts, ALCdevice*, ALsizei, const ALuint*)
static DECLARE_FORWARD1(DSynth, MidiSynth, void, setGain, ALfloat)
static DECLARE_FORWARD1(DSynth, MidiSynth, void, setState, ALenum)
@@ -40,42 +38,6 @@ static void DSynth_Construct(DSynth *self, ALCdevice *device)
}
-static ALboolean DSynth_isSoundfont(DSynth *self, const char *filename)
-{
- char buf[12];
- FILE *f;
-
- filename = MidiSynth_getFontName(STATIC_CAST(MidiSynth, self), filename);
- if(!filename[0])
- return AL_FALSE;
-
- f = fopen(filename, "rb");
- if(!f) return AL_FALSE;
-
- if(fread(buf, 1, sizeof(buf), f) != sizeof(buf))
- {
- fclose(f);
- return AL_FALSE;
- }
-
- if(memcmp(buf, "RIFF", 4) != 0 || memcmp(buf+8, "sfbk", 4) != 0)
- {
- fclose(f);
- return AL_FALSE;
- }
-
- fclose(f);
- return AL_TRUE;
-}
-
-static ALenum DSynth_loadSoundfont(DSynth *self, const char *filename)
-{
- if(!DSynth_isSoundfont(self, filename))
- return AL_INVALID_VALUE;
- return AL_NO_ERROR;
-}
-
-
static void DSynth_processQueue(DSynth *self, ALuint64 time)
{
EvtQueue *queue = &STATIC_CAST(MidiSynth, self)->EventQueue;
diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c
index ec4a7345..25b367af 100644
--- a/Alc/midi/fluidsynth.c
+++ b/Alc/midi/fluidsynth.c
@@ -341,8 +341,6 @@ typedef struct FSynth {
static void FSynth_Construct(FSynth *self, ALCdevice *device);
static void FSynth_Destruct(FSynth *self);
static ALboolean FSynth_init(FSynth *self, ALCdevice *device);
-static ALboolean FSynth_isSoundfont(FSynth *self, const char *filename);
-static ALenum FSynth_loadSoundfont(FSynth *self, const char *filename);
static ALenum FSynth_selectSoundfonts(FSynth *self, ALCdevice *device, ALsizei count, const ALuint *ids);
static void FSynth_setGain(FSynth *self, ALfloat gain);
static void FSynth_setState(FSynth *self, ALenum state);
@@ -440,46 +438,6 @@ static fluid_sfont_t *FSynth_loadSfont(fluid_sfloader_t *loader, const char *fil
return STATIC_CAST(fluid_sfont_t, sfont);
}
-static ALboolean FSynth_isSoundfont(FSynth *self, const char *filename)
-{
- filename = MidiSynth_getFontName(STATIC_CAST(MidiSynth, self), filename);
- if(!filename[0]) return AL_FALSE;
-
- if(!fluid_is_soundfont(filename))
- return AL_FALSE;
- return AL_TRUE;
-}
-
-static ALenum FSynth_loadSoundfont(FSynth *self, const char *filename)
-{
- int *fontid;
- ALsizei count;
- ALsizei i;
-
- filename = MidiSynth_getFontName(STATIC_CAST(MidiSynth, self), filename);
- if(!filename[0]) return AL_INVALID_VALUE;
-
- fontid = malloc(sizeof(fontid[0]));
- if(!fontid) return AL_OUT_OF_MEMORY;
-
- fontid[0] = fluid_synth_sfload(self->Synth, filename, 1);
- if(fontid[0] == FLUID_FAILED)
- {
- ERR("Failed to load soundfont '%s'\n", filename);
- free(fontid);
- return AL_INVALID_VALUE;
- }
-
- fontid = ExchangePtr((XchgPtr*)&self->FontIDs, fontid);
- count = ExchangeInt(&self->NumFontIDs, 1);
-
- for(i = 0;i < count;i++)
- fluid_synth_sfunload(self->Synth, fontid[i], 1);
- free(fontid);
-
- return AL_NO_ERROR;
-}
-
static ALenum FSynth_selectSoundfonts(FSynth *self, ALCdevice *device, ALsizei count, const ALuint *ids)
{
int *fontid;