mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Add option to set and check list source settings by name
This makes it easier to select the intended settings value as the underlying value often has no direct connection to the user facing name. It also makes it possible to select list entries whos underlying value changes frequently, but the user facing value does not. (E.g. device IDs based on the input port compared to the device name)
This commit is contained in:
@@ -14,15 +14,18 @@ namespace advss {
|
||||
class SourceSetting {
|
||||
public:
|
||||
SourceSetting() = default;
|
||||
SourceSetting(const std::string &id, const std::string &description,
|
||||
SourceSetting(const std::string &id, obs_property_type type,
|
||||
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;
|
||||
bool IsList() const;
|
||||
bool operator==(const SourceSetting &other) const;
|
||||
|
||||
private:
|
||||
std::string _id = "";
|
||||
obs_property_type _type = OBS_PROPERTY_INVALID;
|
||||
std::string _description = "";
|
||||
std::string _longDescription = "";
|
||||
|
||||
@@ -32,8 +35,14 @@ private:
|
||||
std::vector<SourceSetting> GetSoruceSettings(obs_source_t *source);
|
||||
std::optional<std::string> GetSourceSettingValue(const OBSWeakSource &source,
|
||||
const SourceSetting &setting);
|
||||
std::optional<std::string>
|
||||
GetSourceSettingListEntryName(const OBSWeakSource &source,
|
||||
const SourceSetting &setting);
|
||||
void SetSourceSetting(obs_source_t *source, const SourceSetting &setting,
|
||||
const std::string &value);
|
||||
void SetSourceSettingListEntryValueByName(obs_source_t *source,
|
||||
const SourceSetting &setting,
|
||||
const std::string &name);
|
||||
|
||||
class SourceSettingSelection : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user