mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 00:05:41 -05:00
Restructure "src/" folder
Moving files from the "src/" folder into "src/legacy", "src/macro-core", and "src/utils" was necessary as it was becoming a bit too cluttered.
This commit is contained in:
46
src/utils/transition-selection.hpp
Normal file
46
src/utils/transition-selection.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
enum class TransitionSelectionType {
|
||||
TRANSITION,
|
||||
CURRENT,
|
||||
ANY,
|
||||
};
|
||||
|
||||
class TransitionSelection {
|
||||
public:
|
||||
void Save(obs_data_t *obj, const char *name = "transition",
|
||||
const char *typeName = "transitionType");
|
||||
void Load(obs_data_t *obj, const char *name = "transition",
|
||||
const char *typeName = "transitionType");
|
||||
|
||||
TransitionSelectionType GetType() { return _type; }
|
||||
OBSWeakSource GetTransition();
|
||||
std::string ToString();
|
||||
|
||||
private:
|
||||
OBSWeakSource _transition;
|
||||
TransitionSelectionType _type = TransitionSelectionType::TRANSITION;
|
||||
friend class TransitionSelectionWidget;
|
||||
};
|
||||
|
||||
class TransitionSelectionWidget : public QComboBox {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TransitionSelectionWidget(QWidget *parent, bool current = true,
|
||||
bool any = false);
|
||||
void SetTransition(TransitionSelection &);
|
||||
void Repopulate(bool current, bool any);
|
||||
signals:
|
||||
void TransitionChanged(const TransitionSelection &);
|
||||
|
||||
private slots:
|
||||
void SelectionChanged(const QString &name);
|
||||
|
||||
private:
|
||||
bool IsCurrentTransitionSelected(const QString &name);
|
||||
bool IsAnyTransitionSelected(const QString &name);
|
||||
};
|
||||
Reference in New Issue
Block a user