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

This commit is contained in:
WarmUpTill
2026-07-13 20:46:20 +02:00
committed by WarmUpTill
parent 616664e6f3
commit 7be2a4f544
5 changed files with 95 additions and 9 deletions

View File

@@ -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;
};