| @@ -80,6 +80,15 @@ public: | |||||
| */ | */ | ||||
| bool isStandalone() const noexcept; | bool isStandalone() const noexcept; | ||||
| /** | |||||
| Return the time in seconds. | |||||
| This is a monotonically increasing clock with high resolution.@n | |||||
| The returned time is only useful to compare against other times returned by this function, | |||||
| its absolute value has no meaning. | |||||
| */ | |||||
| double getTime() const; | |||||
| /** | /** | ||||
| Add a callback function to be triggered on every idle cycle. | Add a callback function to be triggered on every idle cycle. | ||||
| You can add more than one, and remove them at anytime with removeIdleCallback(). | You can add more than one, and remove them at anytime with removeIdleCallback(). | ||||
| @@ -56,6 +56,11 @@ bool Application::isStandalone() const noexcept | |||||
| return pData->isStandalone; | return pData->isStandalone; | ||||
| } | } | ||||
| double Application::getTime() const | |||||
| { | |||||
| return pData->getTime(); | |||||
| } | |||||
| void Application::addIdleCallback(IdleCallback* const callback) | void Application::addIdleCallback(IdleCallback* const callback) | ||||
| { | { | ||||
| DISTRHO_SAFE_ASSERT_RETURN(callback != nullptr,) | DISTRHO_SAFE_ASSERT_RETURN(callback != nullptr,) | ||||
| @@ -152,6 +152,13 @@ void Application::PrivateData::quit() | |||||
| #endif | #endif | ||||
| } | } | ||||
| double Application::PrivateData::getTime() const | |||||
| { | |||||
| DISTRHO_SAFE_ASSERT_RETURN(world != nullptr, 0.0); | |||||
| return puglGetTime(world); | |||||
| } | |||||
| void Application::PrivateData::setClassName(const char* const name) | void Application::PrivateData::setClassName(const char* const name) | ||||
| { | { | ||||
| DISTRHO_SAFE_ASSERT_RETURN(world != nullptr,); | DISTRHO_SAFE_ASSERT_RETURN(world != nullptr,); | ||||
| @@ -91,6 +91,9 @@ struct Application::PrivateData { | |||||
| For standalone mode only. */ | For standalone mode only. */ | ||||
| void quit(); | void quit(); | ||||
| /** Get time via pugl */ | |||||
| double getTime() const; | |||||
| /** Set pugl world class name. */ | /** Set pugl world class name. */ | ||||
| void setClassName(const char* name); | void setClassName(const char* name); | ||||