Add option to automatically start scene switcher on recording / streaming start (#112)

This commit is contained in:
WarmUpTill
2021-02-03 20:02:07 +01:00
committed by GitHub
parent 35151ea134
commit a5f0eb8da8
8 changed files with 122 additions and 57 deletions

View File

@@ -100,6 +100,7 @@ public slots:
void on_noMatchDelay_valueChanged(double i);
void on_cooldownTime_valueChanged(double i);
void on_startupBehavior_currentIndexChanged(int index);
void on_autoStartEvent_currentIndexChanged(int index);
void on_noMatchSwitchScene_currentTextChanged(const QString &text);
void on_checkInterval_valueChanged(int value);
void on_toggleStartButton_clicked();

View File

@@ -28,6 +28,13 @@ constexpr auto previous_scene_name = "Previous Scene";
typedef enum { NO_SWITCH = 0, SWITCH = 1, RANDOM_SWITCH = 2 } NoMatch;
typedef enum { PERSIST = 0, START = 1, STOP = 2 } StartupBehavior;
enum class AutoStartEvent {
NEVER,
RECORDING,
STREAMING,
RECORINDG_OR_STREAMING,
};
typedef struct transitionData {
std::string name = "";
int duration = 0;
@@ -64,6 +71,7 @@ struct SwitcherData {
double noMatchDelay;
double noMatchCount = 0;
StartupBehavior startupBehavior = PERSIST;
AutoStartEvent autoStartEvent = AutoStartEvent::NEVER;
double cooldown = 0.;
std::chrono::high_resolution_clock::time_point lastMatchTime;