mirror of https://github.com/bsnes-emu/bsnes.git
34 lines
554 B
C++
34 lines
554 B
C++
#if defined(Hiro_Timer)
|
|
|
|
namespace hiro {
|
|
|
|
auto pTimer::construct() -> void {
|
|
qtTimer = new QtTimer(*this);
|
|
qtTimer->setInterval(0);
|
|
qtTimer->connect(qtTimer, SIGNAL(timeout()), SLOT(onActivate()));
|
|
}
|
|
|
|
auto pTimer::destruct() -> void {
|
|
delete qtTimer;
|
|
}
|
|
|
|
auto pTimer::setEnabled(bool enabled) -> void {
|
|
if(enabled) {
|
|
qtTimer->start();
|
|
} else {
|
|
qtTimer->stop();
|
|
}
|
|
}
|
|
|
|
auto pTimer::setInterval(unsigned interval) -> void {
|
|
qtTimer->setInterval(interval);
|
|
}
|
|
|
|
auto QtTimer::onActivate() -> void {
|
|
p.self().doActivate();
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|