File: source-properties-button.hpp

package info (click to toggle)
obs-advanced-scene-switcher 1.32.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,492 kB
  • sloc: xml: 297,593; cpp: 147,875; python: 387; sh: 280; ansic: 170; makefile: 33
file content (45 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "filter-combo-box.hpp"

#include <obs.hpp>
#include <qmetatype.h>
#include <string>
#include <vector>

namespace advss {

class SourceSelection;
class FilterSelection;

struct SourceSettingButton {
	bool Save(obs_data_t *obj) const;
	bool Load(obs_data_t *obj);
	std::string ToString() const;

	std::string id = "";
	std::string description = "";
};

std::vector<SourceSettingButton> GetSourceButtons(OBSWeakSource source);
void PressSourceButton(const SourceSettingButton &button, obs_source_t *source);

class SourceSettingsButtonSelection : public FilterComboBox {
	Q_OBJECT

public:
	SourceSettingsButtonSelection(QWidget *parent = nullptr);
	void SetSource(const OBSWeakSource &source,
		       bool restorePreviousSelection = true);
	void SetSelection(const OBSWeakSource &source,
			  const SourceSettingButton &button);

signals:
	void SelectionChanged(const SourceSettingButton &);

private:
	void PopulateSelection(const OBSWeakSource &source);
};

} // namespace advss

Q_DECLARE_METATYPE(advss::SourceSettingButton);