| 21 | } |
| 22 | |
| 23 | void ScreenshotService::startApps(const std::string& path) { |
| 24 | auto lock = mutex.asScopedLock(); |
| 25 | if (!lock.lock(50 / portTICK_PERIOD_MS)) { |
| 26 | LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED); |
| 27 | return; |
| 28 | } |
| 29 | |
| 30 | if (task == nullptr || task->isFinished()) { |
| 31 | task = std::make_unique<ScreenshotTask>(); |
| 32 | mode = Mode::Apps; |
| 33 | task->startApps(path); |
| 34 | } else { |
| 35 | LOGGER.warn("Screenshot task already running"); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | void ScreenshotService::startTimed(const std::string& path, uint8_t delayInSeconds, uint8_t amount) { |
| 40 | auto lock = mutex.asScopedLock(); |
no test coverage detected