Move GetShortDesc() and GetId() to MacroSegment class

This commit is contained in:
WarmUpTill 2021-07-18 00:05:48 +02:00 committed by WarmUpTill
parent fd789b476b
commit 058af0d3bb
2 changed files with 7 additions and 15 deletions

View File

@ -44,6 +44,8 @@ public:
bool GetCollapsed() { return _collapsed; }
virtual bool Save(obs_data_t *obj) = 0;
virtual bool Load(obs_data_t *obj) = 0;
virtual std::string GetShortDesc();
virtual std::string GetId() = 0;
protected:
int _idx;
@ -55,9 +57,6 @@ public:
virtual bool CheckCondition() = 0;
virtual bool Save(obs_data_t *obj) = 0;
virtual bool Load(obs_data_t *obj) = 0;
virtual std::string GetShortDesc();
virtual std::string GetId() = 0;
LogicType GetLogicType() { return _logic; }
void SetLogicType(LogicType logic) { _logic = logic; }
static const std::map<LogicType, LogicTypeInfo> logicTypes;
@ -80,8 +79,6 @@ public:
virtual bool PerformAction() = 0;
virtual bool Save(obs_data_t *obj) = 0;
virtual bool Load(obs_data_t *obj) = 0;
virtual std::string GetShortDesc();
virtual std::string GetId() = 0;
virtual void LogAction();
};

View File

@ -395,6 +395,11 @@ bool MacroSegment::Load(obs_data_t *obj)
return true;
}
std::string MacroSegment::GetShortDesc()
{
return "";
}
bool MacroCondition::Save(obs_data_t *obj)
{
MacroSegment::Save(obj);
@ -412,11 +417,6 @@ bool MacroCondition::Load(obs_data_t *obj)
return true;
}
std::string MacroCondition::GetShortDesc()
{
return "";
}
void MacroCondition::SetDurationConstraint(const DurationConstraint &dur)
{
_duration = dur;
@ -450,11 +450,6 @@ bool MacroAction::Load(obs_data_t *obj)
return true;
}
std::string MacroAction::GetShortDesc()
{
return "";
}
void MacroAction::LogAction()
{
vblog(LOG_INFO, "performed action %s", GetId().c_str());