mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-22 09:15:57 -05:00
Cleanup
* Fix warnings * Remove unused includes * Fix build issue if libremidi CMakeLists.txt does not exist
This commit is contained in:
@@ -1,13 +1,3 @@
|
||||
#include <QMainWindow>
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
#include <QDirIterator>
|
||||
#include <regex>
|
||||
#include <filesystem>
|
||||
|
||||
#include <obs-module.h>
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "switcher-data.hpp"
|
||||
#include "status-control.hpp"
|
||||
@@ -17,6 +7,15 @@
|
||||
#include "utility.hpp"
|
||||
#include "version.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
#include <QDirIterator>
|
||||
#include <regex>
|
||||
#include <filesystem>
|
||||
#include <obs-module.h>
|
||||
#include <obs-frontend-api.h>
|
||||
|
||||
namespace advss {
|
||||
|
||||
AdvSceneSwitcher *AdvSceneSwitcher::window = nullptr;
|
||||
@@ -328,6 +327,8 @@ void SwitcherData::SetPreconditions()
|
||||
lastCursorPos = GetCursorPos();
|
||||
}
|
||||
|
||||
void ClearWebsocketMessages();
|
||||
|
||||
void SwitcherData::ResetForNextInterval()
|
||||
{
|
||||
// Core reset functions
|
||||
|
||||
@@ -332,7 +332,7 @@ bool IsFullscreen(const std::string &title)
|
||||
return windowStatesAreSet(title, states);
|
||||
}
|
||||
|
||||
std::optional<std::string> GetTextInWindow(const std::string &window)
|
||||
std::optional<std::string> GetTextInWindow(const std::string &)
|
||||
{
|
||||
// Not implemented
|
||||
return {};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "platform-funcs.hpp"
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <thread>
|
||||
#include <obs-interaction.h>
|
||||
|
||||
namespace advss {
|
||||
@@ -723,7 +724,7 @@ static QString getHotkeyDescriptionByName(const std::string &name)
|
||||
QString description = "";
|
||||
} params;
|
||||
|
||||
auto func = [](void *param, obs_hotkey_id id, obs_hotkey_t *hotkey) {
|
||||
auto func = [](void *param, obs_hotkey_id, obs_hotkey_t *hotkey) {
|
||||
auto params = static_cast<Parameters *>(param);
|
||||
std::string name = obs_hotkey_get_name(hotkey);
|
||||
addNamePrefix(name, hotkey);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "process-config.hpp"
|
||||
#include "duration-control.hpp"
|
||||
|
||||
#include <thread>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
|
||||
|
||||
@@ -200,9 +200,9 @@ MacroConditionSlideshowEdit::MacroConditionSlideshowEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroConditionSlideshow> entryData)
|
||||
: QWidget(parent),
|
||||
_conditions(new QComboBox(this)),
|
||||
_sources(new SourceSelectionWidget(this, QStringList(), true)),
|
||||
_index(new VariableSpinBox(this)),
|
||||
_path(new VariableLineEdit(this))
|
||||
_path(new VariableLineEdit(this)),
|
||||
_sources(new SourceSelectionWidget(this, QStringList(), true))
|
||||
{
|
||||
setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.slideshow.updateIntervalTooltip"));
|
||||
|
||||
@@ -731,9 +731,8 @@ void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.export"), this,
|
||||
&AdvSceneSwitcher::ExportMacros);
|
||||
exportAction->setDisabled(ui->macros->SelectionEmpty());
|
||||
auto import = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.import"), this,
|
||||
&AdvSceneSwitcher::ImportMacros);
|
||||
menu.addAction(obs_module_text("AdvSceneSwitcher.macroTab.import"),
|
||||
this, &AdvSceneSwitcher::ImportMacros);
|
||||
|
||||
menu.exec(globalPos);
|
||||
}
|
||||
|
||||
@@ -609,7 +609,7 @@ bool MacroTreeModel::IsLastItem(std::shared_ptr<Macro> item) const
|
||||
bool MacroTreeModel::IsInValidState()
|
||||
{
|
||||
// Check for reordering erros
|
||||
for (int i = 0, j = 0; i < _macros.size(); i++) {
|
||||
for (size_t i = 0, j = 0; i < _macros.size(); i++) {
|
||||
const auto &m = _macros[i];
|
||||
if (QString::fromStdString(m->Name()) !=
|
||||
data(index(j, 0), Qt::AccessibleTextRole)) {
|
||||
@@ -622,7 +622,7 @@ bool MacroTreeModel::IsInValidState()
|
||||
}
|
||||
|
||||
// Check for group errors
|
||||
for (int i = 0; i < _macros.size(); i++) {
|
||||
for (size_t i = 0; i < _macros.size(); i++) {
|
||||
const auto &m = _macros[i];
|
||||
if (!m->IsGroup()) {
|
||||
continue;
|
||||
|
||||
@@ -5,7 +5,7 @@ project(advanced-scene-switcher-midi)
|
||||
|
||||
get_target_property(ADVSS_SOURCE_DIR advanced-scene-switcher-lib SOURCE_DIR)
|
||||
set(LIBREMIDI_DIR "${ADVSS_SOURCE_DIR}/deps/libremidi")
|
||||
if(NOT EXISTS "${LIBREMIDI_DIR}")
|
||||
if(NOT EXISTS "${LIBREMIDI_DIR}/CMakeLists.txt")
|
||||
message(WARNING "libremidi directory \"${LIBREMIDI_DIR}\" not found!\n"
|
||||
"MIDI support will be disabled!")
|
||||
return()
|
||||
|
||||
@@ -4,16 +4,10 @@
|
||||
#include <QPushButton>
|
||||
#include <QDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QLabel>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QSpinBox>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
#include <deque>
|
||||
#include <obs.hpp>
|
||||
#include <websocket-helpers.hpp>
|
||||
#include <obs-data.h>
|
||||
|
||||
namespace advss {
|
||||
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
#include <string.h>
|
||||
#include <QGroupBox>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
namespace advss {
|
||||
|
||||
std::unordered_map<size_t, OSCMessageElement::TypeInfo>
|
||||
@@ -360,7 +366,7 @@ OSCMessageElementEdit::OSCMessageElementEdit(QWidget *parent)
|
||||
_text->hide();
|
||||
_binaryText->hide();
|
||||
|
||||
for (int i = 0; i < OSCMessageElement::_typeNames.size() - 1; i++) {
|
||||
for (size_t i = 0; i < OSCMessageElement::_typeNames.size() - 1; i++) {
|
||||
_type->addItem(obs_module_text(
|
||||
OSCMessageElement::_typeNames.at(i).localizedName));
|
||||
}
|
||||
|
||||
@@ -367,7 +367,6 @@ std::vector<OBSSceneItem> SceneItemSelection::GetSceneItemsByName(
|
||||
} else {
|
||||
name = GetWeakSourceName(_source);
|
||||
}
|
||||
int count = getCountOfSceneItemOccurance(sceneSelection, name, false);
|
||||
auto items = getSceneItemsWithName(scene, name);
|
||||
ReduceBadedOnIndexSelection(items);
|
||||
return items;
|
||||
@@ -754,6 +753,10 @@ void SceneItemSelectionWidget::SetNameConflictVisibility()
|
||||
sceneItemCount =
|
||||
getTotalSceneItemCountOnScene(_scene.GetScene(false));
|
||||
break;
|
||||
case SceneItemSelection::Type::INDEX:
|
||||
case SceneItemSelection::Type::INDEX_RANGE:
|
||||
case SceneItemSelection::Type::ALL:
|
||||
break;
|
||||
}
|
||||
|
||||
if (_currentSelection._type ==
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <QLayout>
|
||||
#include <QTimer>
|
||||
|
||||
namespace advss {
|
||||
|
||||
|
||||
@@ -605,11 +605,11 @@ bool IsValidMacroSegmentIndex(Macro *m, const int idx, bool isCondition)
|
||||
return false;
|
||||
}
|
||||
if (isCondition) {
|
||||
if (idx >= m->Conditions().size()) {
|
||||
if (idx >= (int)m->Conditions().size()) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (idx >= m->Actions().size()) {
|
||||
if (idx >= (int)m->Actions().size()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user