mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-30 13:55:31 -05:00
* rework general tab UI * rework audio tab UI * rework media tab UI * rework time tab UI * rework random tab UI * rework window tab UI * rework sreen region tab UI * rework sequence tab UI * rework transition tab UI * adjust log messages to new format * fix include path and warning * highlight widgets to guide users (can be disabled) * add helper frame for screen region tab * rename main SceneSwitcher widget to AdvSceneSwitcher to resolve naming conflicts with the frontend tools on certain platforms (e.g. Debian 10) * add media state 'any' * adjust media switch handling to support vlc source
65 lines
1.4 KiB
C++
65 lines
1.4 KiB
C++
#pragma once
|
|
#include "switch-generic.hpp"
|
|
|
|
constexpr auto round_trip_func = 1;
|
|
constexpr auto default_priority_1 = round_trip_func;
|
|
|
|
typedef enum {
|
|
SECONDS,
|
|
MINUTES,
|
|
HOURS,
|
|
} delay_units;
|
|
|
|
struct SceneSequenceSwitch : SceneSwitcherEntry {
|
|
OBSWeakSource startScene = nullptr;
|
|
double delay = 0;
|
|
int delayMultiplier = 1;
|
|
|
|
const char *getType() { return "sequence"; }
|
|
bool initialized();
|
|
bool valid();
|
|
void logSleep(int dur);
|
|
|
|
inline SceneSequenceSwitch(){};
|
|
inline SceneSequenceSwitch(OBSWeakSource startScene_,
|
|
OBSWeakSource scene_,
|
|
OBSWeakSource transition_, double delay_,
|
|
int delayMultiplier_, bool usePreviousScene_)
|
|
: SceneSwitcherEntry(scene_, transition_, usePreviousScene_),
|
|
startScene(startScene_),
|
|
delay(delay_),
|
|
delayMultiplier(delayMultiplier_)
|
|
{
|
|
}
|
|
};
|
|
|
|
class SequenceWidget : public SwitchWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SequenceWidget(SceneSequenceSwitch *s);
|
|
SceneSequenceSwitch *getSwitchData();
|
|
void setSwitchData(SceneSequenceSwitch *s);
|
|
|
|
static void swapSwitchData(SequenceWidget *s1, SequenceWidget *s2);
|
|
|
|
void UpdateDelay();
|
|
|
|
private slots:
|
|
void DelayChanged(double delay);
|
|
void DelayUnitsChanged(int idx);
|
|
void StartSceneChanged(const QString &text);
|
|
|
|
private:
|
|
QDoubleSpinBox *delay;
|
|
QComboBox *delayUnits;
|
|
QComboBox *startScenes;
|
|
|
|
QLabel *whenLabel;
|
|
QLabel *switchLabel;
|
|
QLabel *afterLabel;
|
|
QLabel *usingLabel;
|
|
|
|
SceneSequenceSwitch *switchData;
|
|
};
|