mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 00:05:41 -05:00
Expose API to notify about variable value change
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "item-selection-helpers.hpp"
|
||||
#include "resizing-text-edit.hpp"
|
||||
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <obs-data.h>
|
||||
#include <optional>
|
||||
@@ -43,6 +44,11 @@ public:
|
||||
std::optional<uint64_t> GetSecondsSinceLastUse() const;
|
||||
std::optional<uint64_t> GetSecondsSinceLastChange() const;
|
||||
void MarkAsUsed() const;
|
||||
EXPORT std::condition_variable &GetCV() { return _cv; }
|
||||
EXPORT std::unique_lock<std::mutex> GetCVLock()
|
||||
{
|
||||
return std::unique_lock<std::mutex>(_cvMutex);
|
||||
}
|
||||
|
||||
private:
|
||||
SaveAction _saveAction = SaveAction::DONT_SAVE;
|
||||
@@ -53,6 +59,8 @@ private:
|
||||
mutable std::chrono::high_resolution_clock::time_point _lastUsed;
|
||||
mutable std::chrono::high_resolution_clock::time_point _lastChanged;
|
||||
mutable std::mutex _mutex;
|
||||
std::mutex _cvMutex;
|
||||
std::condition_variable _cv;
|
||||
|
||||
void UpdateLastUsed() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user