winamp/Src/timer/timerapi.cpp

32 lines
539 B
C++
Raw Normal View History

2024-09-24 08:54:57 -04:00
#include "api.h"
#include "timerapi.h"
#include "tmultiplex.h"
//timer_api *timerApi = NULL;
TimerApi::TimerApi()
{
}
TimerApi::~TimerApi()
{
multiplex.shutdown();
}
TimerToken TimerApi::timer_add(TimerClient *client, intptr_t id, int ms)
{
multiplex.add(client, id, ms);
return id;
}
void TimerApi::timer_remove(TimerClient *client, TimerToken id)
{
multiplex.remove(client, id);
}
#define CBCLASS TimerApi
START_DISPATCH;
CB(TIMER_API_ADD, timer_add);
VCB(TIMER_API_REMOVE, timer_remove);
END_DISPATCH;
#undef CBCLASS