mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 00:05:41 -05:00
Add option to directly map temp var values to variables
This commit is contained in:
@@ -5,11 +5,12 @@
|
||||
#include <obs-data.h>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <QEnterEvent>
|
||||
#include <QEvent>
|
||||
#include <QStringList>
|
||||
#include <string>
|
||||
|
||||
class QPropertyAnimation;
|
||||
class QPushButton;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace advss {
|
||||
|
||||
class Macro;
|
||||
@@ -17,6 +18,9 @@ class MacroEdit;
|
||||
class MacroSegment;
|
||||
class TempVariableRef;
|
||||
class TempVariableSelection;
|
||||
class TempVarOutputMappingsWidget;
|
||||
class VariableSelection;
|
||||
struct VarMapping;
|
||||
|
||||
// TempVariables are variables that are local to a given macro.
|
||||
// They can be created and used by macro segments.
|
||||
@@ -127,4 +131,48 @@ private:
|
||||
void NotifyUIAboutTempVarChange(MacroSegment *);
|
||||
EXPORT void IncrementTempVarInUseGeneration();
|
||||
|
||||
class ADVSS_EXPORT TempVarOutputMappingsWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TempVarOutputMappingsWidget(QWidget *parent);
|
||||
void SetSegment(MacroSegment *segment);
|
||||
void SetPanelExpanded(bool expanded);
|
||||
void SetSectionCollapsed(bool collapsed);
|
||||
bool IsExpandable() const;
|
||||
|
||||
signals:
|
||||
void ExpandableChanged(bool);
|
||||
|
||||
private slots:
|
||||
void Add();
|
||||
void Remove(int rowIdx);
|
||||
void SegmentTempVarsChanged(MacroSegment *segment);
|
||||
void WriteBackMappings();
|
||||
void AnimationFinished();
|
||||
|
||||
private:
|
||||
void Rebuild();
|
||||
void UpdateVisibility();
|
||||
void UpdateHeight();
|
||||
void AnimateTo(int targetHeight);
|
||||
void PopulateTempVarCombo(FilterComboBox *combo) const;
|
||||
|
||||
struct MappingRow {
|
||||
QWidget *container;
|
||||
FilterComboBox *tempVarCombo;
|
||||
VariableSelection *varSelection;
|
||||
};
|
||||
|
||||
MacroSegment *_segment = nullptr;
|
||||
QVBoxLayout *_rowsLayout;
|
||||
QPushButton *_addButton;
|
||||
std::vector<MappingRow> _rows;
|
||||
bool _loading = false;
|
||||
bool _panelExpanded = false;
|
||||
bool _sectionCollapsed = false;
|
||||
int _animationTargetHeight = 0;
|
||||
QPropertyAnimation *_animation;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
|
||||
Reference in New Issue
Block a user