| 172 | } |
| 173 | |
| 174 | void Application::exec(const uint idleTimeInMs) |
| 175 | { |
| 176 | DISTRHO_SAFE_ASSERT_RETURN(pData->isStandalone,); |
| 177 | |
| 178 | #if defined(__EMSCRIPTEN__) |
| 179 | emscripten_set_main_loop_arg(app_idle, this, 0, true); |
| 180 | #elif defined(DISTRHO_OS_MAC) |
| 181 | const CFTimeInterval idleTimeInSecs = static_cast<CFTimeInterval>(idleTimeInMs) / 1000; |
| 182 | |
| 183 | while (! pData->isQuitting) |
| 184 | { |
| 185 | pData->idle(0); |
| 186 | |
| 187 | if (CFRunLoopRunInMode(kCFRunLoopDefaultMode, idleTimeInSecs, true) == kCFRunLoopRunFinished) |
| 188 | break; |
| 189 | } |
| 190 | #else |
| 191 | while (! pData->isQuitting) |
| 192 | pData->idle(idleTimeInMs); |
| 193 | #endif |
| 194 | } |
| 195 | |
| 196 | void Application::quit() |
| 197 | { |
no test coverage detected