mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Add support to snapshot vars before queue insertion
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#pragma once
|
||||
#include "item-selection-helpers.hpp"
|
||||
#include "macro-action.hpp"
|
||||
#include "variable.hpp"
|
||||
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <deque>
|
||||
#include <obs-data.h>
|
||||
#include <optional>
|
||||
#include <QCheckBox>
|
||||
#include <thread>
|
||||
|
||||
@@ -17,6 +19,11 @@ class ActionQueueSettingsDialog;
|
||||
class ActionQueue : public Item {
|
||||
using TimePoint = std::chrono::high_resolution_clock::time_point;
|
||||
|
||||
struct QueueEntry {
|
||||
std::shared_ptr<MacroAction> action;
|
||||
std::optional<VariableContext> context;
|
||||
};
|
||||
|
||||
public:
|
||||
ActionQueue();
|
||||
~ActionQueue();
|
||||
@@ -43,11 +50,12 @@ private:
|
||||
|
||||
bool _runOnStartup = true;
|
||||
bool _resolveVariablesOnAdd = true;
|
||||
bool _cloneVariableContext = false;
|
||||
std::atomic_bool _stop = {true};
|
||||
std::mutex _mutex;
|
||||
std::condition_variable _cv;
|
||||
std::thread _thread;
|
||||
std::deque<std::shared_ptr<MacroAction>> _actions;
|
||||
std::deque<QueueEntry> _actions;
|
||||
TimePoint _lastEmpty;
|
||||
|
||||
friend ActionQueueSelection;
|
||||
@@ -73,6 +81,7 @@ private:
|
||||
QPushButton *_clear;
|
||||
QCheckBox *_runOnStartup;
|
||||
QCheckBox *_resolveVariablesOnAdd;
|
||||
QCheckBox *_cloneVariableContext;
|
||||
|
||||
ActionQueue &_queue;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user