Mark free functions static where applicable

This commit is contained in:
WarmUpTill
2023-04-29 22:56:45 +02:00
committed by WarmUpTill
parent 5967c83b03
commit 443ffb7906
27 changed files with 99 additions and 94 deletions

View File

@@ -504,7 +504,7 @@ extern "C" void FreeSceneSwitcher()
switcher = nullptr;
}
void handleSceneChange()
static void handleSceneChange()
{
switcher->lastSceneChangeTime =
std::chrono::high_resolution_clock::now();
@@ -538,17 +538,17 @@ void handleSceneChange()
}
}
void setLiveTime()
static void setLiveTime()
{
switcher->liveTime = QDateTime::currentDateTime();
}
void resetLiveTime()
static void resetLiveTime()
{
switcher->liveTime = QDateTime();
}
void checkAutoStartRecording()
static void checkAutoStartRecording()
{
if (switcher->autoStartEvent == SwitcherData::AutoStart::RECORDING ||
switcher->autoStartEvent ==
@@ -556,7 +556,7 @@ void checkAutoStartRecording()
switcher->Start();
}
void checkAutoStartStreaming()
static void checkAutoStartStreaming()
{
if (switcher->autoStartEvent == SwitcherData::AutoStart::STREAMING ||
switcher->autoStartEvent ==
@@ -564,7 +564,7 @@ void checkAutoStartStreaming()
switcher->Start();
}
void handlePeviewSceneChange()
static void handlePeviewSceneChange()
{
if (switcher->networkConfig.ShouldSendPrviewSceneChange()) {
auto source = obs_frontend_get_current_preview_scene();
@@ -575,31 +575,31 @@ void handlePeviewSceneChange()
}
}
void setReplayBufferSaved()
static void setReplayBufferSaved()
{
switcher->replayBufferSaved = true;
}
void setTranstionEnd()
static void setTranstionEnd()
{
switcher->lastTransitionEndTime =
std::chrono::high_resolution_clock::now();
switcher->macroTransitionCv.notify_all();
}
void setStreamStarting()
static void setStreamStarting()
{
switcher->lastStreamStartingTime =
std::chrono::high_resolution_clock::now();
}
void setStreamStopping()
static void setStreamStopping()
{
switcher->lastStreamStoppingTime =
std::chrono::high_resolution_clock::now();
}
void handleExit()
static void handleExit()
{
if (!switcher) {
return;
@@ -613,7 +613,7 @@ void handleExit()
FreeSceneSwitcher();
}
void handleSceneCollectionChanging()
static void handleSceneCollectionChanging()
{
if (switcher->settingsWindowOpened) {
AdvSceneSwitcher::window->close();
@@ -679,7 +679,7 @@ static void OBSEvent(enum obs_frontend_event event, void *switcher)
}
}
void LoadPlugins()
static void LoadPlugins()
{
QFileInfo libPath(
QString(obs_get_module_binary_path(obs_current_module())));

View File

@@ -318,7 +318,7 @@ void AdvSceneSwitcher::on_importSettings_clicked()
}
}
int findTabIndex(QTabWidget *tabWidget, int pos)
static int findTabIndex(QTabWidget *tabWidget, int pos)
{
int at = -1;
@@ -660,7 +660,8 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
lastImportPath = obs_data_get_string(obj, "lastImportPath");
}
void saveSplitterPos(QList<int> &sizes, obs_data_t *obj, const std::string name)
static void saveSplitterPos(QList<int> &sizes, obs_data_t *obj,
const std::string name)
{
auto array = obs_data_array_create();
for (int i = 0; i < sizes.count(); ++i) {
@@ -673,7 +674,8 @@ void saveSplitterPos(QList<int> &sizes, obs_data_t *obj, const std::string name)
obs_data_array_release(array);
}
void loadSplitterPos(QList<int> &sizes, obs_data_t *obj, const std::string name)
static void loadSplitterPos(QList<int> &sizes, obs_data_t *obj,
const std::string name)
{
sizes.clear();
obs_data_array_t *array = obs_data_get_array(obj, name.c_str());
@@ -831,7 +833,7 @@ void SwitcherData::checkSwitchCooldown(bool &match)
}
}
void populateStartupBehavior(QComboBox *cb)
static void populateStartupBehavior(QComboBox *cb)
{
cb->addItem(obs_module_text(
"AdvSceneSwitcher.generalTab.status.onStartup.asLastRun"));
@@ -841,7 +843,7 @@ void populateStartupBehavior(QComboBox *cb)
"AdvSceneSwitcher.generalTab.status.onStartup.doNotStart"));
}
void populateAutoStartEventSelection(QComboBox *cb)
static void populateAutoStartEventSelection(QComboBox *cb)
{
cb->addItem(obs_module_text(
"AdvSceneSwitcher.generalTab.status.autoStart.never"));

View File

@@ -120,7 +120,7 @@ void Hotkey::ClearAllHotkeys()
_registeredHotkeys.clear();
}
void startHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
static void startHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
{
if (pressed) {
if (!(switcher->th && switcher->th->isRunning())) {
@@ -129,7 +129,7 @@ void startHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
}
}
void stopHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
static void stopHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
{
if (pressed) {
if (switcher->th && switcher->th->isRunning()) {
@@ -138,8 +138,8 @@ void stopHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *, bool pressed)
}
}
void startStopToggleHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
static void startStopToggleHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
{
if (pressed) {
if (switcher->th && switcher->th->isRunning()) {
@@ -150,8 +150,8 @@ void startStopToggleHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
}
}
void upMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
static void upMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
{
if (pressed && switcher->settingsWindowOpened &&
AdvSceneSwitcher::window) {
@@ -161,8 +161,8 @@ void upMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
}
}
void downMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
static void downMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
{
if (pressed && switcher->settingsWindowOpened &&
AdvSceneSwitcher::window) {
@@ -172,8 +172,8 @@ void downMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
}
}
void removeMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
static void removeMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
bool pressed)
{
if (pressed && switcher->settingsWindowOpened &&
AdvSceneSwitcher::window) {
@@ -183,7 +183,7 @@ void removeMacroSegmentHotkeyFunc(void *, obs_hotkey_id, obs_hotkey_t *,
}
}
void registerHotkeys()
static void registerHotkeys()
{
switcher->startHotkey = obs_hotkey_register_frontend(
"startSwitcherHotkey",
@@ -216,7 +216,7 @@ void registerHotkeys()
switcher->hotkeysRegistered = true;
}
void saveHotkey(obs_data_t *obj, obs_hotkey_id id, const char *name)
static void saveHotkey(obs_data_t *obj, obs_hotkey_id id, const char *name)
{
obs_data_array_t *a = obs_hotkey_save(id);
obs_data_set_array(obj, name, a);
@@ -233,7 +233,7 @@ void SwitcherData::SaveHotkeys(obs_data_t *obj)
saveHotkey(obj, removeMacroSegment, "removeMacroSegmentHotkey");
}
void loadHotkey(obs_data_t *obj, obs_hotkey_id id, const char *name)
static void loadHotkey(obs_data_t *obj, obs_hotkey_id id, const char *name)
{
obs_data_array_t *a = obs_data_get_array(obj, name);
obs_hotkey_load(id, a);

View File

@@ -163,6 +163,4 @@ enum class HotkeyType {
Key_NumpadEnter
};
void registerHotkeys();
} // namespace advss

View File

@@ -419,7 +419,7 @@ MacroActionAudioEdit::MacroActionAudioEdit(
_loading = false;
}
bool hasVolumeControl(MacroActionAudio::Action action)
static bool hasVolumeControl(MacroActionAudio::Action action)
{
return action == MacroActionAudio::Action::SOURCE_VOLUME ||
action == MacroActionAudio::Action::MASTER_VOLUME;

View File

@@ -133,7 +133,8 @@ static std::unordered_map<HotkeyType, long> keyTable = {
//{HotkeyType::Key_NumpadEnter, ???},
};
obs_key_combination keysToOBSKeycombo(const std::vector<HotkeyType> &keys)
static obs_key_combination
keysToOBSKeycombo(const std::vector<HotkeyType> &keys)
{
obs_key_combination combo{};
auto it = keyTable.find(keys.back());
@@ -181,7 +182,7 @@ obs_key_combination keysToOBSKeycombo(const std::vector<HotkeyType> &keys)
return combo;
}
void InjectKeys(const std::vector<HotkeyType> &keys, int duration)
static void InjectKeys(const std::vector<HotkeyType> &keys, int duration)
{
auto combo = keysToOBSKeycombo(keys);
if (obs_key_combination_is_empty(combo)) {

View File

@@ -18,12 +18,12 @@ const static std::map<MacroActionHttp::Method, std::string> methods = {
"AdvSceneSwitcher.action.http.type.post"},
};
size_t DropCB(void *, size_t size, size_t nmemb, std::string *)
static size_t DropCB(void *, size_t size, size_t nmemb, std::string *)
{
return size * nmemb;
}
size_t WriteCB(void *ptr, size_t size, size_t nmemb, std::string *buffer)
static size_t WriteCB(void *ptr, size_t size, size_t nmemb, std::string *buffer)
{
buffer->append((char *)ptr, nmemb);
return size * nmemb;

View File

@@ -31,13 +31,13 @@ const static std::map<SwitcherData::NoMatch, std::string> noMatchValues = {
"AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom"},
};
void stopPlugin()
static void stopPlugin()
{
std::thread t([]() { switcher->Stop(); });
t.detach();
}
void importSettings(const std::string &path)
static void importSettings(const std::string &path)
{
if (switcher->settingsWindowOpened) {
return;
@@ -50,7 +50,7 @@ void importSettings(const std::string &path)
obs_data_release(obj);
}
void setNoMatchBehaviour(int value, OBSWeakSource &scene)
static void setNoMatchBehaviour(int value, OBSWeakSource &scene)
{
switcher->switchIfNotMatching =
static_cast<SwitcherData::NoMatch>(value);

View File

@@ -23,7 +23,7 @@ const static std::map<SceneOrderAction, std::string> actionTypes = {
"AdvSceneSwitcher.action.sceneOrder.type.movePosition"},
};
void moveSceneItemsUp(std::vector<obs_scene_item *> &items)
static void moveSceneItemsUp(std::vector<obs_scene_item *> &items)
{
// In the case of the same source being in two sequential positions
// moving the sources up will cause the sources to swap positions due to
@@ -39,7 +39,7 @@ void moveSceneItemsUp(std::vector<obs_scene_item *> &items)
}
}
void moveSceneItemsDown(std::vector<obs_scene_item *> &items)
static void moveSceneItemsDown(std::vector<obs_scene_item *> &items)
{
for (auto &i : items) {
obs_sceneitem_set_order(i, OBS_ORDER_MOVE_DOWN);
@@ -47,7 +47,7 @@ void moveSceneItemsDown(std::vector<obs_scene_item *> &items)
}
}
void moveSceneItemsTop(std::vector<obs_scene_item *> &items)
static void moveSceneItemsTop(std::vector<obs_scene_item *> &items)
{
for (auto &i : items) {
obs_sceneitem_set_order(i, OBS_ORDER_MOVE_TOP);
@@ -55,7 +55,7 @@ void moveSceneItemsTop(std::vector<obs_scene_item *> &items)
}
}
void moveSceneItemsBottom(std::vector<obs_scene_item *> &items)
static void moveSceneItemsBottom(std::vector<obs_scene_item *> &items)
{
for (auto &i : items) {
obs_sceneitem_set_order(i, OBS_ORDER_MOVE_BOTTOM);
@@ -63,7 +63,7 @@ void moveSceneItemsBottom(std::vector<obs_scene_item *> &items)
}
}
void moveSceneItemsPos(std::vector<obs_scene_item *> &items, int pos)
static void moveSceneItemsPos(std::vector<obs_scene_item *> &items, int pos)
{
for (auto &i : items) {
obs_sceneitem_set_order_position(i, pos);

View File

@@ -11,7 +11,7 @@ bool MacroActionSequence::_registered = MacroActionFactory::Register(
{MacroActionSequence::Create, MacroActionSequenceEdit::Create,
"AdvSceneSwitcher.action.sequence"});
int getNextUnpausedMacroIdx(std::vector<MacroRef> &macros, int startIdx)
static int getNextUnpausedMacroIdx(std::vector<MacroRef> &macros, int startIdx)
{
for (; (int)macros.size() > startIdx; ++startIdx) {
auto macro = macros[startIdx].GetMacro();

View File

@@ -53,8 +53,8 @@ void MacroActionTransition::SetTransitionOverride()
#if (LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(27, 0, 0)) && \
(LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(28, 0, 0))
void obs_sceneitem_set_transition(obs_sceneitem_t *item, bool show,
obs_source_t *transition)
static void obs_sceneitem_set_transition(obs_sceneitem_t *item, bool show,
obs_source_t *transition)
{
if (show) {
obs_sceneitem_set_show_transition(item, transition);
@@ -63,8 +63,9 @@ void obs_sceneitem_set_transition(obs_sceneitem_t *item, bool show,
}
}
void obs_sceneitem_set_transition_duration(obs_sceneitem_t *item, bool show,
uint32_t duration_ms)
static void obs_sceneitem_set_transition_duration(obs_sceneitem_t *item,
bool show,
uint32_t duration_ms)
{
if (show) {
obs_sceneitem_set_show_transition_duration(item, duration_ms);

View File

@@ -596,7 +596,7 @@ void MacroConditionMediaEdit::SetWidgetVisibility()
}
}
int getIdxFromMediaState(MacroConditionMedia::State state)
static int getIdxFromMediaState(MacroConditionMedia::State state)
{
if (state < MacroConditionMedia::State::LAST_OBS_MEDIA_STATE) {
return static_cast<int>(state);

View File

@@ -43,7 +43,7 @@ static bool getSceneItemPositionHelper(obs_scene_t *, obs_sceneitem_t *item,
return true;
}
PosInfo2 getSceneItemPos(obs_scene_item *item, obs_scene *scene)
static PosInfo2 getSceneItemPos(obs_scene_item *item, obs_scene *scene)
{
PosInfo2 pos{item};
obs_scene_enum_items(scene, getSceneItemPositionHelper, &pos);

View File

@@ -24,7 +24,7 @@ static std::map<MacroConditionSceneVisibility::Condition, std::string>
"AdvSceneSwitcher.condition.sceneVisibility.type.changed"},
};
bool areAllSceneItemsShown(const std::vector<obs_scene_item *> &items)
static bool areAllSceneItemsShown(const std::vector<obs_scene_item *> &items)
{
bool ret = true;
for (auto item : items) {
@@ -36,7 +36,7 @@ bool areAllSceneItemsShown(const std::vector<obs_scene_item *> &items)
return ret;
}
bool areAllSceneItemsHidden(const std::vector<obs_scene_item *> &items)
static bool areAllSceneItemsHidden(const std::vector<obs_scene_item *> &items)
{
bool ret = true;
for (auto item : items) {
@@ -48,9 +48,9 @@ bool areAllSceneItemsHidden(const std::vector<obs_scene_item *> &items)
return ret;
}
bool didVisibilityOfAnySceneItemsChange(
const std::vector<obs_scene_item *> &items,
std::vector<bool> &previousVisibility)
static bool
didVisibilityOfAnySceneItemsChange(const std::vector<obs_scene_item *> &items,
std::vector<bool> &previousVisibility)
{
std::vector<bool> currentVisibility;
for (const auto &item : items) {

View File

@@ -26,7 +26,7 @@ static std::map<TransitionCondition, std::string> filterConditionTypes = {
"AdvSceneSwitcher.condition.transition.type.transitionTarget"},
};
bool isCurrentTransition(OBSWeakSource &t)
static bool isCurrentTransition(OBSWeakSource &t)
{
bool match;
auto tSource = obs_frontend_get_current_transition();
@@ -37,7 +37,7 @@ bool isCurrentTransition(OBSWeakSource &t)
return match;
}
bool isTargetScene(OBSWeakSource &target)
static bool isTargetScene(OBSWeakSource &target)
{
auto source = obs_frontend_get_current_scene();
auto targetScene = obs_source_get_weak_source(source);

View File

@@ -51,7 +51,7 @@ bool MacroConditionWindow::CheckWindowTitleSwitchRegex(
return match;
}
bool foregroundWindowChanged()
static bool foregroundWindowChanged()
{
return switcher->currentTitle != switcher->lastTitle;
}

View File

@@ -237,14 +237,14 @@ void MacroSegmentList::HideLastDropLine()
_dropLineIdx = -1;
}
bool isInUpperHalfOf(const QPoint &pos, const QRect &rect)
static bool isInUpperHalfOf(const QPoint &pos, const QRect &rect)
{
return QRect(rect.topLeft(),
QSize(rect.size().width(), rect.size().height() / 2))
.contains(pos);
}
bool widgetIsInLayout(QWidget *w, QLayout *l)
static bool widgetIsInLayout(QWidget *w, QLayout *l)
{
if (w == nullptr) {
return false;

View File

@@ -18,7 +18,7 @@ namespace advss {
static QMetaObject::Connection addPulse;
static QTimer onChangeHighlightTimer;
bool macroNameExists(std::string name)
static bool macroNameExists(std::string name)
{
return !!GetMacroByName(name.c_str());
}
@@ -806,7 +806,7 @@ void AdvSceneSwitcher::DeleteMacroSegementHotkey()
}
}
void fade(QWidget *widget, bool fadeOut)
static void fade(QWidget *widget, bool fadeOut)
{
const double fadeOutOpacity = 0.3;
// Don't use exactly 1.0 as for some reason this causes buttons in

View File

@@ -753,9 +753,9 @@ static void togglePauseCB(void *data, obs_hotkey_id, obs_hotkey_t *,
static int macroHotkeyID = 0;
obs_hotkey_id registerHotkeyHelper(const std::string prefix,
const char *formatModuleText, Macro *macro,
obs_hotkey_func func)
static obs_hotkey_id registerHotkeyHelper(const std::string prefix,
const char *formatModuleText,
Macro *macro, obs_hotkey_func func)
{
macroHotkeyID++;

View File

@@ -58,12 +58,12 @@ bool ObjDetectParameters::Save(obs_data_t *obj) const
return true;
}
bool isScaleFactorValid(double scaleFactor)
static bool isScaleFactorValid(double scaleFactor)
{
return scaleFactor > 1.;
}
bool isMinNeighborsValid(int minNeighbors)
static bool isMinNeighborsValid(int minNeighbors)
{
return minNeighbors >= minMinNeighbors &&
minNeighbors <= maxMinNeighbors;

View File

@@ -217,7 +217,8 @@ void PreviewDialog::DrawFrame()
_rubberBand->show();
}
void markPatterns(cv::Mat &matchResult, QImage &image, const cv::Mat &pattern)
static void markPatterns(cv::Mat &matchResult, QImage &image,
const cv::Mat &pattern)
{
auto matchImg = QImageToMat(image);
for (int row = 0; row < matchResult.rows - 1; row++) {
@@ -232,7 +233,7 @@ void markPatterns(cv::Mat &matchResult, QImage &image, const cv::Mat &pattern)
}
}
void markObjects(QImage &image, std::vector<cv::Rect> &objects)
static void markObjects(QImage &image, std::vector<cv::Rect> &objects)
{
auto frame = QImageToMat(image);
for (size_t i = 0; i < objects.size(); i++) {

View File

@@ -88,7 +88,7 @@ Connection::~Connection()
_client.Disconnect();
}
std::string GetUri(std::string addr, int port)
static std::string GetUri(std::string addr, int port)
{
return "ws://" + addr + ":" + std::to_string(port);
}
@@ -161,12 +161,12 @@ std::string GetWeakConnectionName(std::weak_ptr<Connection> connection)
return con->Name();
}
bool ConnectionNameAvailable(const QString &name)
static bool ConnectionNameAvailable(const QString &name)
{
return !GetConnectionByName(name);
}
bool ConnectionNameAvailable(const std::string &name)
static bool ConnectionNameAvailable(const std::string &name)
{
return ConnectionNameAvailable(QString::fromStdString(name));
}

View File

@@ -31,14 +31,14 @@ static Item *GetItemByName(const QString &name,
return GetItemByName(name.toStdString(), items);
}
bool ItemNameAvailable(const QString &name,
std::deque<std::shared_ptr<Item>> &items)
static bool ItemNameAvailable(const QString &name,
std::deque<std::shared_ptr<Item>> &items)
{
return !GetItemByName(name, items);
}
bool ItemNameAvailable(const std::string &name,
std::deque<std::shared_ptr<Item>> &items)
static bool ItemNameAvailable(const std::string &name,
std::deque<std::shared_ptr<Item>> &items)
{
return ItemNameAvailable(QString::fromStdString(name), items);
}

View File

@@ -95,8 +95,8 @@ static bool getSceneItems(obs_scene_t *, obs_sceneitem_t *item, void *ptr)
return true;
}
std::vector<obs_scene_item *> getSceneItemsWithName(obs_scene_t *scene,
std::string &name)
static std::vector<obs_scene_item *>
getSceneItemsWithName(obs_scene_t *scene, const std::string &name)
{
ItemInfo itemInfo = {name};
obs_scene_enum_items(scene, getSceneItems, &itemInfo);
@@ -123,9 +123,9 @@ static bool countSceneItem(obs_scene_t *, obs_sceneitem_t *item, void *ptr)
return true;
}
int getCountOfSceneItemOccurance(const SceneSelection &s,
const std::string &name,
bool enumAllScenes = true)
static int getCountOfSceneItemOccurance(const SceneSelection &s,
const std::string &name,
bool enumAllScenes = true)
{
ItemCountData data{name};
if (enumAllScenes && (s.GetType() != SceneSelection::Type::SCENE)) {
@@ -216,7 +216,7 @@ static bool enumSceneItem(obs_scene_t *, obs_sceneitem_t *item, void *ptr)
return true;
}
void populateSceneItemSelection(QComboBox *list)
static void populateSceneItemSelection(QComboBox *list)
{
QStringList names;
obs_scene_enum_items(nullptr, enumSceneItem, &names);

View File

@@ -86,7 +86,7 @@ void SceneSelection::Load(obs_data_t *obj, const char *name,
obs_data_release(data);
}
bool IsScene(const OBSWeakSource &source)
static bool IsScene(const OBSWeakSource &source)
{
auto s = obs_weak_source_get_source(source);
bool ret = !!obs_scene_from_source(s);

View File

@@ -34,7 +34,8 @@ void SendWebsocketEvent(const std::string &eventMsg)
obs_data_release(data);
}
void ReceiveWebsocketMessage(obs_data_t *request_data, obs_data_t *, void *)
static void receiveWebsocketMessage(obs_data_t *request_data, obs_data_t *,
void *)
{
if (!obs_data_has_user_value(request_data, "message")) {
vblog(LOG_INFO, "received unexpected m '%s'",
@@ -58,7 +59,7 @@ extern "C" void RegisterWebsocketVendor()
}
if (!obs_websocket_vendor_register_request(
vendor, VendorRequest, ReceiveWebsocketMessage, NULL))
vendor, VendorRequest, receiveWebsocketMessage, NULL))
blog(LOG_ERROR,
"Failed to register `AdvancedSceneSwitcherMessage` request with obs-websocket.");

View File

@@ -68,7 +68,7 @@ static bool WindowValid(HWND window)
return true;
}
BOOL CALLBACK GetTitleCB(HWND hwnd, LPARAM lParam)
static BOOL CALLBACK GetTitleCB(HWND hwnd, LPARAM lParam)
{
if (!WindowValid(hwnd)) {
return TRUE;
@@ -87,7 +87,8 @@ BOOL CALLBACK GetTitleCB(HWND hwnd, LPARAM lParam)
return TRUE;
}
VOID EnumWindowsWithMetro(__in WNDENUMPROC lpEnumFunc, __in LPARAM lParam)
static VOID EnumWindowsWithMetro(__in WNDENUMPROC lpEnumFunc,
__in LPARAM lParam)
{
HWND childWindow = NULL;
int i = 0;
@@ -138,7 +139,7 @@ void GetCurrentWindowTitle(std::string &title)
GetWindowTitle(window, title);
}
HWND getHWNDfromTitle(std::string title)
static HWND getHWNDfromTitle(std::string title)
{
HWND hwnd = NULL;
wchar_t wTitle[512];
@@ -241,7 +242,7 @@ void GetProcessList(QStringList &processes)
CloseHandle(procSnapshot);
}
void GetForegroundProcessName(QString &proc)
static void GetForegroundProcessName(QString &proc)
{
// only checks if the current foreground window is from the same executable,
// may return true for any window from a program
@@ -443,7 +444,7 @@ void PressKeys(const std::vector<HotkeyType> keys, int duration)
}
}
int getLastInputTime()
static int getLastInputTime()
{
LASTINPUTINFO lastInputInfo;
lastInputInfo.cbSize = sizeof(LASTINPUTINFO);
@@ -453,7 +454,7 @@ int getLastInputTime()
return 0;
}
int getTime()
static int getTime()
{
return GetTickCount();
}