mirror of https://github.com/bsnes-emu/bsnes.git
22 lines
419 B
C++
22 lines
419 B
C++
|
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::onTimeout() {
|
||
|
if(timer.onTimeout) timer.onTimeout();
|
||
|
}
|