aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-08-22 13:27:34 +0000
committerMax Horn2004-08-22 13:27:34 +0000
commit759cd67de518a583804ccfb14d5fead44ef05e96 (patch)
tree6692779fa4d01fecbf54f0ab162df7cfefe73975
parent50719f7b6843ba6383ca75c881af589d947150f2 (diff)
downloadscummvm-rg350-759cd67de518a583804ccfb14d5fead44ef05e96.tar.gz
scummvm-rg350-759cd67de518a583804ccfb14d5fead44ef05e96.tar.bz2
scummvm-rg350-759cd67de518a583804ccfb14d5fead44ef05e96.zip
cleanup of TimerProc mess
svn-id: r14683
-rw-r--r--backends/midi/adlib.cpp8
-rw-r--r--backends/midi/ym2612.cpp7
-rw-r--r--common/timer.h3
-rw-r--r--sound/mididrv.h2
-rw-r--r--sound/mpu401.cpp2
-rw-r--r--sound/mpu401.h6
6 files changed, 12 insertions, 16 deletions
diff --git a/backends/midi/adlib.cpp b/backends/midi/adlib.cpp
index 662c7d450b..64b768868e 100644
--- a/backends/midi/adlib.cpp
+++ b/backends/midi/adlib.cpp
@@ -537,8 +537,6 @@ static void create_lookup_table() {
lookup_table[i][0] = 0;
}
-typedef void TimerCallback (void *);
-
////////////////////////////////////////
//
// Adlib MIDI driver
@@ -561,7 +559,7 @@ public:
void setPitchBendRange(byte channel, uint range);
void sysEx_customInstrument(byte channel, uint32 type, byte *instr);
- void setTimerCallback(void *timer_param, TimerProc timer_proc);
+ void setTimerCallback(void *timer_param, Timer::TimerProc timer_proc);
uint32 getBaseTempo() {
return 1000000 / BASE_FREQ;
}
@@ -577,7 +575,7 @@ private:
byte *_adlib_reg_cache;
SoundMixer *_mixer;
- TimerCallback *_timer_proc;
+ Timer::TimerProc _timer_proc;
void *_timer_param;
int _adlib_timer_counter;
@@ -966,7 +964,7 @@ void MidiDriver_ADLIB::sysEx_customInstrument(byte channel, uint32 type, byte *i
_parts[channel].sysEx_customInstrument(type, instr);
}
-void MidiDriver_ADLIB::setTimerCallback(void *timer_param, TimerProc timer_proc) {
+void MidiDriver_ADLIB::setTimerCallback(void *timer_param, Timer::TimerProc timer_proc) {
_timer_proc = timer_proc;
_timer_param = timer_param;
}
diff --git a/backends/midi/ym2612.cpp b/backends/midi/ym2612.cpp
index de13537c1c..c6fe5bb646 100644
--- a/backends/midi/ym2612.cpp
+++ b/backends/midi/ym2612.cpp
@@ -166,8 +166,7 @@ protected:
bool _isOpen;
SoundMixer *_mixer;
- typedef void TimerCallback(void *);
- TimerCallback *_timer_proc;
+ Timer::TimerProc _timer_proc;
void *_timer_param;
int _next_tick;
int _samples_per_tick;
@@ -194,7 +193,7 @@ public:
void setPitchBendRange(byte channel, uint range) { }
void sysEx(byte *msg, uint16 length);
- void setTimerCallback(void *timer_param, TimerProc timer_proc);
+ void setTimerCallback(void *timer_param, Timer::TimerProc timer_proc);
uint32 getBaseTempo() { return 1000000 / BASE_FREQ; }
MidiChannel *allocateChannel() { return 0; }
@@ -769,7 +768,7 @@ void MidiDriver_YM2612::close() {
_mixer->setupPremix(0, 0);
}
-void MidiDriver_YM2612::setTimerCallback(void *timer_param, TimerProc timer_proc) {
+void MidiDriver_YM2612::setTimerCallback(void *timer_param, Timer::TimerProc timer_proc) {
_timer_proc = timer_proc;
_timer_param = timer_param;
}
diff --git a/common/timer.h b/common/timer.h
index d4ce52cbad..814612bd85 100644
--- a/common/timer.h
+++ b/common/timer.h
@@ -26,13 +26,14 @@
#define MAX_TIMERS 2
-typedef void (*TimerProc)(void *refCon);
#ifdef __MORPHOS__
#include "morphos_timer.h"
#else
class Timer {
+public:
+ typedef void (*TimerProc)(void *refCon);
private:
OSystem *_system;
diff --git a/sound/mididrv.h b/sound/mididrv.h
index 24aaab9bf9..512ff6b6ab 100644
--- a/sound/mididrv.h
+++ b/sound/mididrv.h
@@ -125,7 +125,7 @@ public:
virtual void metaEvent (byte type, byte*data, uint16 length) { }
// Timing functions - MidiDriver now operates timers
- virtual void setTimerCallback (void *timer_param, TimerProc timer_proc) = 0;
+ virtual void setTimerCallback (void *timer_param, Timer::TimerProc timer_proc) = 0;
virtual uint32 getBaseTempo (void) = 0;
// Channel allocation functions
diff --git a/sound/mpu401.cpp b/sound/mpu401.cpp
index ae1fe32de9..e301986a83 100644
--- a/sound/mpu401.cpp
+++ b/sound/mpu401.cpp
@@ -125,7 +125,7 @@ MidiChannel *MidiDriver_MPU401::allocateChannel() {
return NULL;
}
-void MidiDriver_MPU401::setTimerCallback(void *timer_param, TimerProc timer_proc) {
+void MidiDriver_MPU401::setTimerCallback(void *timer_param, Timer::TimerProc timer_proc) {
if (!_timer_proc || !timer_proc) {
if (_timer_proc)
g_timer->removeTimerProc(_timer_proc);
diff --git a/sound/mpu401.h b/sound/mpu401.h
index 5d87f52bc1..365c46c5a5 100644
--- a/sound/mpu401.h
+++ b/sound/mpu401.h
@@ -70,17 +70,15 @@ public:
class MidiDriver_MPU401 : public MidiDriver {
private:
- typedef void (*TimerProc)(void *refCon); // Copied from class Timer
-
MidiChannel_MPU401 _midi_channels [16];
- TimerProc _timer_proc;
+ Timer::TimerProc _timer_proc;
uint16 _channel_mask;
public:
MidiDriver_MPU401();
virtual void close();
- void setTimerCallback(void *timer_param, TimerProc timer_proc);
+ void setTimerCallback(void *timer_param, Timer::TimerProc timer_proc);
uint32 getBaseTempo(void) { return 10000; }
uint32 property(int prop, uint32 param);