mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
The "core" macro conditions and actions have been extracted out to the "base" plugin. The library now mostly contains functionality which is required across all plugins and (e.g. definitions for macro segments). The goal is to reduce the complexity and cross-dependencies and group the source files in a better way. This should relsove the "library limit of 65535 objects exceeded" build issue occuring in some Windows build environments.
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
/******************************************************************************
|
|
Note: Long-term goal is to remove this tab / file.
|
|
Most functionality shall be moved to the Macro tab instead.
|
|
|
|
So if you plan to make changes here, please consider applying them to the
|
|
corresponding macro tab functionality instead.
|
|
******************************************************************************/
|
|
#pragma once
|
|
#include <QTimeEdit>
|
|
|
|
#include "switch-generic.hpp"
|
|
|
|
namespace advss {
|
|
|
|
constexpr auto time_func = 7;
|
|
|
|
typedef enum {
|
|
ANY_DAY = 0,
|
|
MONDAY = 1,
|
|
TUSEDAY = 2,
|
|
WEDNESDAY = 3,
|
|
THURSDAY = 4,
|
|
FRIDAY = 5,
|
|
SATURDAY = 6,
|
|
SUNDAY = 7,
|
|
LIVE = 8
|
|
} timeTrigger;
|
|
|
|
struct TimeSwitch : SceneSwitcherEntry {
|
|
static bool pause;
|
|
timeTrigger trigger = ANY_DAY;
|
|
QTime time = QTime(0, 0);
|
|
|
|
const char *getType() { return "time"; }
|
|
void save(obs_data_t *obj);
|
|
void load(obs_data_t *obj);
|
|
};
|
|
|
|
class TimeSwitchWidget : public SwitchWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TimeSwitchWidget(QWidget *parent, TimeSwitch *s);
|
|
TimeSwitch *getSwitchData();
|
|
void setSwitchData(TimeSwitch *s);
|
|
|
|
static void swapSwitchData(TimeSwitchWidget *s1, TimeSwitchWidget *s2);
|
|
|
|
private slots:
|
|
void TriggerChanged(int index);
|
|
void TimeChanged(const QTime &time);
|
|
|
|
private:
|
|
QComboBox *triggers;
|
|
QTimeEdit *time;
|
|
|
|
TimeSwitch *switchData;
|
|
};
|
|
|
|
} // namespace advss
|