mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
The "core" macro conditions and actions have been extracted out to the "base" plugin. The library now mostly contains functionality which is required across all plugins and (e.g. definitions for macro segments). The goal is to reduce the complexity and cross-dependencies and group the source files in a better way. This should relsove the "library limit of 65535 objects exceeded" build issue occuring in some Windows build environments.
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
#pragma once
|
|
#include "filter-combo-box.hpp"
|
|
|
|
#include <obs.hpp>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <QWidget>
|
|
#include <QLabel>
|
|
|
|
namespace advss {
|
|
|
|
class SourceSetting {
|
|
public:
|
|
SourceSetting() = default;
|
|
SourceSetting(const std::string &id, const std::string &description,
|
|
const std::string &longDescription = "");
|
|
bool Save(obs_data_t *obj) const;
|
|
bool Load(obs_data_t *obj);
|
|
std::string GetID() const { return _id; }
|
|
EXPORT bool operator==(const SourceSetting &other) const;
|
|
|
|
private:
|
|
std::string _id = "";
|
|
std::string _description = "";
|
|
std::string _longDescription = "";
|
|
|
|
friend class SourceSettingSelection;
|
|
};
|
|
|
|
std::vector<SourceSetting> GetSoruceSettings(obs_source_t *source);
|
|
std::string GetSourceSettingValue(const OBSWeakSource &source,
|
|
const SourceSetting &setting);
|
|
void SetSourceSetting(obs_source_t *source, const SourceSetting &setting,
|
|
const std::string &value);
|
|
|
|
class SourceSettingSelection : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SourceSettingSelection(QWidget *parent = nullptr);
|
|
void SetSource(const OBSWeakSource &);
|
|
void SetSetting(const SourceSetting &);
|
|
|
|
private slots:
|
|
void SelectionIdxChanged(int);
|
|
|
|
signals:
|
|
void SelectionChanged(const SourceSetting &);
|
|
|
|
private:
|
|
void Populate(const OBSWeakSource &);
|
|
|
|
FilterComboBox *_settings;
|
|
QLabel *_tooltip;
|
|
};
|
|
|
|
} // namespace advss
|