MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / startTimed

Method startTimed

Tactility/Source/service/screenshot/Screenshot.cpp:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void ScreenshotService::startTimed(const std::string& path, uint8_t delayInSeconds, uint8_t amount) {
40 auto lock = mutex.asScopedLock();
41 if (!lock.lock(50 / portTICK_PERIOD_MS)) {
42 LOGGER.warn(LOG_MESSAGE_MUTEX_LOCK_FAILED);
43 return;
44 }
45
46 if (task == nullptr || task->isFinished()) {
47 task = std::make_unique<ScreenshotTask>();
48 mode = Mode::Timed;
49 task->startTimed(path, delayInSeconds, amount);
50 } else {
51 LOGGER.warn("Screenshot task already running");
52 }
53}
54
55bool ScreenshotService::onStart(ServiceContext& serviceContext) {
56 if (lv_screen_active() == nullptr) {

Callers 1

onStartPressedMethod · 0.45

Calls 4

asScopedLockMethod · 0.80
warnMethod · 0.80
isFinishedMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected