File: macro-action.cpp

package info (click to toggle)
obs-advanced-scene-switcher 1.32.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,492 kB
  • sloc: xml: 297,593; cpp: 147,875; python: 387; sh: 280; ansic: 170; makefile: 33
file content (59 lines) | stat: -rw-r--r-- 1,053 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
58
59
#include "macro-action.hpp"

namespace advss {

MacroAction::MacroAction(Macro *m, bool supportsVariableValue)
	: MacroSegment(m, supportsVariableValue)
{
}

bool MacroAction::Save(obs_data_t *obj) const
{
	MacroSegment::Save(obj);
	obs_data_set_string(obj, "id", GetId().c_str());
	return true;
}

bool MacroAction::Load(obs_data_t *obj)
{
	MacroSegment::Load(obj);
	return true;
}

void MacroAction::LogAction() const
{
	ablog(LOG_INFO, "performed action %s", GetId().c_str());
}

void MacroAction::ResolveVariablesToFixedValues() {}

std::string_view MacroAction::GetDefaultID()
{
	return "scene_switch";
}

MacroRefAction::MacroRefAction(Macro *m, bool supportsVariableValue)
	: MacroAction(m, supportsVariableValue)
{
}

bool MacroRefAction::PostLoad()
{
	_macro.PostLoad();
	return true;
}

MultiMacroRefAction::MultiMacroRefAction(Macro *m, bool supportsVariableValue)
	: MacroAction(m, supportsVariableValue)
{
}

bool MultiMacroRefAction::PostLoad()
{
	for (auto &macro : _macros) {
		macro.PostLoad();
	}
	return true;
}

} // namespace advss