mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-05 16:16:18 -05:00
Use more const refs where applicable
This commit is contained in:
@@ -286,8 +286,8 @@ private:
|
||||
void GetWindowList(std::vector<std::string> &windows);
|
||||
void GetWindowList(QStringList &windows);
|
||||
void GetCurrentWindowTitle(std::string &title);
|
||||
bool isFullscreen(std::string &title);
|
||||
bool isMaximized(std::string &title);
|
||||
bool isFullscreen(const std::string &title);
|
||||
bool isMaximized(const std::string &title);
|
||||
|
||||
/******************************************************************************
|
||||
* Screenregion helper
|
||||
@@ -309,11 +309,12 @@ bool isInFocus(const QString &executable);
|
||||
* Sceneswitch helper
|
||||
******************************************************************************/
|
||||
|
||||
void setNextTransition(sceneSwitchInfo &ssi, obs_source_t *currentSource,
|
||||
void setNextTransition(const sceneSwitchInfo &ssi, obs_source_t *currentSource,
|
||||
transitionData &td);
|
||||
void overwriteTransitionOverride(sceneSwitchInfo ssi, transitionData &td);
|
||||
void restoreTransitionOverride(obs_source_t *scene, transitionData td);
|
||||
void switchScene(sceneSwitchInfo ssi);
|
||||
void overwriteTransitionOverride(const sceneSwitchInfo &ssi,
|
||||
transitionData &td);
|
||||
void restoreTransitionOverride(obs_source_t *scene, const transitionData &td);
|
||||
void switchScene(const sceneSwitchInfo &ssi);
|
||||
|
||||
/******************************************************************************
|
||||
* Main SwitcherData
|
||||
|
||||
@@ -20,12 +20,12 @@ struct MacroActionInfo {
|
||||
class MacroActionFactory {
|
||||
public:
|
||||
MacroActionFactory() = delete;
|
||||
static bool Register(std::string id, MacroActionInfo);
|
||||
static std::shared_ptr<MacroAction> Create(const std::string id);
|
||||
static QWidget *CreateWidget(const std::string id, QWidget *parent,
|
||||
static bool Register(const std::string &id, MacroActionInfo);
|
||||
static std::shared_ptr<MacroAction> Create(const std::string &id);
|
||||
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
||||
std::shared_ptr<MacroAction> action);
|
||||
static auto GetActionTypes() { return _methods; }
|
||||
static std::string GetActionName(const std::string id);
|
||||
static std::string GetActionName(const std::string &id);
|
||||
static std::string GetIdByName(const QString &name);
|
||||
|
||||
private:
|
||||
@@ -38,9 +38,9 @@ class MacroActionEdit : public QWidget {
|
||||
public:
|
||||
MacroActionEdit(QWidget *parent = nullptr,
|
||||
std::shared_ptr<MacroAction> * = nullptr,
|
||||
std::string id = "scene_switch",
|
||||
const std::string &id = "scene_switch",
|
||||
bool startCollapsed = false);
|
||||
void UpdateEntryData(std::string id);
|
||||
void UpdateEntryData(const std::string &id);
|
||||
void Collapse(bool collapsed);
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -21,7 +21,7 @@ class MacroConditionFactory {
|
||||
public:
|
||||
MacroConditionFactory() = delete;
|
||||
static bool Register(const std::string &, MacroConditionInfo);
|
||||
static std::shared_ptr<MacroCondition> Create(const std::string);
|
||||
static std::shared_ptr<MacroCondition> Create(const std::string &);
|
||||
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
||||
std::shared_ptr<MacroCondition>);
|
||||
static auto GetConditionTypes() { return _methods; }
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
bool PerformAction();
|
||||
bool Matched() { return _matched; }
|
||||
std::string Name() { return _name; }
|
||||
void SetName(std::string name) { _name = name; }
|
||||
void SetName(const std::string &name) { _name = name; }
|
||||
void SetPaused(bool pause = true) { _paused = pause; }
|
||||
bool Paused() { return _paused; }
|
||||
std::deque<std::shared_ptr<MacroCondition>> &Conditions()
|
||||
|
||||
@@ -40,9 +40,9 @@ struct SceneGroup {
|
||||
int lastRandomScene = -1;
|
||||
|
||||
inline SceneGroup(){};
|
||||
inline SceneGroup(std::string name_) : name(name_){};
|
||||
inline SceneGroup(std::string name_, AdvanceCondition type_,
|
||||
std::vector<OBSWeakSource> scenes_, int count_,
|
||||
inline SceneGroup(const std::string &name_) : name(name_){};
|
||||
inline SceneGroup(const std::string &name_, AdvanceCondition type_,
|
||||
const std::vector<OBSWeakSource> &scenes_, int count_,
|
||||
double time_, bool repeat_)
|
||||
: name(name_),
|
||||
type(type_),
|
||||
|
||||
@@ -201,7 +201,7 @@ struct SwitcherData {
|
||||
void resetTabOrder();
|
||||
|
||||
void writeSceneInfoToFile();
|
||||
void writeToStatusFile(QString status);
|
||||
void writeToStatusFile(const QString &msg);
|
||||
|
||||
bool checkForMatch(OBSWeakSource &scene, OBSWeakSource &transition,
|
||||
int &linger, bool &setPreviousSceneAsMatch,
|
||||
@@ -254,7 +254,7 @@ struct SwitcherData {
|
||||
void saveNetworkSwitches(obs_data_t *obj);
|
||||
void saveGeneralSettings(obs_data_t *obj);
|
||||
void saveHotkeys(obs_data_t *obj);
|
||||
void saveVersion(obs_data_t *obj, std::string currentVersion);
|
||||
void saveVersion(obs_data_t *obj, const std::string ¤tVersion);
|
||||
|
||||
void loadSettings(obs_data_t *obj);
|
||||
void loadMacros(obs_data_t *obj);
|
||||
|
||||
@@ -114,7 +114,7 @@ static inline OBSWeakSource GetWeakFilterByQString(OBSWeakSource source,
|
||||
}
|
||||
|
||||
static inline std::string
|
||||
getNextDelim(std::string text,
|
||||
getNextDelim(const std::string &text,
|
||||
std::unordered_map<std::string, QWidget *> placeholders)
|
||||
{
|
||||
size_t pos = std::string::npos;
|
||||
@@ -214,7 +214,7 @@ static inline bool compareIgnoringLineEnding(QString &s1, QString &s2)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool DisplayMessage(QString msg, bool question = false)
|
||||
static inline bool DisplayMessage(const QString &msg, bool question = false)
|
||||
{
|
||||
if (question) {
|
||||
QMessageBox::StandardButton reply;
|
||||
|
||||
Reference in New Issue
Block a user