renamed some Timer methods

svn-id: r10868
This commit is contained in:
Max Horn 2003-10-17 16:39:32 +00:00
parent 96a8d0ec1c
commit ad2db08940
9 changed files with 21 additions and 21 deletions

View File

@ -73,12 +73,12 @@ void Timer::release()
{
}
bool Timer::installProcedure(TimerProc procedure, int32 interval)
bool Timer::installTimerProc(TimerProc procedure, int32 interval)
{
return SendMsg(TSM_MSGID_ADDTIMER, procedure, interval);
}
void Timer::releaseProcedure(TimerProc procedure)
void Timer::removeTimerProc(TimerProc procedure)
{
SendMsg(TSM_MSGID_REMTIMER, procedure, 0);
}

View File

@ -62,8 +62,8 @@ class Timer
bool init();
void release();
bool installProcedure(TimerProc procedure, int32 interval);
void releaseProcedure(TimerProc procedure);
bool installTimerProc(TimerProc procedure, int32 interval);
void removeTimerProc(TimerProc procedure);
protected:
bool SendMsg(ULONG MsgID, TimerProc procedure, LONG interval);

View File

@ -104,7 +104,7 @@ int Timer::handler(int t) {
return t;
}
bool Timer::installProcedure(TimerProc procedure, int32 interval, void *refCon) {
bool Timer::installTimerProc(TimerProc procedure, int32 interval, void *refCon) {
assert(interval > 0);
Common::StackLock lock(_mutex);
@ -122,7 +122,7 @@ bool Timer::installProcedure(TimerProc procedure, int32 interval, void *refCon)
return false;
}
void Timer::releaseProcedure(TimerProc procedure) {
void Timer::removeTimerProc(TimerProc procedure) {
Common::StackLock lock(_mutex);
for (int l = 0; l < MAX_TIMERS; l++) {

View File

@ -52,8 +52,8 @@ public:
Timer(OSystem *system);
~Timer();
bool installProcedure(TimerProc procedure, int32 interval, void *refCon);
void releaseProcedure(TimerProc procedure);
bool installTimerProc(TimerProc procedure, int32 interval, void *refCon);
void removeTimerProc(TimerProc procedure);
protected:
static int timer_handler(int t);

View File

@ -695,12 +695,12 @@ IMuseDigital::IMuseDigital(ScummEngine *scumm)
for (int l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
_channel[l]._mixerChannel = 0;
}
_scumm->_timer->installProcedure(timer_handler, 200000, this);
_scumm->_timer->installTimerProc(timer_handler, 200000, this);
_pause = false;
}
IMuseDigital::~IMuseDigital() {
_scumm->_timer->releaseProcedure(timer_handler);
_scumm->_timer->removeTimerProc(timer_handler);
for (int l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
_scumm->_mixer->stopChannel(_channel[l]._mixerChannel);

View File

@ -260,13 +260,13 @@ void SmushPlayer::init() {
_smixer->_silentMixer = _scumm->_silentDigitalImuse;
_scumm->_smushPlay = true;
_dst = _scumm->virtscr[0].screenPtr + _scumm->virtscr[0].xstart;
_scumm->_timer->installProcedure(&timerCallback, _speed, _scumm);
_scumm->_timer->installTimerProc(&timerCallback, _speed, _scumm);
_alreadyInit = false;
}
void SmushPlayer::deinit() {
_scumm->_timer->releaseProcedure(&timerCallback);
_scumm->_timer->removeTimerProc(&timerCallback);
_scumm->_smushPlay = false;
// In case the timerCallback is active right now, we loop till it finishes.
// Note: even this still leaves a window for race conditions to occur.

View File

@ -1044,7 +1044,7 @@ void Sound::playBundleMusic(const char *song) {
_bundleMusicTrack = 0;
_numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByName(song);
_nameBundleMusic = song;
_scumm->_timer->installProcedure(&music_handler, 1000000, this);
_scumm->_timer->installTimerProc(&music_handler, 1000000, this);
} else if (strcmp(_nameBundleMusic, song) != 0) {
_newNameBundleMusic = song;
_musicBundleToBeChanged = true;
@ -1057,7 +1057,7 @@ void Sound::pauseBundleMusic(bool state) {
void Sound::stopBundleMusic() {
// First stop the music timer
_scumm->_timer->releaseProcedure(&music_handler);
_scumm->_timer->removeTimerProc(&music_handler);
_nameBundleMusic = "";
_scumm->_mixer->stopChannel(_bundleMusicTrack);
if (_musicBundleBufFinal) {
@ -1412,12 +1412,12 @@ void Sound::startCDTimer() {
else
timer_interval = 101;
_scumm->_timer->releaseProcedure(&cd_timer_handler);
_scumm->_timer->installProcedure(&cd_timer_handler, 1000 * timer_interval, _scumm);
_scumm->_timer->removeTimerProc(&cd_timer_handler);
_scumm->_timer->installTimerProc(&cd_timer_handler, 1000 * timer_interval, _scumm);
}
void Sound::stopCDTimer() {
_scumm->_timer->releaseProcedure(&cd_timer_handler);
_scumm->_timer->removeTimerProc(&cd_timer_handler);
}
void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) {

View File

@ -275,7 +275,7 @@ void SkyEngine::initialise(void) {
_skyMouse->useLogicInstance(_skyLogic);
_timer = Engine::_timer; // initialize timer *after* _skyScreen has been initialized.
_timer->installProcedure(&timerHandler, 1000000 / 50, this); //call 50 times per second
_timer->installTimerProc(&timerHandler, 1000000 / 50, this); //call 50 times per second
_skyControl = new SkyControl(_skyScreen, _skyDisk, _skyMouse, _skyText, _skyMusic, _skyLogic, _skySound, _system, getSavePath());
_skyLogic->useControlInstance(_skyControl);

View File

@ -93,7 +93,7 @@ MidiDriver_MPU401::MidiDriver_MPU401() :
void MidiDriver_MPU401::close() {
if (_timer_proc)
g_timer->releaseProcedure(_timer_proc);
g_timer->removeTimerProc(_timer_proc);
_timer_proc = 0;
for (int i = 0; i < 16; ++i)
send (0x7B << 8 | 0xB0 | i);
@ -128,9 +128,9 @@ MidiChannel *MidiDriver_MPU401::allocateChannel() {
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->removeTimerProc(_timer_proc);
_timer_proc = timer_proc;
if (timer_proc)
g_timer->installProcedure(timer_proc, 10000, timer_param);
g_timer->installTimerProc(timer_proc, 10000, timer_param);
}
}