[Scummvm-cvs-logs] CVS: scummvm/sound mpu401.cpp,1.20,1.21
Max Horn
fingolfin at users.sourceforge.net
Sun Sep 28 14:10:02 CEST 2003
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv30803/sound
Modified Files:
mpu401.cpp
Log Message:
removed duplicate g_timer object (one was global, one was static to timer.cpp); set g_system earlier (might prevent a few race conditions)
Index: mpu401.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mpu401.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mpu401.cpp 27 Sep 2003 23:59:00 -0000 1.20
+++ mpu401.cpp 28 Sep 2003 21:08:48 -0000 1.21
@@ -24,8 +24,6 @@
#include "common/timer.h"
#include "common/util.h" // for ARRAYSIZE
-extern Timer *g_timer;
-
void MidiChannel_MPU401::init(MidiDriver_MPU401 *owner, byte channel) {
_owner = owner;
_channel = channel;
@@ -45,7 +43,7 @@
}
void MidiChannel_MPU401::noteOn(byte note, byte velocity) {
- _owner->send (velocity << 16 | note << 8 | 0x90 | _channel);
+ _owner->send(velocity << 16 | note << 8 | 0x90 | _channel);
}
void MidiChannel_MPU401::programChange(byte program) {
@@ -61,11 +59,11 @@
}
void MidiChannel_MPU401::pitchBendFactor(byte value) {
- _owner->setPitchBendRange (_channel, value);
+ _owner->setPitchBendRange(_channel, value);
}
void MidiChannel_MPU401::sysEx_customInstrument(uint32 type, byte *instr) {
- _owner->sysEx_customInstrument (_channel, type, instr);
+ _owner->sysEx_customInstrument(_channel, type, instr);
}
const char *MidiDriver::getErrorName(int error_code) {
@@ -96,7 +94,7 @@
void MidiDriver_MPU401::close() {
if (_timer_proc)
- g_timer->releaseProcedure (_timer_proc);
+ g_timer->releaseProcedure(_timer_proc);
_timer_proc = 0;
for (int i = 0; i < 16; ++i)
send (0x7B << 8 | 0xB0 | i);
@@ -122,7 +120,7 @@
chan = &_midi_channels[i];
if (!chan->_allocated) {
chan->allocate();
- return (chan);
+ return chan;
}
}
return NULL;
@@ -131,9 +129,9 @@
void MidiDriver_MPU401::setTimerCallback (void *timer_param, TimerProc timer_proc) {
if (!_timer_proc || !timer_proc) {
if (_timer_proc)
- g_timer->releaseProcedure (_timer_proc);
+ g_timer->releaseProcedure(_timer_proc);
_timer_proc = timer_proc;
if (timer_proc)
- g_timer->installProcedure (timer_proc, 10000, timer_param);
+ g_timer->installProcedure(timer_proc, 10000, timer_param);
}
}
More information about the Scummvm-git-logs
mailing list