mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Add support for inline scripts
* Script can be defined in the macro segment or loaded from a file * Supports both LUA and Python * Can be used for actions and conditions * obs_script_create and obs_script_destroy are resolved at runtime (Let's hope the API remains stable)
This commit is contained in:
39
plugins/scripting/macro-action-script-inline.hpp
Normal file
39
plugins/scripting/macro-action-script-inline.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
#include "macro-action-edit.hpp"
|
||||
#include "macro-segment-script-inline.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
class MacroActionScriptInline : public MacroAction,
|
||||
public MacroSegmentScriptInline {
|
||||
public:
|
||||
MacroActionScriptInline(Macro *m) : MacroAction(m) {}
|
||||
|
||||
bool PerformAction();
|
||||
void LogAction() const;
|
||||
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
|
||||
std::string GetId() const { return _id; };
|
||||
|
||||
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||
std::shared_ptr<MacroAction> Copy() const;
|
||||
|
||||
void ResolveVariablesToFixedValues();
|
||||
|
||||
private:
|
||||
static bool _registered;
|
||||
static const std::string _id;
|
||||
};
|
||||
|
||||
class MacroActionScriptInlineEdit : public MacroSegmentScriptInlineEdit {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroActionScriptInlineEdit(
|
||||
QWidget *, std::shared_ptr<MacroActionScriptInline> = nullptr);
|
||||
static QWidget *Create(QWidget *, std::shared_ptr<MacroAction>);
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
Reference in New Issue
Block a user