aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-11-27 19:41:52 -0800
committerChris Robinson <[email protected]>2013-11-27 19:41:52 -0800
commit489723723c79b4a7470c0d01065bd24d1301a6d1 (patch)
tree15933974228ae2d677fc6f9bd37256ec05586326
parent182b08d8bcdcadf408f03c108ed03296a34f717f (diff)
Cleanups for MidiSynth
Remove an unneeded field, make MidiSynth_getTime public, and properly return a 64-bit time from it.
-rw-r--r--OpenAL32/Include/alMidi.h4
-rw-r--r--OpenAL32/alMidi.c11
2 files changed, 5 insertions, 10 deletions
diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h
index 1e5c09b5..963adf3f 100644
--- a/OpenAL32/Include/alMidi.h
+++ b/OpenAL32/Include/alMidi.h
@@ -23,11 +23,11 @@ typedef struct MidiSynth {
volatile ALenum State;
- char *FontName;
-
const struct MidiSynthVtable *vtbl;
} MidiSynth;
+ALuint64 MidiSynth_getTime(const MidiSynth *self);
+
struct MidiSynthVtable {
void (*const Destruct)(MidiSynth *self);
diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c
index 0dd811fd..b3356e64 100644
--- a/OpenAL32/alMidi.c
+++ b/OpenAL32/alMidi.c
@@ -19,7 +19,7 @@
static void MidiSynth_Construct(MidiSynth *self, ALCdevice *device);
static void MidiSynth_Destruct(MidiSynth *self);
static inline void MidiSynth_setState(MidiSynth *self, ALenum state);
-static inline ALuint MidiSynth_getTime(const MidiSynth *self);
+ALuint64 MidiSynth_getTime(const MidiSynth *self);
static inline ALuint64 MidiSynth_getNextEvtTime(const MidiSynth *self);
static void MidiSynth_update(MidiSynth *self, ALCdevice *device);
static void MidiSynth_updateSpeed(MidiSynth *self);
@@ -37,8 +37,6 @@ static void MidiSynth_Construct(MidiSynth *self, ALCdevice *device)
self->State = AL_INITIAL;
- self->FontName = NULL;
-
self->SampleRate = device->Frequency;
self->SamplesPerTick = (ALdouble)self->SampleRate / TICKS_PER_SECOND;
MidiSynth_updateSpeed(self);
@@ -46,9 +44,6 @@ static void MidiSynth_Construct(MidiSynth *self, ALCdevice *device)
static void MidiSynth_Destruct(MidiSynth *self)
{
- free(self->FontName);
- self->FontName = NULL;
-
ResetEvtQueue(&self->EventQueue);
}
@@ -57,9 +52,9 @@ static inline void MidiSynth_setState(MidiSynth *self, ALenum state)
ExchangeInt(&self->State, state);
}
-static inline ALuint MidiSynth_getTime(const MidiSynth *self)
+ALuint64 MidiSynth_getTime(const MidiSynth *self)
{
- ALuint time = self->LastEvtTime + (self->SamplesSinceLast/self->SamplesPerTick);
+ ALuint64 time = self->LastEvtTime + (self->SamplesSinceLast/self->SamplesPerTick);
return clampu(time, self->LastEvtTime, self->NextEvtTime);
}