mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 19:58:49 -05:00
Variable related refactors
This commit is contained in:
committed by
WarmUpTill
parent
e265e4828e
commit
eec9244e4c
@@ -17,15 +17,6 @@ class Variable : public Item {
|
||||
public:
|
||||
Variable();
|
||||
~Variable();
|
||||
void Load(obs_data_t *obj);
|
||||
void Save(obs_data_t *obj) const;
|
||||
EXPORT std::string Value(bool updateLastUsed = true) const;
|
||||
EXPORT std::optional<double> DoubleValue() const;
|
||||
EXPORT std::optional<int> IntValue() const;
|
||||
EXPORT std::string PreviousValue() const;
|
||||
void SetValue(const std::string &value);
|
||||
void SetValue(double value);
|
||||
std::string GetDefaultValue() const { return _defaultValue; }
|
||||
static std::shared_ptr<Item> Create()
|
||||
{
|
||||
return std::make_shared<Variable>();
|
||||
@@ -36,8 +27,18 @@ public:
|
||||
SAVE,
|
||||
SET_DEFAULT,
|
||||
};
|
||||
|
||||
void Load(obs_data_t *obj);
|
||||
void Save(obs_data_t *obj) const;
|
||||
EXPORT std::string Value(bool updateLastUsed = true) const;
|
||||
EXPORT std::optional<double> DoubleValue() const;
|
||||
EXPORT std::optional<int> IntValue() const;
|
||||
std::string GetPreviousValue() const { return _previousValue; };
|
||||
std::string GetDefaultValue() const { return _defaultValue; }
|
||||
void SetValue(const std::string &value);
|
||||
void SetValue(double value);
|
||||
SaveAction GetSaveAction() const { return _saveAction; }
|
||||
std::optional<uint64_t> SecondsSinceLastUse() const;
|
||||
std::optional<uint64_t> GetSecondsSinceLastUse() const;
|
||||
std::optional<uint64_t> GetSecondsSinceLastChange() const;
|
||||
void UpdateLastUsed() const;
|
||||
void UpdateLastChanged() const;
|
||||
@@ -91,12 +92,7 @@ signals:
|
||||
void Remove(const QString &);
|
||||
};
|
||||
|
||||
void SaveVariables(obs_data_t *obj);
|
||||
void LoadVariables(obs_data_t *obj);
|
||||
void ImportVariables(obs_data_t *obj);
|
||||
|
||||
std::deque<std::shared_ptr<Item>> &GetVariables();
|
||||
|
||||
EXPORT Variable *GetVariableByName(const std::string &name);
|
||||
EXPORT Variable *GetVariableByQString(const QString &name);
|
||||
EXPORT std::weak_ptr<Variable> GetWeakVariableByName(const std::string &name);
|
||||
@@ -104,6 +100,10 @@ EXPORT std::weak_ptr<Variable> GetWeakVariableByQString(const QString &name);
|
||||
std::string GetWeakVariableName(std::weak_ptr<Variable>);
|
||||
EXPORT QStringList GetVariablesNameList();
|
||||
|
||||
void SaveVariables(obs_data_t *obj);
|
||||
void LoadVariables(obs_data_t *obj);
|
||||
void ImportVariables(obs_data_t *obj);
|
||||
|
||||
std::chrono::high_resolution_clock::time_point GetLastVariableChangeTime();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
Reference in New Issue
Block a user