bsnes/higan/phoenix/qt/timer.cpp

26 lines
468 B
C++
Executable File

void pTimer::setEnabled(bool enabled) {
if(enabled) {
qtTimer->start();
} else {
qtTimer->stop();
}
}
void pTimer::setInterval(unsigned milliseconds) {
qtTimer->setInterval(milliseconds);
}
void pTimer::constructor() {
qtTimer = new QTimer;
qtTimer->setInterval(0);
connect(qtTimer, SIGNAL(timeout()), SLOT(onTimeout()));
}
void pTimer::destructor() {
delete qtTimer;
}
void pTimer::onTimeout() {
if(timer.onTimeout) timer.onTimeout();
}