File: macro-segment-script-inline.hpp

package info (click to toggle)
obs-advanced-scene-switcher 1.31.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,252 kB
  • sloc: xml: 297,593; cpp: 142,370; python: 387; sh: 189; ansic: 170; makefile: 31
file content (57 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "file-selection.hpp"
#include "inline-script.hpp"
#include "sync-helpers.hpp"
#include "variable-text-edit.hpp"

#include <QLayout>

namespace advss {

class MacroSegmentScriptInline : public Lockable {
public:
	InlineScript::Type GetType() const { return _script.GetType(); }
	void SetType(InlineScript::Type);
	obs_script_lang GetLanguage() const { return _script.GetLanguage(); }
	void SetLanguage(obs_script_lang);
	StringVariable GetScript() const { return _script.GetText(); }
	void SetScript(const std::string &);
	std::string GetPath() const { return _script.GetPath(); }
	void SetPath(const std::string &);

protected:
	InlineScript _script;
};

class MacroSegmentScriptInlineEdit : public QWidget {
	Q_OBJECT

public:
	MacroSegmentScriptInlineEdit(
		QWidget *, std::shared_ptr<MacroSegmentScriptInline> = nullptr);
	virtual ~MacroSegmentScriptInlineEdit() = default;

protected slots:
	void ScriptTypeChanged(int);
	void LanguageChanged(int);
	void ScriptChanged();
	void PathChanged(const QString &);

protected:
	void PopulateWidgets();
	void SetupWidgetConnections();
	void SetupLayout();
	void SetWidgetVisibility();

	QComboBox *_scriptType;
	QComboBox *_language;
	ScriptEditor *_script;
	FileSelection *_path;
	QPushButton *_openFile;
	QHBoxLayout *_fileLayout;

	std::shared_ptr<MacroSegmentScriptInline> _entryData;
	bool _loading = true;
};

} // namespace advss