mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-09 06:26:26 -05:00
Style changes in utility.hpp
This commit is contained in:
parent
20a934c9ab
commit
0138b412b4
|
|
@ -323,10 +323,10 @@ void SwitcherData::setPreconditions()
|
|||
GetForegroundProcessName(currentForegroundProcess);
|
||||
|
||||
// Cursor
|
||||
std::pair<int, int> cursorPos = getCursorPos();
|
||||
std::pair<int, int> cursorPos = GetCursorPos();
|
||||
cursorPosChanged = cursorPos.first != switcher->lastCursorPos.first ||
|
||||
cursorPos.second != switcher->lastCursorPos.second;
|
||||
lastCursorPos = getCursorPos();
|
||||
lastCursorPos = GetCursorPos();
|
||||
}
|
||||
|
||||
void SwitcherData::resetForNextInterval()
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ void AdvSceneSwitcher::SetCurrentTab()
|
|||
|
||||
void AdvSceneSwitcher::RestoreWindowGeo()
|
||||
{
|
||||
if (switcher->saveWindowGeo && windowPosValid(switcher->windowPos)) {
|
||||
if (switcher->saveWindowGeo && WindowPosValid(switcher->windowPos)) {
|
||||
this->resize(switcher->windowSize);
|
||||
this->move(switcher->windowPos);
|
||||
}
|
||||
|
|
@ -886,7 +886,7 @@ void populateAutoStartEventSelection(QComboBox *cb)
|
|||
|
||||
void AdvSceneSwitcher::SetupGeneralTab()
|
||||
{
|
||||
populateSceneSelection(ui->noMatchSwitchScene, false);
|
||||
PopulateSceneSelection(ui->noMatchSwitchScene, false);
|
||||
|
||||
if (switcher->switchIfNotMatching == SWITCH) {
|
||||
ui->noMatchSwitch->setChecked(true);
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ void SwitcherData::loadSceneGroups(obs_data_t *obj)
|
|||
|
||||
void AdvSceneSwitcher::SetupSceneGroupTab()
|
||||
{
|
||||
populateSceneSelection(ui->sceneGroupSceneSelection);
|
||||
PopulateSceneSelection(ui->sceneGroupSceneSelection);
|
||||
|
||||
for (auto &sg : switcher->sceneGroups) {
|
||||
QString text = QString::fromStdString(sg.name);
|
||||
|
|
@ -540,7 +540,7 @@ SceneGroupEditWidget::SceneGroupEditWidget()
|
|||
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{type}}", type}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.sceneGroupTab.edit.type"),
|
||||
typeLayout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -557,7 +557,7 @@ SceneGroupEditWidget::SceneGroupEditWidget()
|
|||
countLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
widgetPlaceholders = {{"{{count}}", count}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.sceneGroupTab.edit.count"),
|
||||
countLayout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -575,7 +575,7 @@ SceneGroupEditWidget::SceneGroupEditWidget()
|
|||
timeLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
widgetPlaceholders = {{"{{time}}", time}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.sceneGroupTab.edit.time"),
|
||||
timeLayout, widgetPlaceholders);
|
||||
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ void SceneTrigger::load(obs_data_t *obj)
|
|||
|
||||
static inline void populateTriggers(QComboBox *list)
|
||||
{
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
list,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerType.none"));
|
||||
|
|
@ -415,7 +415,7 @@ static inline void populateTriggers(QComboBox *list)
|
|||
|
||||
inline void populateActions(QComboBox *list)
|
||||
{
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
list,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.sceneTriggerTab.sceneTriggerAction.none"));
|
||||
|
|
@ -470,7 +470,7 @@ SceneTriggerWidget::SceneTriggerWidget(QWidget *parent, SceneTrigger *s)
|
|||
|
||||
populateTriggers(triggers);
|
||||
populateActions(actions);
|
||||
populateAudioSelection(audioSources);
|
||||
PopulateAudioSelection(audioSources);
|
||||
|
||||
if (s) {
|
||||
triggers->setCurrentIndex(static_cast<int>(s->triggerType));
|
||||
|
|
@ -494,7 +494,7 @@ SceneTriggerWidget::SceneTriggerWidget(QWidget *parent, SceneTrigger *s)
|
|||
{"{{audioSources}}", audioSources},
|
||||
{"{{duration}}", duration},
|
||||
{"{{scenes}}", scenes}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.sceneTriggerTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.sceneTriggerTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ AudioSwitchWidget::AudioSwitchWidget(QWidget *parent, AudioSwitch *s)
|
|||
QWidget::connect(ignoreInactiveSource, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(IgnoreInactiveChanged(int)));
|
||||
|
||||
populateAudioSelection(audioSources);
|
||||
PopulateAudioSelection(audioSources);
|
||||
populateConditionSelection(condition);
|
||||
|
||||
if (s) {
|
||||
|
|
@ -469,7 +469,7 @@ AudioSwitchWidget::AudioSwitchWidget(QWidget *parent, AudioSwitch *s)
|
|||
{"{{ignoreInactiveSource}}", ignoreInactiveSource},
|
||||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.audioTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.audioTab.entry"),
|
||||
switchLayout, widgetPlaceholders);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
@ -594,7 +594,7 @@ AudioSwitchFallbackWidget::AudioSwitchFallbackWidget(QWidget *parent,
|
|||
{"{{scenes}}", scenes},
|
||||
{"{{duration}}", duration},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.audioTab.multiMatchfallback"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ ExecutableSwitchWidget::ExecutableSwitchWidget(QWidget *parent,
|
|||
QWidget::connect(requiresFocus, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(FocusChanged(int)));
|
||||
|
||||
populateProcessSelection(processes);
|
||||
PopulateProcessSelection(processes);
|
||||
|
||||
processes->setEditable(true);
|
||||
processes->setMaxVisibleItems(20);
|
||||
|
|
@ -227,7 +227,7 @@ ExecutableSwitchWidget::ExecutableSwitchWidget(QWidget *parent,
|
|||
{"{{requiresFocus}}", requiresFocus},
|
||||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.executableTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.executableTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ bool matchFileContent(QString &filedata, FileSwitch &s)
|
|||
}
|
||||
|
||||
QString text = QString::fromStdString(s.text);
|
||||
return compareIgnoringLineEnding(text, filedata);
|
||||
return CompareIgnoringLineEnding(text, filedata);
|
||||
}
|
||||
|
||||
bool checkRemoteFileContent(FileSwitch &s)
|
||||
|
|
@ -544,11 +544,11 @@ FileSwitchWidget::FileSwitchWidget(QWidget *parent, FileSwitch *s)
|
|||
QHBoxLayout *line1Layout = new QHBoxLayout;
|
||||
QHBoxLayout *line2Layout = new QHBoxLayout;
|
||||
QHBoxLayout *line3Layout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.fileTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.fileTab.entry"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.fileTab.entry2"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.fileTab.entry2"),
|
||||
line2Layout, widgetPlaceholders, false);
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.fileTab.entry3"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.fileTab.entry3"),
|
||||
line3Layout, widgetPlaceholders);
|
||||
mainLayout->addLayout(line1Layout);
|
||||
mainLayout->addLayout(line2Layout);
|
||||
|
|
|
|||
|
|
@ -210,9 +210,9 @@ SwitchWidget::SwitchWidget(QWidget *parent, SceneSwitcherEntry *s,
|
|||
SIGNAL(SceneGroupRenamed(const QString &, const QString &)),
|
||||
this, SLOT(SceneGroupRename(const QString &, const QString &)));
|
||||
|
||||
populateSceneSelection(scenes, usePreviousScene, false, false,
|
||||
PopulateSceneSelection(scenes, usePreviousScene, false, false,
|
||||
addSceneGroup, &switcher->sceneGroups);
|
||||
populateTransitionSelection(transitions, addCurrentTransition);
|
||||
PopulateTransitionSelection(transitions, addCurrentTransition);
|
||||
|
||||
switchData = s;
|
||||
showSwitchData();
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ void SwitcherData::loadIdleSwitches(obs_data_t *obj)
|
|||
|
||||
void AdvSceneSwitcher::SetupIdleTab()
|
||||
{
|
||||
populateWindowSelection(ui->ignoreIdleWindowsWindows);
|
||||
PopulateWindowSelection(ui->ignoreIdleWindowsWindows);
|
||||
|
||||
for (auto &window : switcher->ignoreIdleWindows) {
|
||||
QString text = QString::fromStdString(window);
|
||||
|
|
@ -270,7 +270,7 @@ IdleWidget::IdleWidget(QWidget *parent, IdleData *s)
|
|||
{"{{duration}}", duration},
|
||||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.idleTab.idleswitch"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.idleTab.idleswitch"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ MediaSwitchWidget::MediaSwitchWidget(QWidget *parent, MediaSwitch *s)
|
|||
QWidget::connect(time, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(TimeChanged(int)));
|
||||
|
||||
populateMediaSelection(mediaSources);
|
||||
PopulateMediaSelection(mediaSources);
|
||||
populateMediaStates(states);
|
||||
populateTimeRestrictions(timeRestrictions);
|
||||
|
||||
|
|
@ -485,7 +485,7 @@ MediaSwitchWidget::MediaSwitchWidget(QWidget *parent, MediaSwitch *s)
|
|||
{"{{time}}", time},
|
||||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.mediaTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.mediaTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ PauseEntryWidget::PauseEntryWidget(QWidget *parent, PauseEntry *s)
|
|||
|
||||
populatePauseTypes(pauseTypes);
|
||||
populatePauseTargets(pauseTargets);
|
||||
populateWindowSelection(windows);
|
||||
PopulateWindowSelection(windows);
|
||||
|
||||
windows->setEditable(true);
|
||||
windows->setMaxVisibleItems(20);
|
||||
|
|
@ -337,7 +337,7 @@ PauseEntryWidget::PauseEntryWidget(QWidget *parent, PauseEntry *s)
|
|||
{"{{pauseTargets}}", pauseTargets},
|
||||
{"{{windows}}", windows}};
|
||||
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.pauseTab.pauseEntry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.pauseTab.pauseEntry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ RandomSwitchWidget::RandomSwitchWidget(QWidget *parent, RandomSwitch *s)
|
|||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions},
|
||||
{"{{delay}}", delay}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.randomTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.randomTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ bool SwitcherData::checkScreenRegionSwitch(OBSWeakSource &scene,
|
|||
return false;
|
||||
}
|
||||
|
||||
std::pair<int, int> cursorPos = getCursorPos();
|
||||
std::pair<int, int> cursorPos = GetCursorPos();
|
||||
int minRegionSize = 99999;
|
||||
bool match = false;
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ bool SwitcherData::checkScreenRegionSwitch(OBSWeakSource &scene,
|
|||
|
||||
void AdvSceneSwitcher::updateScreenRegionCursorPos()
|
||||
{
|
||||
std::pair<int, int> position = getCursorPos();
|
||||
std::pair<int, int> position = GetCursorPos();
|
||||
ui->cursorXPosition->setText(QString::number(position.first));
|
||||
ui->cursorYPosition->setText(QString::number(position.second));
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ ScreenRegionWidget::ScreenRegionWidget(QWidget *parent, ScreenRegionSwitch *s)
|
|||
QWidget::connect(maxY, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(MaxYChanged(int)));
|
||||
|
||||
populateSceneSelection(
|
||||
PopulateSceneSelection(
|
||||
excludeScenes, false, false, false, false, nullptr, true,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.screenRegionTab.excludeScenes.None"),
|
||||
|
|
@ -344,7 +344,7 @@ ScreenRegionWidget::ScreenRegionWidget(QWidget *parent, ScreenRegionSwitch *s)
|
|||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions},
|
||||
{"{{excludeScenes}}", excludeScenes}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.screenRegionTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.screenRegionTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ SequenceWidget::SequenceWidget(QWidget *parent, SceneSequenceSwitch *s,
|
|||
QWidget::connect(reduce, SIGNAL(clicked()), this,
|
||||
SLOT(ReduceClicked()));
|
||||
|
||||
populateSceneSelection(startScenes);
|
||||
PopulateSceneSelection(startScenes);
|
||||
interruptible->setToolTip(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneSequenceTab.interruptibleHint"));
|
||||
|
||||
|
|
@ -615,7 +615,7 @@ SequenceWidget::SequenceWidget(QWidget *parent, SceneSequenceSwitch *s,
|
|||
{"{{scenes}}", scenes},
|
||||
{"{{delay}}", delay},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.sceneSequenceTab.extendEntry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
|
|
@ -628,7 +628,7 @@ SequenceWidget::SequenceWidget(QWidget *parent, SceneSequenceSwitch *s,
|
|||
{"{{delay}}", delay},
|
||||
{"{{transitions}}", transitions},
|
||||
{"{{interruptible}}", interruptible}};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.sceneSequenceTab.entry"),
|
||||
startSequence, widgetPlaceholders);
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ TimeSwitchWidget::TimeSwitchWidget(QWidget *parent, TimeSwitch *s)
|
|||
{"{{time}}", time},
|
||||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.timeTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.timeTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ void AdvSceneSwitcher::SetupTransitionsTab()
|
|||
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{defTransitionDelay}}", defTransitionDelay}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.transitionTab.defaultTransition.delay"),
|
||||
ui->defTransitionDelayLayout, widgetPlaceholders);
|
||||
|
|
@ -353,7 +353,7 @@ TransitionSwitchWidget::TransitionSwitchWidget(QWidget *parent,
|
|||
QWidget::connect(duration, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(DurationChanged(double)));
|
||||
|
||||
populateSceneSelection(scenes2);
|
||||
PopulateSceneSelection(scenes2);
|
||||
|
||||
if (s) {
|
||||
scenes2->setCurrentText(GetWeakSourceName(s->scene2).c_str());
|
||||
|
|
@ -366,7 +366,7 @@ TransitionSwitchWidget::TransitionSwitchWidget(QWidget *parent,
|
|||
{"{{scenes2}}", scenes2},
|
||||
{"{{duration}}", duration},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.transitionTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.transitionTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ DefTransitionSwitchWidget::DefTransitionSwitchWidget(QWidget *parent,
|
|||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{scenes}}", scenes}, {"{{transitions}}", transitions}};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.transitionTab.defaultTransitionEntry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ VideoSwitchWidget::VideoSwitchWidget(QWidget *parent, VideoSwitch *s)
|
|||
{"{{ignoreInactiveSource}}", ignoreInactiveSource},
|
||||
{"{{scenes}}", scenes},
|
||||
{"{{transitions}}", transitions}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.videoTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.videoTab.entry"),
|
||||
switchLayout, widgetPlaceholders);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ void AdvSceneSwitcher::SetupTitleTab()
|
|||
ui->windowHelp->setVisible(false);
|
||||
}
|
||||
|
||||
populateWindowSelection(ui->ignoreWindowsWindows);
|
||||
PopulateWindowSelection(ui->ignoreWindowsWindows);
|
||||
|
||||
for (auto &window : switcher->ignoreWindowsSwitches) {
|
||||
QString text = QString::fromStdString(window);
|
||||
|
|
@ -397,7 +397,7 @@ WindowSwitchWidget::WindowSwitchWidget(QWidget *parent, WindowSwitch *s)
|
|||
QWidget::connect(focused, SIGNAL(stateChanged(int)), this,
|
||||
SLOT(FocusChanged(int)));
|
||||
|
||||
populateWindowSelection(windows);
|
||||
PopulateWindowSelection(windows);
|
||||
|
||||
windows->setEditable(true);
|
||||
windows->setMaxVisibleItems(20);
|
||||
|
|
@ -417,7 +417,7 @@ WindowSwitchWidget::WindowSwitchWidget(QWidget *parent, WindowSwitch *s)
|
|||
{"{{fullscreen}}", fullscreen},
|
||||
{"{{maximized}}", maximized},
|
||||
{"{{focused}}", focused}};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.windowTitleTab.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.windowTitleTab.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ MacroActionAudioEdit::MacroActionAudioEdit(
|
|||
sources.sort();
|
||||
_sources->SetSourceNameList(sources);
|
||||
populateFadeTypeSelection(_fadeTypes);
|
||||
populateMonitorTypeSelection(_monitorTypes);
|
||||
PopulateMonitorTypeSelection(_monitorTypes);
|
||||
|
||||
QWidget::connect(_actions, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(ActionChanged(int)));
|
||||
|
|
@ -397,10 +397,10 @@ MacroActionAudioEdit::MacroActionAudioEdit(
|
|||
{"{{fadeTypes}}", _fadeTypes},
|
||||
};
|
||||
QHBoxLayout *entryLayout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.audio.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.audio.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
_fadeTypeLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.audio.fade.duration"),
|
||||
_fadeTypeLayout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -447,7 +447,7 @@ void MacroActionAudioEdit::SetWidgetVisibility()
|
|||
_fadeTypeLayout->removeWidget(_fadeTypes);
|
||||
_fadeTypeLayout->removeWidget(_duration);
|
||||
_fadeTypeLayout->removeWidget(_rate);
|
||||
clearLayout(_fadeTypeLayout);
|
||||
ClearLayout(_fadeTypeLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{fade}}", _fade},
|
||||
{"{{duration}}", _duration},
|
||||
|
|
@ -455,12 +455,12 @@ void MacroActionAudioEdit::SetWidgetVisibility()
|
|||
{"{{fadeTypes}}", _fadeTypes},
|
||||
};
|
||||
if (_entryData->_fadeType == MacroActionAudio::FadeType::DURATION) {
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.audio.fade.duration"),
|
||||
_fadeTypeLayout, widgetPlaceholders);
|
||||
} else {
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.audio.fade.rate"),
|
||||
_fadeTypeLayout, widgetPlaceholders);
|
||||
}
|
||||
|
|
@ -470,9 +470,9 @@ void MacroActionAudioEdit::SetWidgetVisibility()
|
|||
_rate->setVisible(_entryData->_fadeType ==
|
||||
MacroActionAudio::FadeType::RATE);
|
||||
|
||||
setLayoutVisible(_fadeTypeLayout,
|
||||
SetLayoutVisible(_fadeTypeLayout,
|
||||
hasVolumeControl(_entryData->_action));
|
||||
setLayoutVisible(_fadeOptionsLayout,
|
||||
SetLayoutVisible(_fadeOptionsLayout,
|
||||
hasVolumeControl(_entryData->_action));
|
||||
adjustSize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ MacroActionFileEdit::MacroActionFileEdit(
|
|||
{"{{matchText}}", _text},
|
||||
{"{{actions}}", _actions},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.file.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.file.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ bool MacroActionFilter::PerformAction()
|
|||
obs_source_set_enabled(s, false);
|
||||
break;
|
||||
case Action::SETTINGS:
|
||||
setSourceSettings(s, _settings);
|
||||
SetSourceSettings(s, _settings);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -142,7 +142,7 @@ MacroActionFilterEdit::MacroActionFilterEdit(
|
|||
{"{{actions}}", _actions}, {"{{settings}}", _settings},
|
||||
{"{{getSettings}}", _getSettings},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.filter.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.filter.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
|
||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||
|
|
@ -168,7 +168,7 @@ void MacroActionFilterEdit::UpdateEntryData()
|
|||
|
||||
_actions->setCurrentIndex(static_cast<int>(_entryData->_action));
|
||||
_sources->SetSource(_entryData->_source);
|
||||
populateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
PopulateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
_filters->setCurrentText(
|
||||
GetWeakSourceName(_entryData->_filter).c_str());
|
||||
_settings->setPlainText(_entryData->_settings);
|
||||
|
|
@ -189,7 +189,7 @@ void MacroActionFilterEdit::SourceChanged(const SourceSelection &source)
|
|||
_entryData->_source = source;
|
||||
}
|
||||
_filters->clear();
|
||||
populateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
PopulateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
_filters->adjustSize();
|
||||
}
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ void MacroActionFilterEdit::GetSettingsClicked()
|
|||
}
|
||||
|
||||
_settings->setPlainText(
|
||||
formatJsonString(getSourceSettings(_entryData->_filter)));
|
||||
FormatJsonString(GetSourceSettings(_entryData->_filter)));
|
||||
}
|
||||
|
||||
void MacroActionFilterEdit::SettingsChanged()
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ MacroActionHotkeyEdit::MacroActionHotkeyEdit(
|
|||
{"{{keys}}", _keys},
|
||||
{"{{duration}}", _duration},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.hotkey.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.hotkey.entry"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
|
||||
QHBoxLayout *line2Layout = new QHBoxLayout;
|
||||
|
|
|
|||
|
|
@ -178,11 +178,11 @@ MacroActionHttpEdit::MacroActionHttpEdit(
|
|||
{"{{timeout}}", _timeout},
|
||||
};
|
||||
auto *actionLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.http.entry.line1"),
|
||||
actionLayout, widgetPlaceholders);
|
||||
auto *timeoutLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.http.entry.line2"),
|
||||
timeoutLayout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -276,7 +276,7 @@ void MacroActionHttpEdit::HeadersChanged(const StringList &headers)
|
|||
void MacroActionHttpEdit::SetWidgetVisibility()
|
||||
{
|
||||
_data->setVisible(_entryData->_method == MacroActionHttp::Method::POST);
|
||||
setLayoutVisible(_headerListLayout, _entryData->_setHeaders);
|
||||
SetLayoutVisible(_headerListLayout, _entryData->_setHeaders);
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||
{"{{actions}}", _actions},
|
||||
{"{{macros}}", _macros},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.macro.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.macro.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ MacroActionMediaEdit::MacroActionMediaEdit(
|
|||
{"{{actions}}", _actions},
|
||||
{"{{duration}}", _seek},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.media.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.media.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ MacroActionPluginStateEdit::MacroActionPluginStateEdit(
|
|||
"AdvSceneSwitcher.action.pluginState.importWarning"));
|
||||
|
||||
populateActionSelection(_actions);
|
||||
populateSceneSelection(_scenes);
|
||||
PopulateSceneSelection(_scenes);
|
||||
|
||||
QWidget::connect(_actions, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(ActionChanged(int)));
|
||||
|
|
@ -168,7 +168,7 @@ MacroActionPluginStateEdit::MacroActionPluginStateEdit(
|
|||
{"{{settings}}", _settings},
|
||||
{"{{settingsWarning}}", _settingsWarning},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.pluginState.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ MacroActionProfileEdit::MacroActionProfileEdit(
|
|||
: QWidget(parent)
|
||||
{
|
||||
_profiles = new QComboBox();
|
||||
populateProfileSelection(_profiles);
|
||||
PopulateProfileSelection(_profiles);
|
||||
QWidget::connect(_profiles, SIGNAL(currentTextChanged(const QString &)),
|
||||
this, SLOT(ProfileChanged(const QString &)));
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ MacroActionProfileEdit::MacroActionProfileEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{profiles}}", _profiles},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.profile.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.profile.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -193,12 +193,12 @@ MacroActionProjectorEdit::MacroActionProjectorEdit(
|
|||
{"{{monitors}}", _monitors},
|
||||
};
|
||||
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.projector.entry.monitor"),
|
||||
_monitorSelection, widgetPlaceholders);
|
||||
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.projector.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.projector.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
mainLayout->insertLayout(mainLayout->count() - 1, _monitorSelection);
|
||||
setLayout(mainLayout);
|
||||
|
|
@ -285,7 +285,7 @@ void MacroActionProjectorEdit::SetWidgetVisibility()
|
|||
MacroActionProjector::Type::SCENE);
|
||||
_sources->setVisible(_entryData->_type ==
|
||||
MacroActionProjector::Type::SOURCE);
|
||||
setLayoutVisible(_monitorSelection, _entryData->_fullscreen);
|
||||
SetLayoutVisible(_monitorSelection, _entryData->_fullscreen);
|
||||
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ MacroActionRandomEdit::MacroActionRandomEdit(
|
|||
|
||||
auto *entryLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.random.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.random.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
|
||||
auto *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ MacroActionRecordEdit::MacroActionRecordEdit(
|
|||
SLOT(FormatStringChanged()));
|
||||
|
||||
auto mainLayout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.recording.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.recording.entry"),
|
||||
mainLayout,
|
||||
{{"{{actions}}", _actions},
|
||||
{"{{pauseHint}}", _pauseHint},
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ MacroActionReplayBufferEdit::MacroActionReplayBufferEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{actions}}", _actions},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.replay.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.replay.entry"),
|
||||
layout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addLayout(layout);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ void populateSceneCollectionSelection(QComboBox *box)
|
|||
}
|
||||
bfree(sceneCollections);
|
||||
box->model()->sort(0);
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
box, obs_module_text("AdvSceneSwitcher.selectSceneCollection"),
|
||||
false);
|
||||
box->setCurrentIndex(0);
|
||||
|
|
@ -82,7 +82,7 @@ MacroActionSceneCollectionEdit::MacroActionSceneCollectionEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{sceneCollections}}", _sceneCollections},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.sceneCollection.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ MacroActionSceneOrderEdit::MacroActionSceneOrderEdit(
|
|||
{"{{actions}}", _actions},
|
||||
{"{{position}}", _position},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.sceneOrder.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ MacroActionSwitchSceneEdit::MacroActionSwitchSceneEdit(
|
|||
{"{{duration}}", _duration},
|
||||
{"{{blockUntilTransitionDone}}", _blockUntilTransitionDone},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.scene.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.scene.entry"),
|
||||
_entryLayout, widgetPlaceholders);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
@ -261,19 +261,19 @@ void MacroActionSwitchSceneEdit::SetDurationVisibility()
|
|||
_entryLayout->removeWidget(_scenes);
|
||||
_entryLayout->removeWidget(_transitions);
|
||||
_entryLayout->removeWidget(_duration);
|
||||
clearLayout(_entryLayout);
|
||||
ClearLayout(_entryLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{scenes}}", _scenes},
|
||||
{"{{transitions}}", _transitions},
|
||||
{"{{duration}}", _duration},
|
||||
};
|
||||
if (fixedDuration) {
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.scene.entry.noDuration"),
|
||||
_entryLayout, widgetPlaceholders);
|
||||
} else {
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.scene.entry"),
|
||||
_entryLayout, widgetPlaceholders);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ bool MacroActionSceneTransform::Load(obs_data_t *obj)
|
|||
// Convert old data format
|
||||
// TODO: Remove in future version
|
||||
if (!obs_data_has_user_value(obj, "settings")) {
|
||||
loadTransformState(obj, _info, _crop);
|
||||
LoadTransformState(obj, _info, _crop);
|
||||
_settings = ConvertSettings();
|
||||
}
|
||||
return true;
|
||||
|
|
@ -78,7 +78,7 @@ std::string MacroActionSceneTransform::GetShortDesc() const
|
|||
std::string MacroActionSceneTransform::ConvertSettings()
|
||||
{
|
||||
auto data = obs_data_create();
|
||||
saveTransformState(data, _info, _crop);
|
||||
SaveTransformState(data, _info, _crop);
|
||||
std::string json = obs_data_get_json(data);
|
||||
obs_data_release(data);
|
||||
return json;
|
||||
|
|
@ -90,7 +90,7 @@ void MacroActionSceneTransform::ApplySettings(const std::string &settings)
|
|||
if (!data) {
|
||||
return;
|
||||
}
|
||||
loadTransformState(data, _info, _crop);
|
||||
LoadTransformState(data, _info, _crop);
|
||||
auto items = _source.GetSceneItems(_scene);
|
||||
if (items.empty()) {
|
||||
return;
|
||||
|
|
@ -144,7 +144,7 @@ MacroActionSceneTransformEdit::MacroActionSceneTransformEdit(
|
|||
{"{{settings}}", _settings},
|
||||
{"{{getSettings}}", _getSettings},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.sceneTransform.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -210,8 +210,8 @@ void MacroActionSceneTransformEdit::GetSettingsClicked()
|
|||
return;
|
||||
}
|
||||
|
||||
auto settings = getSceneItemTransform(items[0]);
|
||||
_settings->setPlainText(formatJsonString(settings));
|
||||
auto settings = GetSceneItemTransform(items[0]);
|
||||
_settings->setPlainText(FormatJsonString(settings));
|
||||
for (auto item : items) {
|
||||
obs_sceneitem_release(item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ MacroActionSceneVisibilityEdit::MacroActionSceneVisibilityEdit(
|
|||
_actions = new QComboBox();
|
||||
|
||||
populateSourceItemTypeSelection(_sourceTypes);
|
||||
populateSourceGroupSelection(_sourceGroups);
|
||||
PopulateSourceGroupSelection(_sourceGroups);
|
||||
populateActionSelection(_actions);
|
||||
|
||||
QWidget::connect(_actions, SIGNAL(currentIndexChanged(int)), this,
|
||||
|
|
@ -216,7 +216,7 @@ MacroActionSceneVisibilityEdit::MacroActionSceneVisibilityEdit(
|
|||
{"{{sources}}", _sources}, {"{{sourceGroups}}", _sourceGroups},
|
||||
{"{{actions}}", _actions},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.sceneVisibility.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ MacroActionScreenshotEdit::MacroActionScreenshotEdit(
|
|||
{"{{saveType}}", _saveType},
|
||||
{"{{targetType}}", _targetType},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.screenshot.entry"),
|
||||
layout, widgetPlaceholders);
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ MacroActionSequenceEdit::MacroActionSequenceEdit(
|
|||
|
||||
auto *entryLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.sequence.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.sequence.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
|
||||
auto *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ bool MacroActionSource::PerformAction()
|
|||
obs_source_set_enabled(s, false);
|
||||
break;
|
||||
case SourceAction::SETTINGS:
|
||||
setSourceSettings(s, _settings);
|
||||
SetSourceSettings(s, _settings);
|
||||
break;
|
||||
case SourceAction::REFRESH_SETTINGS:
|
||||
refreshSourceSettings(s);
|
||||
|
|
@ -211,7 +211,7 @@ MacroActionSourceEdit::MacroActionSourceEdit(
|
|||
{"{{getSettings}}", _getSettings},
|
||||
{"{{settingsButtons}}", _settingsButtons},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.source.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.source.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
mainLayout->addLayout(entryLayout);
|
||||
mainLayout->addWidget(_warning);
|
||||
|
|
@ -289,8 +289,8 @@ void MacroActionSourceEdit::GetSettingsClicked()
|
|||
return;
|
||||
}
|
||||
|
||||
_settings->setPlainText(formatJsonString(
|
||||
getSourceSettings(_entryData->_source.GetSource())));
|
||||
_settings->setPlainText(FormatJsonString(
|
||||
GetSourceSettings(_entryData->_source.GetSource())));
|
||||
}
|
||||
|
||||
void MacroActionSourceEdit::SettingsChanged()
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ MacroActionStreamEdit::MacroActionStreamEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{actions}}", _actions},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.streaming.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.streaming.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ MacroActionSudioModeEdit::MacroActionSudioModeEdit(
|
|||
{"{{scenes}}", _scenes},
|
||||
};
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.studioMode.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ MacroActionSystrayEdit::MacroActionSystrayEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{message}}", _msg},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.systray.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.systray.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ MacroActionTimerEdit::MacroActionTimerEdit(
|
|||
{"{{duration}}", _duration},
|
||||
{"{{timerAction}}", _timerAction},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.timer.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.timer.entry"),
|
||||
_mainLayout, widgetPlaceholders);
|
||||
setLayout(_mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -250,13 +250,13 @@ MacroActionTransitionEdit::MacroActionTransitionEdit(
|
|||
{"{{setDuration}}", _setDuration},
|
||||
};
|
||||
QHBoxLayout *typeLayout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.transition.entry.line1"),
|
||||
typeLayout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.transition.entry.line2"),
|
||||
_transitionLayout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.transition.entry.line3"),
|
||||
_durationLayout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ void MacroActionVariable::HandleRegexSubString(Variable *var)
|
|||
void MacroActionVariable::HandleFindAndReplace(Variable *var)
|
||||
{
|
||||
auto value = var->Value();
|
||||
replaceAll(value, _findStr, _replaceStr);
|
||||
ReplaceAll(value, _findStr, _replaceStr);
|
||||
var->SetValue(value);
|
||||
}
|
||||
|
||||
|
|
@ -417,20 +417,20 @@ MacroActionVariableEdit::MacroActionVariableEdit(
|
|||
{"{{mathExpression}}", _mathExpression},
|
||||
};
|
||||
auto entryLayout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.action.variable.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.variable.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.entry.substringIndex"),
|
||||
_subStringIndexEntryLayout, widgetPlaceholders);
|
||||
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.entry.substringRegex"),
|
||||
_subStringRegexEntryLayout, widgetPlaceholders);
|
||||
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.action.variable.entry.findAndReplace"),
|
||||
_findReplaceLayout, widgetPlaceholders, false);
|
||||
|
|
@ -816,16 +816,16 @@ void MacroActionVariableEdit::SetWidgetVisibility()
|
|||
MacroActionVariable::Type::SET_ACTION_VALUE ||
|
||||
_entryData->_type ==
|
||||
MacroActionVariable::Type::SET_CONDITION_VALUE);
|
||||
setLayoutVisible(_substringLayout,
|
||||
SetLayoutVisible(_substringLayout,
|
||||
_entryData->_type ==
|
||||
MacroActionVariable::Type::SUBSTRING);
|
||||
if (_entryData->_type == MacroActionVariable::Type::SUBSTRING) {
|
||||
bool showRegex = _entryData->_regex.Enabled();
|
||||
setLayoutVisible(_subStringIndexEntryLayout, !showRegex);
|
||||
setLayoutVisible(_subStringRegexEntryLayout, showRegex);
|
||||
SetLayoutVisible(_subStringIndexEntryLayout, !showRegex);
|
||||
SetLayoutVisible(_subStringRegexEntryLayout, showRegex);
|
||||
_regexPattern->setVisible(showRegex);
|
||||
}
|
||||
setLayoutVisible(_findReplaceLayout,
|
||||
SetLayoutVisible(_findReplaceLayout,
|
||||
_entryData->_type ==
|
||||
MacroActionVariable::Type::FIND_AND_REPLACE);
|
||||
_mathExpression->setVisible(_entryData->_type ==
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ MacroActionVCamEdit::MacroActionVCamEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{actions}}", _actions},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.virtualCamera.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -140,12 +140,12 @@ void MacroActionWaitEdit::SetupFixedDurationEdit()
|
|||
_mainLayout->removeWidget(_duration);
|
||||
_mainLayout->removeWidget(_duration2);
|
||||
_mainLayout->removeWidget(_waitType);
|
||||
clearLayout(_mainLayout);
|
||||
ClearLayout(_mainLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{duration}}", _duration},
|
||||
{"{{waitType}}", _waitType},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.wait.entry.fixed"),
|
||||
_mainLayout, widgetPlaceholders);
|
||||
_duration2->hide();
|
||||
|
|
@ -156,13 +156,13 @@ void MacroActionWaitEdit::SetupRandomDurationEdit()
|
|||
_mainLayout->removeWidget(_duration);
|
||||
_mainLayout->removeWidget(_duration2);
|
||||
_mainLayout->removeWidget(_waitType);
|
||||
clearLayout(_mainLayout);
|
||||
ClearLayout(_mainLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{duration}}", _duration},
|
||||
{"{{duration2}}", _duration2},
|
||||
{"{{waitType}}", _waitType},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.action.wait.entry.random"),
|
||||
_mainLayout, widgetPlaceholders);
|
||||
_duration2->show();
|
||||
|
|
|
|||
|
|
@ -126,12 +126,12 @@ void MacroActionWebsocketEdit::SetupRequestEdit()
|
|||
{
|
||||
_editLayout->removeWidget(_actions);
|
||||
_editLayout->removeWidget(_connection);
|
||||
clearLayout(_editLayout);
|
||||
ClearLayout(_editLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{type}}", _actions},
|
||||
{"{{connection}}", _connection},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.websocket.entry.request"),
|
||||
_editLayout, widgetPlaceholders);
|
||||
_connection->show();
|
||||
|
|
@ -141,12 +141,12 @@ void MacroActionWebsocketEdit::SetupEventEdit()
|
|||
{
|
||||
_editLayout->removeWidget(_actions);
|
||||
_editLayout->removeWidget(_connection);
|
||||
clearLayout(_editLayout);
|
||||
ClearLayout(_editLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{type}}", _actions},
|
||||
{"{{connection}}", _connection},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.action.websocket.entry.event"),
|
||||
_editLayout, widgetPlaceholders);
|
||||
_connection->hide();
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ MacroConditionAudioEdit::MacroConditionAudioEdit(
|
|||
SLOT(SourceChanged(const SourceSelection &)));
|
||||
|
||||
populateCheckTypes(_checkTypes);
|
||||
populateMonitorTypeSelection(_monitorTypes);
|
||||
PopulateMonitorTypeSelection(_monitorTypes);
|
||||
|
||||
QHBoxLayout *switchLayout = new QHBoxLayout;
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
|
|
@ -382,7 +382,7 @@ MacroConditionAudioEdit::MacroConditionAudioEdit(
|
|||
{"{{balance}}", _balance},
|
||||
{"{{condition}}", _condition},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.audio.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.audio.entry"),
|
||||
switchLayout, widgetPlaceholders);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ bool MacroConditionCursor::CheckClick()
|
|||
bool MacroConditionCursor::CheckCondition()
|
||||
{
|
||||
bool ret = false;
|
||||
std::pair<int, int> cursorPos = getCursorPos();
|
||||
std::pair<int, int> cursorPos = GetCursorPos();
|
||||
switch (_condition) {
|
||||
case Condition::REGION:
|
||||
ret = cursorPos.first >= _minX && cursorPos.second >= _minY &&
|
||||
|
|
@ -193,10 +193,10 @@ MacroConditionCursorEdit::MacroConditionCursorEdit(
|
|||
{"{{toggleFrameButton}}", _frameToggle},
|
||||
};
|
||||
QHBoxLayout *line1 = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.cursor.entry.line1"),
|
||||
line1, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.cursor.entry.line2"),
|
||||
_curentPosLayout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
@ -282,7 +282,7 @@ void MacroConditionCursorEdit::MaxYChanged(const NumberVariable<int> &pos)
|
|||
|
||||
void MacroConditionCursorEdit::UpdateCursorPos()
|
||||
{
|
||||
std::pair<int, int> position = getCursorPos();
|
||||
std::pair<int, int> position = GetCursorPos();
|
||||
_xPos->setText(QString::number(position.first));
|
||||
_yPos->setText(QString::number(position.second));
|
||||
}
|
||||
|
|
@ -310,7 +310,7 @@ void MacroConditionCursorEdit::SetWidgetVisibility()
|
|||
_maxX->setVisible(isRegionCondition);
|
||||
_maxY->setVisible(isRegionCondition);
|
||||
_frameToggle->setVisible(isRegionCondition);
|
||||
setLayoutVisible(_curentPosLayout, isRegionCondition);
|
||||
SetLayoutVisible(_curentPosLayout, isRegionCondition);
|
||||
if (_frame.isVisible()) {
|
||||
ToggleFrame();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -430,21 +430,21 @@ MacroConditionDateEdit::MacroConditionDateEdit(
|
|||
{"{{pattern}}", _pattern},
|
||||
{"{{currentDate}}", _currentDate},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.date.entry.simple"),
|
||||
_simpleLayout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.advanced"),
|
||||
_advancedLayout, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.updateOnRepeat"),
|
||||
_repeatUpdateLayout, widgetPlaceholders);
|
||||
auto repeatLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.date.entry.repeat"),
|
||||
repeatLayout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.date.entry.pattern"),
|
||||
_patternLayout, widgetPlaceholders);
|
||||
_repeatLayout->addLayout(repeatLayout);
|
||||
|
|
@ -671,11 +671,11 @@ void MacroConditionDateEdit::UpdateEntryData()
|
|||
|
||||
void MacroConditionDateEdit::SetupSimpleView()
|
||||
{
|
||||
setLayoutVisible(_simpleLayout, true);
|
||||
setLayoutVisible(_advancedLayout, false);
|
||||
setLayoutVisible(_patternLayout, false);
|
||||
setLayoutVisible(_repeatLayout, false);
|
||||
setLayoutVisible(_repeatUpdateLayout, false);
|
||||
SetLayoutVisible(_simpleLayout, true);
|
||||
SetLayoutVisible(_advancedLayout, false);
|
||||
SetLayoutVisible(_patternLayout, false);
|
||||
SetLayoutVisible(_repeatLayout, false);
|
||||
SetLayoutVisible(_repeatUpdateLayout, false);
|
||||
_weekTime->setDisabled(_entryData->_ignoreTime);
|
||||
_weekCondition->setDisabled(_entryData->_ignoreTime);
|
||||
const QSignalBlocker b(_weekTime);
|
||||
|
|
@ -686,11 +686,11 @@ void MacroConditionDateEdit::SetupSimpleView()
|
|||
|
||||
void MacroConditionDateEdit::SetupAdvancedView()
|
||||
{
|
||||
setLayoutVisible(_simpleLayout, false);
|
||||
setLayoutVisible(_advancedLayout, true);
|
||||
setLayoutVisible(_patternLayout, false);
|
||||
setLayoutVisible(_repeatLayout, true);
|
||||
setLayoutVisible(_repeatUpdateLayout, _entryData->_repeat);
|
||||
SetLayoutVisible(_simpleLayout, false);
|
||||
SetLayoutVisible(_advancedLayout, true);
|
||||
SetLayoutVisible(_patternLayout, false);
|
||||
SetLayoutVisible(_repeatLayout, true);
|
||||
SetLayoutVisible(_repeatUpdateLayout, _entryData->_repeat);
|
||||
_nextMatchDate->setVisible(_entryData->_repeat);
|
||||
_date->setDisabled(_entryData->_ignoreDate);
|
||||
_date2->setDisabled(_entryData->_ignoreDate);
|
||||
|
|
@ -705,11 +705,11 @@ void MacroConditionDateEdit::SetupAdvancedView()
|
|||
|
||||
void MacroConditionDateEdit::SetupPatternView()
|
||||
{
|
||||
setLayoutVisible(_simpleLayout, false);
|
||||
setLayoutVisible(_advancedLayout, true);
|
||||
setLayoutVisible(_patternLayout, true);
|
||||
setLayoutVisible(_repeatLayout, false);
|
||||
setLayoutVisible(_repeatUpdateLayout, false);
|
||||
SetLayoutVisible(_simpleLayout, false);
|
||||
SetLayoutVisible(_advancedLayout, true);
|
||||
SetLayoutVisible(_patternLayout, true);
|
||||
SetLayoutVisible(_repeatLayout, false);
|
||||
SetLayoutVisible(_repeatUpdateLayout, false);
|
||||
ShowFirstDateSelection(false);
|
||||
ShowSecondDateSelection(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ DurationModifierEdit::DurationModifierEdit(QWidget *parent)
|
|||
_duration = new DurationSelection(parent);
|
||||
_toggle = new QPushButton(parent);
|
||||
_toggle->setMaximumWidth(22);
|
||||
const auto path = QString::fromStdString(getDataFilePath(
|
||||
const auto path = QString::fromStdString(GetDataFilePath(
|
||||
"res/images/" + GetThemeTypeName() + "Time.svg"));
|
||||
_toggle->setIcon(QIcon(path));
|
||||
populateDurationModifierTypes(_condition);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ bool MacroConditionFile::MatchFileContent(QString &filedata)
|
|||
}
|
||||
|
||||
QString text = QString::fromStdString(_text);
|
||||
return compareIgnoringLineEnding(text, filedata);
|
||||
return CompareIgnoringLineEnding(text, filedata);
|
||||
}
|
||||
|
||||
bool MacroConditionFile::CheckRemoteFileContent()
|
||||
|
|
@ -269,13 +269,13 @@ MacroConditionFileEdit::MacroConditionFileEdit(
|
|||
line1Layout->setContentsMargins(0, 0, 0, 0);
|
||||
line2Layout->setContentsMargins(0, 0, 0, 0);
|
||||
line3Layout->setContentsMargins(0, 0, 0, 0);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.file.entry.line1"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.file.entry.line2"),
|
||||
line2Layout, widgetPlaceholders, false);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.file.entry.line3"),
|
||||
line3Layout, widgetPlaceholders);
|
||||
mainLayout->addLayout(line1Layout);
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ bool MacroConditionFilter::CheckCondition()
|
|||
ret = !obs_source_enabled(s);
|
||||
break;
|
||||
case Condition::SETTINGS:
|
||||
ret = compareSourceSettings(_filter, _settings, _regex);
|
||||
ret = CompareSourceSettings(_filter, _settings, _regex);
|
||||
if (IsReferencedInVars()) {
|
||||
SetVariableValue(getSourceSettings(_filter));
|
||||
SetVariableValue(GetSourceSettings(_filter));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -156,13 +156,13 @@ MacroConditionFilterEdit::MacroConditionFilterEdit(
|
|||
{"{{conditions}}", _conditions}, {"{{settings}}", _settings},
|
||||
{"{{getSettings}}", _getSettings}, {"{{regex}}", _regex},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.filter.entry.line1"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.filter.entry.line2"),
|
||||
line2Layout, widgetPlaceholders, false);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.filter.entry.line3"),
|
||||
line3Layout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ void MacroConditionFilterEdit::SourceChanged(const SourceSelection &source)
|
|||
_entryData->_source = source;
|
||||
}
|
||||
_filters->clear();
|
||||
populateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
PopulateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
_filters->adjustSize();
|
||||
}
|
||||
|
||||
|
|
@ -224,9 +224,9 @@ void MacroConditionFilterEdit::GetSettingsClicked()
|
|||
return;
|
||||
}
|
||||
|
||||
QString json = formatJsonString(getSourceSettings(_entryData->_filter));
|
||||
QString json = FormatJsonString(GetSourceSettings(_entryData->_filter));
|
||||
if (_entryData->_regex.Enabled()) {
|
||||
json = escapeForRegex(json);
|
||||
json = EscapeForRegex(json);
|
||||
}
|
||||
_settings->setPlainText(json);
|
||||
}
|
||||
|
|
@ -272,7 +272,7 @@ void MacroConditionFilterEdit::UpdateEntryData()
|
|||
}
|
||||
|
||||
_sources->SetSource(_entryData->_source);
|
||||
populateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
PopulateFilterSelection(_filters, _entryData->_source.GetSource());
|
||||
_filters->setCurrentText(
|
||||
GetWeakSourceName(_entryData->_filter).c_str());
|
||||
_conditions->setCurrentIndex(static_cast<int>(_entryData->_condition));
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ MacroConditionHotkeyEdit::MacroConditionHotkeyEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{name}}", _name},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.hotkey.entry.line2"),
|
||||
switchLayout, widgetPlaceholders);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ MacroConditionIdleEdit::MacroConditionIdleEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{duration}}", _duration},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.idle.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.idle.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ MacroConditionMacroEdit::MacroConditionMacroEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{types}}", _types},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.macro.type.selection"),
|
||||
typesLayout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -287,8 +287,8 @@ void MacroConditionMacroEdit::ClearLayouts()
|
|||
_settingsLine2->removeWidget(_resetCount);
|
||||
_settingsLine1->removeWidget(_multiStateConditions);
|
||||
_settingsLine1->removeWidget(_multiStateCount);
|
||||
clearLayout(_settingsLine1);
|
||||
clearLayout(_settingsLine2);
|
||||
ClearLayout(_settingsLine1);
|
||||
ClearLayout(_settingsLine2);
|
||||
}
|
||||
|
||||
void MacroConditionMacroEdit::SetupStateWidgets()
|
||||
|
|
@ -299,7 +299,7 @@ void MacroConditionMacroEdit::SetupStateWidgets()
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{macros}}", _macros},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.macro.state.entry"),
|
||||
_settingsLine1, widgetPlaceholders);
|
||||
}
|
||||
|
|
@ -313,7 +313,7 @@ void MacroConditionMacroEdit::SetupMultiStateWidgets()
|
|||
{"{{multiStateConditions}}", _multiStateConditions},
|
||||
{"{{multiStateCount}}", _multiStateCount},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.macro.multistate.entry"),
|
||||
_settingsLine1, widgetPlaceholders);
|
||||
|
|
@ -331,11 +331,11 @@ void MacroConditionMacroEdit::SetupCountWidgets()
|
|||
{"{{currentCount}}", _currentCount},
|
||||
{"{{resetCount}}", _resetCount},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.macro.count.entry.line1"),
|
||||
_settingsLine1, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.macro.count.entry.line2"),
|
||||
_settingsLine2, widgetPlaceholders);
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ MacroConditionMediaEdit::MacroConditionMediaEdit(
|
|||
{"{{timeRestrictions}}", _timeRestrictions},
|
||||
{"{{time}}", _time},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.media.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.media.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addLayout(entryLayout);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ bool MacroConditionStats::CheckFPS()
|
|||
case Condition::ABOVE:
|
||||
return obs_get_active_fps() > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(obs_get_active_fps(), _value, 0.01);
|
||||
return DoubleEquals(obs_get_active_fps(), _value, 0.01);
|
||||
case Condition::BELOW:
|
||||
return obs_get_active_fps() < _value;
|
||||
default:
|
||||
|
|
@ -84,7 +84,7 @@ bool MacroConditionStats::CheckCPU()
|
|||
case Condition::ABOVE:
|
||||
return usage > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(usage, _value, 0.1);
|
||||
return DoubleEquals(usage, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return usage < _value;
|
||||
default:
|
||||
|
|
@ -102,7 +102,7 @@ bool MacroConditionStats::CheckMemory()
|
|||
case Condition::ABOVE:
|
||||
return rss > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(rss, _value, 0.1);
|
||||
return DoubleEquals(rss, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return rss < _value;
|
||||
default:
|
||||
|
|
@ -119,7 +119,7 @@ bool MacroConditionStats::CheckAvgFrametime()
|
|||
case Condition::ABOVE:
|
||||
return num > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(num, _value, 0.1);
|
||||
return DoubleEquals(num, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return num < _value;
|
||||
default:
|
||||
|
|
@ -149,7 +149,7 @@ bool MacroConditionStats::CheckRenderLag()
|
|||
case Condition::ABOVE:
|
||||
return num > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(num, _value, 0.1);
|
||||
return DoubleEquals(num, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return num < _value;
|
||||
default:
|
||||
|
|
@ -180,7 +180,7 @@ bool MacroConditionStats::CheckEncodeLag()
|
|||
case Condition::ABOVE:
|
||||
return num > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(num, _value, 0.1);
|
||||
return DoubleEquals(num, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return num < _value;
|
||||
default:
|
||||
|
|
@ -237,7 +237,7 @@ bool MacroConditionStats::CheckStreamDroppedFrames()
|
|||
case Condition::ABOVE:
|
||||
return _streamInfo.dropped_relative > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(_streamInfo.dropped_relative, _value, 0.1);
|
||||
return DoubleEquals(_streamInfo.dropped_relative, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return _streamInfo.dropped_relative < _value;
|
||||
default:
|
||||
|
|
@ -256,7 +256,7 @@ bool MacroConditionStats::CheckStreamBitrate()
|
|||
case Condition::ABOVE:
|
||||
return _streamInfo.kbps > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(_streamInfo.kbps, _value, 1.0);
|
||||
return DoubleEquals(_streamInfo.kbps, _value, 1.0);
|
||||
case Condition::BELOW:
|
||||
return _streamInfo.kbps < _value;
|
||||
default:
|
||||
|
|
@ -276,7 +276,7 @@ bool MacroConditionStats::CheckStreamMBSent()
|
|||
case Condition::ABOVE:
|
||||
return num > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(num, _value, 0.1);
|
||||
return DoubleEquals(num, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return num < _value;
|
||||
default:
|
||||
|
|
@ -295,7 +295,7 @@ bool MacroConditionStats::CheckRecordingDroppedFrames()
|
|||
case Condition::ABOVE:
|
||||
return _recordingInfo.dropped_relative > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(_recordingInfo.dropped_relative, _value,
|
||||
return DoubleEquals(_recordingInfo.dropped_relative, _value,
|
||||
0.1);
|
||||
case Condition::BELOW:
|
||||
return _recordingInfo.dropped_relative < _value;
|
||||
|
|
@ -315,7 +315,7 @@ bool MacroConditionStats::CheckRecordingBitrate()
|
|||
case Condition::ABOVE:
|
||||
return _recordingInfo.kbps > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(_recordingInfo.kbps, _value, 1.0);
|
||||
return DoubleEquals(_recordingInfo.kbps, _value, 1.0);
|
||||
case Condition::BELOW:
|
||||
return _recordingInfo.kbps < _value;
|
||||
default:
|
||||
|
|
@ -335,7 +335,7 @@ bool MacroConditionStats::CheckRecordingMBSent()
|
|||
case Condition::ABOVE:
|
||||
return num > _value;
|
||||
case Condition::EQUALS:
|
||||
return doubleEquals(num, _value, 0.1);
|
||||
return DoubleEquals(num, _value, 0.1);
|
||||
case Condition::BELOW:
|
||||
return num < _value;
|
||||
default:
|
||||
|
|
@ -466,7 +466,7 @@ MacroConditionStatsEdit::MacroConditionStatsEdit(
|
|||
{"{{stats}}", _stats},
|
||||
{"{{condition}}", _condition},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.stats.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.stats.entry"),
|
||||
layout, widgetPlaceholders);
|
||||
setLayout(layout);
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ MacroConditionPluginStateEdit::MacroConditionPluginStateEdit(
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{condition}}", _condition},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.pluginState.entry"),
|
||||
switchLayout, widgetPlaceholders);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ MacroConditionProcessEdit::MacroConditionProcessEdit(
|
|||
QWidget::connect(&_timer, SIGNAL(timeout()), this,
|
||||
SLOT(UpdateFocusProcess()));
|
||||
|
||||
populateProcessSelection(_processSelection);
|
||||
PopulateProcessSelection(_processSelection);
|
||||
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{processes}}", _processSelection},
|
||||
|
|
@ -83,10 +83,10 @@ MacroConditionProcessEdit::MacroConditionProcessEdit(
|
|||
};
|
||||
|
||||
auto entryLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.process.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.process.entry.focus"),
|
||||
_focusLayout, widgetPlaceholders);
|
||||
auto mainLayout = new QVBoxLayout;
|
||||
|
|
@ -135,7 +135,7 @@ void MacroConditionProcessEdit::SetWidgetVisibility()
|
|||
if (!_entryData) {
|
||||
return;
|
||||
}
|
||||
setLayoutVisible(_focusLayout, _entryData->_focus);
|
||||
SetLayoutVisible(_focusLayout, _entryData->_focus);
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ MacroConditionProfileEdit::MacroConditionProfileEdit(
|
|||
QWidget *parent, std::shared_ptr<MacroConditionProfile> entryData)
|
||||
: QWidget(parent), _profiles(new QComboBox())
|
||||
{
|
||||
populateProfileSelection(_profiles);
|
||||
PopulateProfileSelection(_profiles);
|
||||
QWidget::connect(_profiles, SIGNAL(currentTextChanged(const QString &)),
|
||||
this, SLOT(ProfileChanged(const QString &)));
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ MacroConditionProfileEdit::MacroConditionProfileEdit(
|
|||
{"{{profiles}}", _profiles},
|
||||
};
|
||||
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.profile.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ MacroConditionRecordEdit::MacroConditionRecordEdit(
|
|||
{"{{recordState}}", _recordState},
|
||||
};
|
||||
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.record.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.record.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ MacroConditionReplayBufferEdit::MacroConditionReplayBufferEdit(
|
|||
{"{{state}}", _state},
|
||||
};
|
||||
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.replay.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.replay.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -150,11 +150,11 @@ MacroConditionRunEdit::MacroConditionRunEdit(
|
|||
};
|
||||
|
||||
auto exitLayout = new QHBoxLayout();
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.run.entry.exit"),
|
||||
exitLayout, widgetPlaceholders);
|
||||
auto timeoutLayout = new QHBoxLayout();
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.run.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.run.entry"),
|
||||
timeoutLayout, widgetPlaceholders);
|
||||
|
||||
auto *layout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ MacroConditionSceneOrderEdit::MacroConditionSceneOrderEdit(
|
|||
{"{{sources2}}", _sources2}, {"{{conditions}}", _conditions},
|
||||
{"{{position}}", _position},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.sceneOrder.entry"),
|
||||
entryLayout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ bool MacroConditionSceneTransform::CheckCondition()
|
|||
|
||||
std::string json;
|
||||
for (auto &item : items) {
|
||||
json = getSceneItemTransform(item);
|
||||
if (matchJson(json, _settings, _regex)) {
|
||||
json = GetSceneItemTransform(item);
|
||||
if (MatchJson(json, _settings, _regex)) {
|
||||
ret = true;
|
||||
}
|
||||
obs_sceneitem_release(item);
|
||||
|
|
@ -105,17 +105,17 @@ MacroConditionSceneTransformEdit::MacroConditionSceneTransformEdit(
|
|||
};
|
||||
|
||||
QHBoxLayout *line1Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.sceneTransform.entry.line1"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
QHBoxLayout *line2Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.sceneTransform.entry.line2"),
|
||||
line2Layout, widgetPlaceholders, false);
|
||||
QHBoxLayout *line3Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.sceneTransform.entry.line3"),
|
||||
line3Layout, widgetPlaceholders);
|
||||
|
|
@ -181,9 +181,9 @@ void MacroConditionSceneTransformEdit::GetSettingsClicked()
|
|||
return;
|
||||
}
|
||||
|
||||
auto settings = formatJsonString(getSceneItemTransform(items[0]));
|
||||
auto settings = FormatJsonString(GetSceneItemTransform(items[0]));
|
||||
if (_entryData->_regex.Enabled()) {
|
||||
settings = escapeForRegex(settings);
|
||||
settings = EscapeForRegex(settings);
|
||||
}
|
||||
_settings->setPlainText(settings);
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ MacroConditionSceneVisibilityEdit::MacroConditionSceneVisibilityEdit(
|
|||
{"{{conditions}}", _conditions},
|
||||
};
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.sceneVisibility.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
|
|
|
|||
|
|
@ -158,11 +158,11 @@ MacroConditionSceneEdit::MacroConditionSceneEdit(
|
|||
{"{{useTransitionTargetScene}}", _useTransitionTargetScene},
|
||||
};
|
||||
QHBoxLayout *line1Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.scene.entry.line1"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
QHBoxLayout *line2Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.scene.entry.line2"),
|
||||
line2Layout, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -38,11 +38,11 @@ bool MacroConditionSource::CheckCondition()
|
|||
ret = obs_source_showing(s);
|
||||
break;
|
||||
case SourceCondition::SETTINGS:
|
||||
ret = compareSourceSettings(_source.GetSource(), _settings,
|
||||
ret = CompareSourceSettings(_source.GetSource(), _settings,
|
||||
_regex);
|
||||
if (IsReferencedInVars()) {
|
||||
SetVariableValue(
|
||||
getSourceSettings(_source.GetSource()));
|
||||
GetSourceSettings(_source.GetSource()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -132,13 +132,13 @@ MacroConditionSourceEdit::MacroConditionSourceEdit(
|
|||
{"{{settings}}", _settings}, {"{{getSettings}}", _getSettings},
|
||||
{"{{regex}}", _regex},
|
||||
};
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.source.entry.line1"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.source.entry.line2"),
|
||||
line2Layout, widgetPlaceholders, false);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.source.entry.line3"),
|
||||
line3Layout, widgetPlaceholders);
|
||||
mainLayout->addLayout(line1Layout);
|
||||
|
|
@ -181,10 +181,10 @@ void MacroConditionSourceEdit::GetSettingsClicked()
|
|||
return;
|
||||
}
|
||||
|
||||
QString json = formatJsonString(
|
||||
getSourceSettings(_entryData->_source.GetSource()));
|
||||
QString json = FormatJsonString(
|
||||
GetSourceSettings(_entryData->_source.GetSource()));
|
||||
if (_entryData->_regex.Enabled()) {
|
||||
json = escapeForRegex(json);
|
||||
json = EscapeForRegex(json);
|
||||
}
|
||||
_settings->setPlainText(json);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ MacroConditionStreamEdit::MacroConditionStreamEdit(
|
|||
{"{{streamState}}", _streamState},
|
||||
};
|
||||
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.stream.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.stream.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ MacroConditionStudioModeEdit::MacroConditionStudioModeEdit(
|
|||
{"{{conditions}}", _condition},
|
||||
{"{{scenes}}", _scenes},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.studioMode.entry"),
|
||||
layout, widgetPlaceholders);
|
||||
setLayout(layout);
|
||||
|
|
|
|||
|
|
@ -169,16 +169,16 @@ MacroConditionTimerEdit::MacroConditionTimerEdit(
|
|||
{"{{reset}}", _reset},
|
||||
{"{{saveRemaining}}", _saveRemaining},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.timer.entry.line1.fixed"),
|
||||
_timerLayout, widgetPlaceholders);
|
||||
auto line2Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.timer.entry.line2"),
|
||||
line2Layout, widgetPlaceholders);
|
||||
auto line3Layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.timer.entry.line3"),
|
||||
line3Layout, widgetPlaceholders);
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ void MacroConditionTimerEdit::SetWidgetVisibility()
|
|||
_timerLayout->removeWidget(_duration);
|
||||
_timerLayout->removeWidget(_duration2);
|
||||
|
||||
clearLayout(_timerLayout);
|
||||
ClearLayout(_timerLayout);
|
||||
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{type}}", _timerTypes},
|
||||
|
|
@ -338,13 +338,13 @@ void MacroConditionTimerEdit::SetWidgetVisibility()
|
|||
};
|
||||
|
||||
if (_entryData->_type == TimerType::RANDOM) {
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.timer.entry.line1.random"),
|
||||
_timerLayout, widgetPlaceholders);
|
||||
_duration2->show();
|
||||
} else {
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.timer.entry.line1.fixed"),
|
||||
_timerLayout, widgetPlaceholders);
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ MacroConditionTransitionEdit::MacroConditionTransitionEdit(
|
|||
{"{{duration}}", _duration},
|
||||
{"{{durationSuffix}}", _durationSuffix},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.transition.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ MacroConditionVariableEdit::MacroConditionVariableEdit(
|
|||
};
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout;
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text("AdvSceneSwitcher.condition.variable.entry"),
|
||||
layout, widgetPlaceholders);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ MacroConditionVCamEdit::MacroConditionVCamEdit(
|
|||
{"{{states}}", _states},
|
||||
};
|
||||
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.virtualCamera.entry"),
|
||||
mainLayout, widgetPlaceholders);
|
||||
setLayout(mainLayout);
|
||||
|
|
|
|||
|
|
@ -154,12 +154,12 @@ void MacroConditionWebsocketEdit::SetupRequestEdit()
|
|||
{
|
||||
_editLayout->removeWidget(_conditions);
|
||||
_editLayout->removeWidget(_connection);
|
||||
clearLayout(_editLayout);
|
||||
ClearLayout(_editLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{type}}", _conditions},
|
||||
{"{{connection}}", _connection},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.websocket.entry.request"),
|
||||
_editLayout, widgetPlaceholders);
|
||||
|
|
@ -170,12 +170,12 @@ void MacroConditionWebsocketEdit::SetupEventEdit()
|
|||
{
|
||||
_editLayout->removeWidget(_conditions);
|
||||
_editLayout->removeWidget(_connection);
|
||||
clearLayout(_editLayout);
|
||||
ClearLayout(_editLayout);
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{type}}", _conditions},
|
||||
{"{{connection}}", _connection},
|
||||
};
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.websocket.entry.event"),
|
||||
_editLayout, widgetPlaceholders);
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ MacroConditionWindowEdit::MacroConditionWindowEdit(
|
|||
QWidget::connect(&_timer, SIGNAL(timeout()), this,
|
||||
SLOT(UpdateFocusWindow()));
|
||||
|
||||
populateWindowSelection(_windowSelection);
|
||||
PopulateWindowSelection(_windowSelection);
|
||||
|
||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{windows}}", _windowSelection},
|
||||
|
|
@ -144,14 +144,14 @@ MacroConditionWindowEdit::MacroConditionWindowEdit(
|
|||
};
|
||||
|
||||
auto *line1Layout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.window.entry.line1"),
|
||||
line1Layout, widgetPlaceholders);
|
||||
auto *line2Layout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.window.entry.line2"),
|
||||
line2Layout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.window.entry.line3"),
|
||||
_focusLayout, widgetPlaceholders);
|
||||
auto *mainLayout = new QVBoxLayout;
|
||||
|
|
@ -231,7 +231,7 @@ void MacroConditionWindowEdit::SetWidgetVisibility()
|
|||
if (!_entryData) {
|
||||
return;
|
||||
}
|
||||
setLayoutVisible(_focusLayout,
|
||||
SetLayoutVisible(_focusLayout,
|
||||
_entryData->_focus || _entryData->_windowFocusChanged);
|
||||
adjustSize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,12 +91,12 @@ void MacroSegmentList::Add(QWidget *widget)
|
|||
|
||||
void MacroSegmentList::Remove(int idx)
|
||||
{
|
||||
deleteLayoutItemWidget(_contentLayout->takeAt(idx));
|
||||
DeleteLayoutItemWidget(_contentLayout->takeAt(idx));
|
||||
}
|
||||
|
||||
void MacroSegmentList::Clear(int idx)
|
||||
{
|
||||
clearLayout(_contentLayout, idx);
|
||||
ClearLayout(_contentLayout, idx);
|
||||
}
|
||||
|
||||
void MacroSegmentList::Highlight(int idx, QColor color)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ MacroSelectionDialog::MacroSelectionDialog(QWidget *)
|
|||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
||||
{"{{macroSelection}}", _macroSelection},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.askForMacro"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.askForMacro"),
|
||||
selectionLayout, widgetPlaceholders);
|
||||
auto *layout = new QVBoxLayout();
|
||||
layout->addLayout(selectionLayout);
|
||||
|
|
|
|||
|
|
@ -817,9 +817,9 @@ void fade(QWidget *widget, bool fadeOut)
|
|||
auto curOpacity =
|
||||
dynamic_cast<QGraphicsOpacityEffect *>(curEffect);
|
||||
if (curOpacity &&
|
||||
((fadeOut && doubleEquals(curOpacity->opacity(),
|
||||
((fadeOut && DoubleEquals(curOpacity->opacity(),
|
||||
fadeOutOpacity, 0.0001)) ||
|
||||
(!fadeOut && doubleEquals(curOpacity->opacity(),
|
||||
(!fadeOut && DoubleEquals(curOpacity->opacity(),
|
||||
fadeInOpacity, 0.0001)))) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ MacroTreeItem::MacroTreeItem(MacroTree *tree, std::shared_ptr<Macro> macroItem,
|
|||
bool isGroup = _macro->IsGroup();
|
||||
|
||||
if (isGroup) {
|
||||
const auto path = QString::fromStdString(getDataFilePath(
|
||||
const auto path = QString::fromStdString(GetDataFilePath(
|
||||
"res/images/" + GetThemeTypeName() + "Group.svg"));
|
||||
QIcon icon(path);
|
||||
QPixmap pixmap = icon.pixmap(QSize(16, 16));
|
||||
|
|
|
|||
|
|
@ -203,15 +203,15 @@ MacroConditionOpenVREdit::MacroConditionOpenVREdit(
|
|||
{"{{zPos}}", _zPos},
|
||||
};
|
||||
QHBoxLayout *line1 = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.openvr.entry.line1"),
|
||||
line1, widgetPlaceholders);
|
||||
QHBoxLayout *line2 = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.openvr.entry.line2"),
|
||||
line2, widgetPlaceholders);
|
||||
QHBoxLayout *line3 = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.openvr.entry.line3"),
|
||||
line3, widgetPlaceholders);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
|
|
|||
|
|
@ -575,24 +575,24 @@ MacroConditionVideoEdit::MacroConditionVideoEdit(
|
|||
{"{{textType}}", _pageSegMode},
|
||||
{"{{patternMatchingModes}}", _patternMatchMode},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.condition.video.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.condition.video.entry"),
|
||||
entryLine1Layout, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.patternMatchMode"),
|
||||
_patternMatchModeLayout, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.entry.modelPath"),
|
||||
_modelPathLayout, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.entry.minNeighbor"),
|
||||
_neighborsControlLayout, widgetPlaceholders);
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.entry.throttle"),
|
||||
_throttleControlLayout, widgetPlaceholders);
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.entry.checkArea"),
|
||||
_checkAreaControlLayout, widgetPlaceholders);
|
||||
|
|
@ -603,13 +603,13 @@ MacroConditionVideoEdit::MacroConditionVideoEdit(
|
|||
regexLayout->addStretch();
|
||||
_ocrLayout->addLayout(regexLayout);
|
||||
auto pageModeSegLayout = new QHBoxLayout();
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.entry.orcTextType"),
|
||||
pageModeSegLayout, widgetPlaceholders);
|
||||
_ocrLayout->addLayout(pageModeSegLayout);
|
||||
auto colorPickLayout = new QHBoxLayout();
|
||||
placeWidgets(
|
||||
PlaceWidgets(
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.condition.video.entry.orcColorPick"),
|
||||
colorPickLayout, widgetPlaceholders);
|
||||
|
|
@ -1203,7 +1203,7 @@ void MacroConditionVideoEdit::SetWidgetVisibility()
|
|||
_patternThreshold->setVisible(needsThreshold(_entryData->_condition));
|
||||
_useAlphaAsMask->setVisible(_entryData->_condition ==
|
||||
VideoCondition::PATTERN);
|
||||
setLayoutVisible(_patternMatchModeLayout,
|
||||
SetLayoutVisible(_patternMatchModeLayout,
|
||||
_entryData->_condition == VideoCondition::PATTERN);
|
||||
_brightnessThreshold->setVisible(_entryData->_condition ==
|
||||
VideoCondition::BRIGHTNESS);
|
||||
|
|
@ -1212,19 +1212,19 @@ void MacroConditionVideoEdit::SetWidgetVisibility()
|
|||
_showMatch->setVisible(needsShowMatch(_entryData->_condition));
|
||||
_objectScaleThreshold->setVisible(
|
||||
needsObjectControls(_entryData->_condition));
|
||||
setLayoutVisible(_neighborsControlLayout,
|
||||
SetLayoutVisible(_neighborsControlLayout,
|
||||
needsObjectControls(_entryData->_condition));
|
||||
_minNeighborsDescription->setVisible(
|
||||
needsObjectControls(_entryData->_condition));
|
||||
setLayoutVisible(_ocrLayout,
|
||||
SetLayoutVisible(_ocrLayout,
|
||||
_entryData->_condition == VideoCondition::OCR);
|
||||
setLayoutVisible(_sizeLayout,
|
||||
SetLayoutVisible(_sizeLayout,
|
||||
needsObjectControls(_entryData->_condition));
|
||||
setLayoutVisible(_modelPathLayout,
|
||||
SetLayoutVisible(_modelPathLayout,
|
||||
needsObjectControls(_entryData->_condition));
|
||||
setLayoutVisible(_throttleControlLayout,
|
||||
SetLayoutVisible(_throttleControlLayout,
|
||||
needsThrottleControls(_entryData->_condition));
|
||||
setLayoutVisible(_checkAreaControlLayout,
|
||||
SetLayoutVisible(_checkAreaControlLayout,
|
||||
needsAreaControls(_entryData->_condition));
|
||||
_checkArea->setVisible(_entryData->_areaParameters.enable);
|
||||
_selectArea->setVisible(_entryData->_areaParameters.enable);
|
||||
|
|
@ -1233,7 +1233,7 @@ void MacroConditionVideoEdit::SetWidgetVisibility()
|
|||
_entryData->_condition == VideoCondition::HAS_NOT_CHANGED) {
|
||||
_patternThreshold->setVisible(
|
||||
_entryData->_patternMatchParameters.useForChangedCheck);
|
||||
setLayoutVisible(
|
||||
SetLayoutVisible(
|
||||
_patternMatchModeLayout,
|
||||
_entryData->_patternMatchParameters.useForChangedCheck);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ StatusDock::StatusDock(QWidget *parent) : OBSDock(parent)
|
|||
QAction *action = new QAction;
|
||||
action->setProperty("themeID", QVariant(QString::fromUtf8("cogsIcon")));
|
||||
action->connect(action, &QAction::triggered, OpenSettingsWindow);
|
||||
const auto path = QString::fromStdString(getDataFilePath(
|
||||
const auto path = QString::fromStdString(GetDataFilePath(
|
||||
"res/images/" + GetThemeTypeName() + "Advanced.svg"));
|
||||
QIcon icon(path);
|
||||
action->setIcon(icon);
|
||||
|
|
|
|||
|
|
@ -353,13 +353,13 @@ void ConnectionSettingsDialog::SetStatus()
|
|||
|
||||
void ConnectionSettingsDialog::ShowPassword()
|
||||
{
|
||||
setButtonIcon(_showPassword, ":res/images/visible.svg");
|
||||
SetButtonIcon(_showPassword, ":res/images/visible.svg");
|
||||
_password->setEchoMode(QLineEdit::Normal);
|
||||
}
|
||||
|
||||
void ConnectionSettingsDialog::HidePassword()
|
||||
{
|
||||
setButtonIcon(_showPassword, ":res/images/invisible.svg");
|
||||
SetButtonIcon(_showPassword, ":res/images/invisible.svg");
|
||||
_password->setEchoMode(QLineEdit::PasswordEchoOnEdit);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ ItemSelection::ItemSelection(std::deque<std::shared_ptr<Item>> &items,
|
|||
_addStr(add)
|
||||
{
|
||||
_modify->setMaximumWidth(22);
|
||||
setButtonIcon(_modify, ":/settings/images/settings/general.svg");
|
||||
SetButtonIcon(_modify, ":/settings/images/settings/general.svg");
|
||||
_modify->setFlat(true);
|
||||
|
||||
// Connect to slots
|
||||
|
|
@ -77,7 +77,7 @@ ItemSelection::ItemSelection(std::deque<std::shared_ptr<Item>> &items,
|
|||
_selection->addItem(QString::fromStdString(i->_name));
|
||||
}
|
||||
_selection->model()->sort(0);
|
||||
addSelectionEntry(_selection, obs_module_text(_selectStr.data()));
|
||||
AddSelectionEntry(_selection, obs_module_text(_selectStr.data()));
|
||||
_selection->insertSeparator(_selection->count());
|
||||
_selection->addItem(obs_module_text(_addStr.data()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ int MacroList::FindEntry(const std::string ¯o)
|
|||
|
||||
void MacroList::SetMacroListSize()
|
||||
{
|
||||
setHeightToContentHeight(_list);
|
||||
SetHeightToContentHeight(_list);
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ ProcessConfigEdit::ProcessConfigEdit(QWidget *parent)
|
|||
{"{{workingDirectory}}", _workingDirectory},
|
||||
{"{{advancedSettings}}", _showAdvancedSettings},
|
||||
};
|
||||
placeWidgets(obs_module_text("AdvSceneSwitcher.process.entry"),
|
||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.process.entry"),
|
||||
entryLayout, widgetPlaceholders, false);
|
||||
|
||||
auto workingDirectoryLayout = new QHBoxLayout;
|
||||
placeWidgets(obs_module_text(
|
||||
PlaceWidgets(obs_module_text(
|
||||
"AdvSceneSwitcher.process.entry.workingDirectory"),
|
||||
workingDirectoryLayout, widgetPlaceholders, false);
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ void ProcessConfigEdit::ArgsChanged(const StringList &args)
|
|||
|
||||
void ProcessConfigEdit::ShowAdvancedSettings(bool showAdvancedSettings)
|
||||
{
|
||||
setLayoutVisible(_advancedSettingsLayout, showAdvancedSettings);
|
||||
SetLayoutVisible(_advancedSettingsLayout, showAdvancedSettings);
|
||||
_showAdvancedSettings->setVisible(!showAdvancedSettings);
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ RegexConfigWidget::RegexConfigWidget(QWidget *parent)
|
|||
obs_module_text("AdvSceneSwitcher.regex.enable")))
|
||||
{
|
||||
_openSettings->setMaximumWidth(22);
|
||||
setButtonIcon(_openSettings, ":/settings/images/settings/general.svg");
|
||||
SetButtonIcon(_openSettings, ":/settings/images/settings/general.svg");
|
||||
_openSettings->setFlat(true);
|
||||
|
||||
QWidget::connect(_enable, SIGNAL(stateChanged(int)), this,
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ void populateSceneItemSelection(QComboBox *list)
|
|||
names.removeDuplicates();
|
||||
names.sort();
|
||||
list->addItems(names);
|
||||
addSelectionEntry(list, obs_module_text("AdvSceneSwitcher.selectItem"));
|
||||
AddSelectionEntry(list, obs_module_text("AdvSceneSwitcher.selectItem"));
|
||||
list->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
|
@ -265,16 +265,16 @@ void SceneItemSelectionWidget::Reset()
|
|||
void SceneItemSelectionWidget::PopulateItemSelection()
|
||||
{
|
||||
_sceneItems->clear();
|
||||
addSelectionEntry(_sceneItems,
|
||||
AddSelectionEntry(_sceneItems,
|
||||
obs_module_text("AdvSceneSwitcher.selectItem"));
|
||||
_sceneItems->insertSeparator(_sceneItems->count());
|
||||
|
||||
const QStringList variables = GetVariablesNameList();
|
||||
addSelectionGroup(_sceneItems, variables);
|
||||
AddSelectionGroup(_sceneItems, variables);
|
||||
_variablesEndIdx = _sceneItems->count();
|
||||
|
||||
const QStringList sceneItmes = GetSceneItemsList(_scene);
|
||||
addSelectionGroup(_sceneItems, sceneItmes, false);
|
||||
AddSelectionGroup(_sceneItems, sceneItmes, false);
|
||||
_itemsEndIdx = _sceneItems->count();
|
||||
_sceneItems->setCurrentIndex(0);
|
||||
}
|
||||
|
|
@ -325,7 +325,7 @@ void SceneItemSelectionWidget::SetSceneItem(const SceneItemSelection &item)
|
|||
idx += 1;
|
||||
}
|
||||
_idx->setCurrentIndex(idx);
|
||||
itemIdx = findIdxInRagne(_sceneItems, _variablesEndIdx,
|
||||
itemIdx = FindIdxInRagne(_sceneItems, _variablesEndIdx,
|
||||
_itemsEndIdx,
|
||||
GetWeakSourceName(item._sceneItem));
|
||||
_sceneItems->setCurrentIndex(itemIdx);
|
||||
|
|
@ -337,7 +337,7 @@ void SceneItemSelectionWidget::SetSceneItem(const SceneItemSelection &item)
|
|||
if (!var) {
|
||||
break;
|
||||
}
|
||||
itemIdx = findIdxInRagne(_sceneItems, _selectIdx,
|
||||
itemIdx = FindIdxInRagne(_sceneItems, _selectIdx,
|
||||
_variablesEndIdx, var->Name());
|
||||
_sceneItems->setCurrentIndex(itemIdx);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -251,31 +251,31 @@ void SceneSelectionWidget::Reset()
|
|||
void SceneSelectionWidget::PopulateSelection()
|
||||
{
|
||||
clear();
|
||||
addSelectionEntry(this,
|
||||
AddSelectionEntry(this,
|
||||
obs_module_text("AdvSceneSwitcher.selectScene"));
|
||||
insertSeparator(count());
|
||||
|
||||
if (_current || _previous) {
|
||||
const QStringList order =
|
||||
getOrderList(_current, _previous, _preview);
|
||||
addSelectionGroup(this, order);
|
||||
AddSelectionGroup(this, order);
|
||||
}
|
||||
_placeholderEndIdx = count();
|
||||
|
||||
if (_variables) {
|
||||
const QStringList variables = GetVariablesNameList();
|
||||
addSelectionGroup(this, variables);
|
||||
AddSelectionGroup(this, variables);
|
||||
}
|
||||
_variablesEndIdx = count();
|
||||
|
||||
if (_sceneGroups) {
|
||||
const QStringList sceneGroups = getSceneGroupsList();
|
||||
addSelectionGroup(this, sceneGroups);
|
||||
AddSelectionGroup(this, sceneGroups);
|
||||
}
|
||||
_groupsEndIdx = count();
|
||||
|
||||
const QStringList scenes = getScenesList();
|
||||
addSelectionGroup(this, scenes);
|
||||
AddSelectionGroup(this, scenes);
|
||||
_scenesEndIdx = count();
|
||||
|
||||
// Remove last separator
|
||||
|
|
@ -330,7 +330,7 @@ void SceneSelectionWidget::SetScene(const SceneSelection &s)
|
|||
idx = 0;
|
||||
break;
|
||||
}
|
||||
idx = findIdxInRagne(this, _groupsEndIdx, _scenesEndIdx,
|
||||
idx = FindIdxInRagne(this, _groupsEndIdx, _scenesEndIdx,
|
||||
s.ToString());
|
||||
break;
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ void SceneSelectionWidget::SetScene(const SceneSelection &s)
|
|||
idx = 0;
|
||||
break;
|
||||
}
|
||||
idx = findIdxInRagne(this, _variablesEndIdx, _groupsEndIdx,
|
||||
idx = FindIdxInRagne(this, _variablesEndIdx, _groupsEndIdx,
|
||||
s.ToString());
|
||||
break;
|
||||
}
|
||||
|
|
@ -349,7 +349,7 @@ void SceneSelectionWidget::SetScene(const SceneSelection &s)
|
|||
break;
|
||||
}
|
||||
|
||||
idx = findIdxInRagne(
|
||||
idx = FindIdxInRagne(
|
||||
this, _selectIdx, _placeholderEndIdx,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.selectPreviousScene"));
|
||||
|
|
@ -361,7 +361,7 @@ void SceneSelectionWidget::SetScene(const SceneSelection &s)
|
|||
break;
|
||||
}
|
||||
|
||||
idx = findIdxInRagne(
|
||||
idx = FindIdxInRagne(
|
||||
this, _selectIdx, _placeholderEndIdx,
|
||||
obs_module_text("AdvSceneSwitcher.selectCurrentScene"));
|
||||
break;
|
||||
|
|
@ -372,7 +372,7 @@ void SceneSelectionWidget::SetScene(const SceneSelection &s)
|
|||
break;
|
||||
}
|
||||
|
||||
idx = findIdxInRagne(
|
||||
idx = FindIdxInRagne(
|
||||
this, _selectIdx, _placeholderEndIdx,
|
||||
obs_module_text("AdvSceneSwitcher.selectPreviewScene"));
|
||||
break;
|
||||
|
|
@ -382,7 +382,7 @@ void SceneSelectionWidget::SetScene(const SceneSelection &s)
|
|||
idx = 0;
|
||||
break;
|
||||
}
|
||||
idx = findIdxInRagne(this, _placeholderEndIdx, _variablesEndIdx,
|
||||
idx = FindIdxInRagne(this, _placeholderEndIdx, _variablesEndIdx,
|
||||
s.ToString());
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void Section::CleanUpPreviousContent()
|
|||
if (_contentArea) {
|
||||
auto oldLayout = _contentArea->layout();
|
||||
if (oldLayout) {
|
||||
clearLayout(oldLayout);
|
||||
ClearLayout(oldLayout);
|
||||
delete oldLayout;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,17 +131,17 @@ void SourceSelectionWidget::Reset()
|
|||
void SourceSelectionWidget::PopulateSelection()
|
||||
{
|
||||
clear();
|
||||
addSelectionEntry(this,
|
||||
AddSelectionEntry(this,
|
||||
obs_module_text("AdvSceneSwitcher.selectSource"));
|
||||
insertSeparator(count());
|
||||
|
||||
if (_addVariables) {
|
||||
const QStringList variables = GetVariablesNameList();
|
||||
addSelectionGroup(this, variables);
|
||||
AddSelectionGroup(this, variables);
|
||||
}
|
||||
_variablesEndIdx = count();
|
||||
|
||||
addSelectionGroup(this, _sourceNames);
|
||||
AddSelectionGroup(this, _sourceNames);
|
||||
_sourcesEndIdx = count();
|
||||
|
||||
// Remove last separator
|
||||
|
|
@ -183,7 +183,7 @@ void SourceSelectionWidget::SetSource(const SourceSelection &s)
|
|||
idx = 0;
|
||||
break;
|
||||
}
|
||||
idx = findIdxInRagne(this, _variablesEndIdx, _sourcesEndIdx,
|
||||
idx = FindIdxInRagne(this, _variablesEndIdx, _sourcesEndIdx,
|
||||
s.ToString());
|
||||
break;
|
||||
}
|
||||
|
|
@ -192,7 +192,7 @@ void SourceSelectionWidget::SetSource(const SourceSelection &s)
|
|||
idx = 0;
|
||||
break;
|
||||
}
|
||||
idx = findIdxInRagne(this, _selectIdx, _variablesEndIdx,
|
||||
idx = FindIdxInRagne(this, _selectIdx, _variablesEndIdx,
|
||||
s.ToString());
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ void StringListEdit::Clicked(QListWidgetItem *item)
|
|||
|
||||
void StringListEdit::SetListSize()
|
||||
{
|
||||
setHeightToContentHeight(_list);
|
||||
SetHeightToContentHeight(_list);
|
||||
adjustSize();
|
||||
updateGeometry();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ TransitionSelectionWidget::TransitionSelectionWidget(QWidget *parent,
|
|||
: QComboBox(parent)
|
||||
{
|
||||
setDuplicatesEnabled(true);
|
||||
populateTransitionSelection(this, current, any);
|
||||
PopulateTransitionSelection(this, current, any);
|
||||
|
||||
QWidget::connect(this, SIGNAL(currentTextChanged(const QString &)),
|
||||
this, SLOT(SelectionChanged(const QString &)));
|
||||
|
|
@ -114,7 +114,7 @@ void TransitionSelectionWidget::Repopulate(bool current, bool any)
|
|||
{
|
||||
const QSignalBlocker blocker(this);
|
||||
clear();
|
||||
populateTransitionSelection(this, current, any);
|
||||
PopulateTransitionSelection(this, current, any);
|
||||
setCurrentIndex(0);
|
||||
}
|
||||
TransitionSelection t;
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ std::pair<double, double> getSceneItemSize(obs_scene_item *item)
|
|||
return size;
|
||||
}
|
||||
|
||||
std::string getSceneItemTransform(obs_scene_item *item)
|
||||
std::string GetSceneItemTransform(obs_scene_item *item)
|
||||
{
|
||||
struct obs_transform_info info;
|
||||
struct obs_sceneitem_crop crop;
|
||||
|
|
@ -166,7 +166,7 @@ std::string getSceneItemTransform(obs_scene_item *item)
|
|||
auto size = getSceneItemSize(item);
|
||||
|
||||
auto data = obs_data_create();
|
||||
saveTransformState(data, info, crop);
|
||||
SaveTransformState(data, info, crop);
|
||||
obs_data_t *obj = obs_data_create();
|
||||
obs_data_set_double(obj, "width", size.first * info.scale.x);
|
||||
obs_data_set_double(obj, "height", size.second * info.scale.y);
|
||||
|
|
@ -177,7 +177,7 @@ std::string getSceneItemTransform(obs_scene_item *item)
|
|||
return json;
|
||||
}
|
||||
|
||||
void placeWidgets(std::string text, QBoxLayout *layout,
|
||||
void PlaceWidgets(std::string text, QBoxLayout *layout,
|
||||
std::unordered_map<std::string, QWidget *> placeholders,
|
||||
bool addStretch)
|
||||
{
|
||||
|
|
@ -211,7 +211,7 @@ void placeWidgets(std::string text, QBoxLayout *layout,
|
|||
}
|
||||
}
|
||||
|
||||
void deleteLayoutItemWidget(QLayoutItem *item)
|
||||
void DeleteLayoutItemWidget(QLayoutItem *item)
|
||||
{
|
||||
if (item) {
|
||||
auto widget = item->widget();
|
||||
|
|
@ -223,19 +223,19 @@ void deleteLayoutItemWidget(QLayoutItem *item)
|
|||
}
|
||||
}
|
||||
|
||||
void clearLayout(QLayout *layout, int afterIdx)
|
||||
void ClearLayout(QLayout *layout, int afterIdx)
|
||||
{
|
||||
QLayoutItem *item;
|
||||
while ((item = layout->takeAt(afterIdx))) {
|
||||
if (item->layout()) {
|
||||
clearLayout(item->layout());
|
||||
ClearLayout(item->layout());
|
||||
delete item->layout();
|
||||
}
|
||||
deleteLayoutItemWidget(item);
|
||||
DeleteLayoutItemWidget(item);
|
||||
}
|
||||
}
|
||||
|
||||
void setLayoutVisible(QLayout *layout, bool visible)
|
||||
void SetLayoutVisible(QLayout *layout, bool visible)
|
||||
{
|
||||
if (!layout) {
|
||||
return;
|
||||
|
|
@ -247,7 +247,7 @@ void setLayoutVisible(QLayout *layout, bool visible)
|
|||
widget->setVisible(visible);
|
||||
}
|
||||
if (nestedLayout) {
|
||||
setLayoutVisible(nestedLayout, visible);
|
||||
SetLayoutVisible(nestedLayout, visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -282,7 +282,7 @@ void MinimizeSizeOfColumn(QGridLayout *layout, int idx)
|
|||
layout->setColumnMinimumWidth(idx, columnWidth);
|
||||
}
|
||||
|
||||
bool compareIgnoringLineEnding(QString &s1, QString &s2)
|
||||
bool CompareIgnoringLineEnding(QString &s1, QString &s2)
|
||||
{
|
||||
// Let QT deal with different types of lineendings
|
||||
QTextStream s1stream(&s1);
|
||||
|
|
@ -303,7 +303,7 @@ bool compareIgnoringLineEnding(QString &s1, QString &s2)
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string getSourceSettings(OBSWeakSource ws)
|
||||
std::string GetSourceSettings(OBSWeakSource ws)
|
||||
{
|
||||
if (!ws) {
|
||||
return "";
|
||||
|
|
@ -322,7 +322,7 @@ std::string getSourceSettings(OBSWeakSource ws)
|
|||
return settings;
|
||||
}
|
||||
|
||||
void setSourceSettings(obs_source_t *s, const std::string &settings)
|
||||
void SetSourceSettings(obs_source_t *s, const std::string &settings)
|
||||
{
|
||||
if (settings.empty()) {
|
||||
return;
|
||||
|
|
@ -339,11 +339,11 @@ void setSourceSettings(obs_source_t *s, const std::string &settings)
|
|||
}
|
||||
|
||||
// Match json1 with pattern json2
|
||||
bool matchJson(const std::string &json1, const std::string &json2,
|
||||
bool MatchJson(const std::string &json1, const std::string &json2,
|
||||
const RegexConfig ®ex)
|
||||
{
|
||||
auto j1 = formatJsonString(json1).toStdString();
|
||||
auto j2 = formatJsonString(json2).toStdString();
|
||||
auto j1 = FormatJsonString(json1).toStdString();
|
||||
auto j2 = FormatJsonString(json2).toStdString();
|
||||
|
||||
if (j1.empty()) {
|
||||
j1 = json1;
|
||||
|
|
@ -363,15 +363,15 @@ bool matchJson(const std::string &json1, const std::string &json2,
|
|||
return j1 == j2;
|
||||
}
|
||||
|
||||
bool compareSourceSettings(const OBSWeakSource &source,
|
||||
bool CompareSourceSettings(const OBSWeakSource &source,
|
||||
const std::string &settings,
|
||||
const RegexConfig ®ex)
|
||||
{
|
||||
std::string currentSettings = getSourceSettings(source);
|
||||
return matchJson(currentSettings, settings, regex);
|
||||
std::string currentSettings = GetSourceSettings(source);
|
||||
return MatchJson(currentSettings, settings, regex);
|
||||
}
|
||||
|
||||
std::string getDataFilePath(const std::string &file)
|
||||
std::string GetDataFilePath(const std::string &file)
|
||||
{
|
||||
std::string root_path = obs_get_module_data_path(obs_current_module());
|
||||
if (!root_path.empty()) {
|
||||
|
|
@ -380,18 +380,18 @@ std::string getDataFilePath(const std::string &file)
|
|||
return "";
|
||||
}
|
||||
|
||||
QString formatJsonString(std::string s)
|
||||
QString FormatJsonString(std::string s)
|
||||
{
|
||||
return formatJsonString(QString::fromStdString(s));
|
||||
return FormatJsonString(QString::fromStdString(s));
|
||||
}
|
||||
|
||||
QString formatJsonString(QString json)
|
||||
QString FormatJsonString(QString json)
|
||||
{
|
||||
QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8());
|
||||
return QString::fromUtf8(doc.toJson(QJsonDocument::Indented));
|
||||
}
|
||||
|
||||
QString escapeForRegex(QString &s)
|
||||
QString EscapeForRegex(QString &s)
|
||||
{
|
||||
std::regex specialChars{R"([-[\]{}()*+?.,\^$|#\s])"};
|
||||
std::string input = s.toStdString();
|
||||
|
|
@ -399,7 +399,7 @@ QString escapeForRegex(QString &s)
|
|||
std::regex_replace(input, specialChars, R"(\$&)"));
|
||||
}
|
||||
|
||||
void loadTransformState(obs_data_t *obj, struct obs_transform_info &info,
|
||||
void LoadTransformState(obs_data_t *obj, struct obs_transform_info &info,
|
||||
struct obs_sceneitem_crop &crop)
|
||||
{
|
||||
obs_data_get_vec2(obj, "pos", &info.pos);
|
||||
|
|
@ -417,7 +417,7 @@ void loadTransformState(obs_data_t *obj, struct obs_transform_info &info,
|
|||
crop.right = (int)obs_data_get_int(obj, "right");
|
||||
}
|
||||
|
||||
bool saveTransformState(obs_data_t *obj, const struct obs_transform_info &info,
|
||||
bool SaveTransformState(obs_data_t *obj, const struct obs_transform_info &info,
|
||||
const struct obs_sceneitem_crop &crop)
|
||||
{
|
||||
struct vec2 pos = info.pos;
|
||||
|
|
@ -476,7 +476,7 @@ void DisplayTrayMessage(const QString &title, const QString &msg)
|
|||
tray->showMessage(title, msg);
|
||||
}
|
||||
|
||||
void addSelectionEntry(QComboBox *sel, const char *description, bool selectable,
|
||||
void AddSelectionEntry(QComboBox *sel, const char *description, bool selectable,
|
||||
const char *tooltip)
|
||||
{
|
||||
sel->insertItem(0, description);
|
||||
|
|
@ -510,21 +510,21 @@ QStringList GetSourceNames()
|
|||
return list;
|
||||
}
|
||||
|
||||
void populateSourceSelection(QComboBox *list, bool addSelect)
|
||||
void PopulateSourceSelection(QComboBox *list, bool addSelect)
|
||||
{
|
||||
auto sources = GetSourceNames();
|
||||
sources.sort();
|
||||
list->addItems(sources);
|
||||
|
||||
if (addSelect) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
list, obs_module_text("AdvSceneSwitcher.selectSource"),
|
||||
false);
|
||||
}
|
||||
list->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void populateTransitionSelection(QComboBox *sel, bool addCurrent, bool addAny)
|
||||
void PopulateTransitionSelection(QComboBox *sel, bool addCurrent, bool addAny)
|
||||
{
|
||||
|
||||
obs_frontend_source_list *transitions = new obs_frontend_source_list();
|
||||
|
|
@ -540,7 +540,7 @@ void populateTransitionSelection(QComboBox *sel, bool addCurrent, bool addAny)
|
|||
|
||||
sel->model()->sort(0);
|
||||
|
||||
addSelectionEntry(sel,
|
||||
AddSelectionEntry(sel,
|
||||
obs_module_text("AdvSceneSwitcher.selectTransition"));
|
||||
sel->setCurrentIndex(0);
|
||||
|
||||
|
|
@ -555,7 +555,7 @@ void populateTransitionSelection(QComboBox *sel, bool addCurrent, bool addAny)
|
|||
}
|
||||
}
|
||||
|
||||
void populateWindowSelection(QComboBox *sel, bool addSelect)
|
||||
void PopulateWindowSelection(QComboBox *sel, bool addSelect)
|
||||
{
|
||||
|
||||
std::vector<std::string> windows;
|
||||
|
|
@ -567,7 +567,7 @@ void populateWindowSelection(QComboBox *sel, bool addSelect)
|
|||
|
||||
sel->model()->sort(0);
|
||||
if (addSelect) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
sel, obs_module_text("AdvSceneSwitcher.selectWindow"));
|
||||
}
|
||||
sel->setCurrentIndex(0);
|
||||
|
|
@ -595,14 +595,14 @@ QStringList GetAudioSourceNames()
|
|||
return list;
|
||||
}
|
||||
|
||||
void populateAudioSelection(QComboBox *sel, bool addSelect)
|
||||
void PopulateAudioSelection(QComboBox *sel, bool addSelect)
|
||||
{
|
||||
auto sources = GetAudioSourceNames();
|
||||
sources.sort();
|
||||
sel->addItems(sources);
|
||||
|
||||
if (addSelect) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
sel,
|
||||
obs_module_text("AdvSceneSwitcher.selectAudioSource"),
|
||||
false,
|
||||
|
|
@ -649,7 +649,7 @@ void populateVideoSelection(QComboBox *sel, bool addMainOutput, bool addScenes,
|
|||
0, obs_module_text("AdvSceneSwitcher.OBSVideoOutput"));
|
||||
}
|
||||
if (addSelect) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
sel,
|
||||
obs_module_text("AdvSceneSwitcher.selectVideoSource"),
|
||||
false,
|
||||
|
|
@ -678,14 +678,14 @@ QStringList GetMediaSourceNames()
|
|||
return list;
|
||||
}
|
||||
|
||||
void populateMediaSelection(QComboBox *sel, bool addSelect)
|
||||
void PopulateMediaSelection(QComboBox *sel, bool addSelect)
|
||||
{
|
||||
auto sources = GetMediaSourceNames();
|
||||
sources.sort();
|
||||
sel->addItems(sources);
|
||||
|
||||
if (addSelect) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
sel,
|
||||
obs_module_text("AdvSceneSwitcher.selectMediaSource"),
|
||||
false,
|
||||
|
|
@ -695,7 +695,7 @@ void populateMediaSelection(QComboBox *sel, bool addSelect)
|
|||
sel->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void populateProcessSelection(QComboBox *sel, bool addSelect)
|
||||
void PopulateProcessSelection(QComboBox *sel, bool addSelect)
|
||||
{
|
||||
QStringList processes;
|
||||
GetProcessList(processes);
|
||||
|
|
@ -706,7 +706,7 @@ void populateProcessSelection(QComboBox *sel, bool addSelect)
|
|||
|
||||
sel->model()->sort(0);
|
||||
if (addSelect) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
sel, obs_module_text("AdvSceneSwitcher.selectProcess"));
|
||||
}
|
||||
sel->setCurrentIndex(0);
|
||||
|
|
@ -726,7 +726,7 @@ QStringList GetSceneNames()
|
|||
return list;
|
||||
}
|
||||
|
||||
void populateSceneSelection(QComboBox *sel, bool addPrevious, bool addCurrent,
|
||||
void PopulateSceneSelection(QComboBox *sel, bool addPrevious, bool addCurrent,
|
||||
bool addAny, bool addSceneGroup,
|
||||
std::deque<SceneGroup> *sceneGroups, bool addSelect,
|
||||
std::string selectText, bool selectable)
|
||||
|
|
@ -743,14 +743,14 @@ void populateSceneSelection(QComboBox *sel, bool addPrevious, bool addCurrent,
|
|||
sel->model()->sort(0);
|
||||
if (addSelect) {
|
||||
if (selectText.empty()) {
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
sel,
|
||||
obs_module_text("AdvSceneSwitcher.selectScene"),
|
||||
selectable,
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.invaildEntriesWillNotBeSaved"));
|
||||
} else {
|
||||
addSelectionEntry(sel, selectText.c_str(), selectable);
|
||||
AddSelectionEntry(sel, selectText.c_str(), selectable);
|
||||
}
|
||||
}
|
||||
sel->setCurrentIndex(0);
|
||||
|
|
@ -802,17 +802,17 @@ QStringList GetSourcesWithFilterNames()
|
|||
return list;
|
||||
}
|
||||
|
||||
void populateSourcesWithFilterSelection(QComboBox *list)
|
||||
void PopulateSourcesWithFilterSelection(QComboBox *list)
|
||||
{
|
||||
auto sources = GetSourcesWithFilterNames();
|
||||
sources.sort();
|
||||
list->addItems(sources);
|
||||
addSelectionEntry(list,
|
||||
AddSelectionEntry(list,
|
||||
obs_module_text("AdvSceneSwitcher.selectSource"));
|
||||
list->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void populateFilterSelection(QComboBox *list, OBSWeakSource weakSource)
|
||||
void PopulateFilterSelection(QComboBox *list, OBSWeakSource weakSource)
|
||||
{
|
||||
auto enumFilters = [](obs_source_t *, obs_source_t *filter, void *ptr) {
|
||||
QComboBox *list = reinterpret_cast<QComboBox *>(ptr);
|
||||
|
|
@ -823,7 +823,7 @@ void populateFilterSelection(QComboBox *list, OBSWeakSource weakSource)
|
|||
auto s = obs_weak_source_get_source(weakSource);
|
||||
obs_source_enum_filters(s, enumFilters, list);
|
||||
list->model()->sort(0);
|
||||
addSelectionEntry(list,
|
||||
AddSelectionEntry(list,
|
||||
obs_module_text("AdvSceneSwitcher.selectFilter"));
|
||||
obs_source_release(s);
|
||||
list->setCurrentIndex(0);
|
||||
|
|
@ -849,7 +849,7 @@ void populateTypeList(std::set<QString> &list,
|
|||
}
|
||||
}
|
||||
|
||||
void populateSourceGroupSelection(QComboBox *list)
|
||||
void PopulateSourceGroupSelection(QComboBox *list)
|
||||
{
|
||||
std::set<QString> sourceTypes;
|
||||
populateTypeList(sourceTypes, obs_enum_source_types);
|
||||
|
|
@ -869,11 +869,11 @@ void populateSourceGroupSelection(QComboBox *list)
|
|||
}
|
||||
|
||||
list->model()->sort(0);
|
||||
addSelectionEntry(list, obs_module_text("AdvSceneSwitcher.selectItem"));
|
||||
AddSelectionEntry(list, obs_module_text("AdvSceneSwitcher.selectItem"));
|
||||
list->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void populateProfileSelection(QComboBox *box)
|
||||
void PopulateProfileSelection(QComboBox *box)
|
||||
{
|
||||
auto profiles = obs_frontend_get_profiles();
|
||||
char **temp = profiles;
|
||||
|
|
@ -884,12 +884,12 @@ void populateProfileSelection(QComboBox *box)
|
|||
}
|
||||
bfree(profiles);
|
||||
box->model()->sort(0);
|
||||
addSelectionEntry(
|
||||
AddSelectionEntry(
|
||||
box, obs_module_text("AdvSceneSwitcher.selectProfile"), false);
|
||||
box->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void populateMonitorTypeSelection(QComboBox *list)
|
||||
void PopulateMonitorTypeSelection(QComboBox *list)
|
||||
{
|
||||
list->addItem(obs_module_text("AdvSceneSwitcher.audio.monitor.none"));
|
||||
list->addItem(
|
||||
|
|
@ -897,7 +897,7 @@ void populateMonitorTypeSelection(QComboBox *list)
|
|||
list->addItem(obs_module_text("AdvSceneSwitcher.audio.monitor.both"));
|
||||
}
|
||||
|
||||
bool windowPosValid(QPoint pos)
|
||||
bool WindowPosValid(QPoint pos)
|
||||
{
|
||||
return !!QGuiApplication::screenAt(pos);
|
||||
}
|
||||
|
|
@ -1017,7 +1017,7 @@ bool listMoveDown(QListWidget *list)
|
|||
return true;
|
||||
}
|
||||
|
||||
void setHeightToContentHeight(QListWidget *list)
|
||||
void SetHeightToContentHeight(QListWidget *list)
|
||||
{
|
||||
auto nrItems = list->count();
|
||||
if (nrItems == 0) {
|
||||
|
|
@ -1028,12 +1028,12 @@ void setHeightToContentHeight(QListWidget *list)
|
|||
}
|
||||
}
|
||||
|
||||
bool doubleEquals(double left, double right, double epsilon)
|
||||
bool DoubleEquals(double left, double right, double epsilon)
|
||||
{
|
||||
return (fabs(left - right) < epsilon);
|
||||
}
|
||||
|
||||
void setButtonIcon(QPushButton *button, const char *path)
|
||||
void SetButtonIcon(QPushButton *button, const char *path)
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(QString::fromUtf8(path), QSize(), QIcon::Normal,
|
||||
|
|
@ -1041,7 +1041,7 @@ void setButtonIcon(QPushButton *button, const char *path)
|
|||
button->setIcon(icon);
|
||||
}
|
||||
|
||||
void addSelectionGroup(QComboBox *selection, const QStringList &group,
|
||||
void AddSelectionGroup(QComboBox *selection, const QStringList &group,
|
||||
bool addSeparator)
|
||||
{
|
||||
selection->addItems(group);
|
||||
|
|
@ -1050,7 +1050,7 @@ void addSelectionGroup(QComboBox *selection, const QStringList &group,
|
|||
}
|
||||
}
|
||||
|
||||
int findIdxInRagne(QComboBox *list, int start, int stop,
|
||||
int FindIdxInRagne(QComboBox *list, int start, int stop,
|
||||
const std::string &value)
|
||||
{
|
||||
if (value.empty()) {
|
||||
|
|
@ -1071,13 +1071,13 @@ int findIdxInRagne(QComboBox *list, int start, int stop,
|
|||
return foundIdx;
|
||||
}
|
||||
|
||||
std::pair<int, int> getCursorPos()
|
||||
std::pair<int, int> GetCursorPos()
|
||||
{
|
||||
auto cursorPos = QCursor::pos();
|
||||
return {cursorPos.x(), cursorPos.y()};
|
||||
}
|
||||
|
||||
void replaceAll(std::string &str, const std::string &from,
|
||||
void ReplaceAll(std::string &str, const std::string &from,
|
||||
const std::string &to)
|
||||
{
|
||||
if (from.empty()) {
|
||||
|
|
|
|||
|
|
@ -28,21 +28,19 @@ OBSWeakSource GetWeakTransitionByName(const char *transitionName);
|
|||
OBSWeakSource GetWeakTransitionByQString(const QString &name);
|
||||
OBSWeakSource GetWeakFilterByName(OBSWeakSource source, const char *name);
|
||||
OBSWeakSource GetWeakFilterByQString(OBSWeakSource source, const QString &name);
|
||||
std::string getSourceSettings(OBSWeakSource ws);
|
||||
void setSourceSettings(obs_source_t *s, const std::string &settings);
|
||||
bool compareSourceSettings(const OBSWeakSource &source,
|
||||
std::string GetSourceSettings(OBSWeakSource ws);
|
||||
void SetSourceSettings(obs_source_t *s, const std::string &settings);
|
||||
bool CompareSourceSettings(const OBSWeakSource &source,
|
||||
const std::string &settings,
|
||||
const RegexConfig ®ex);
|
||||
void loadTransformState(obs_data_t *obj, struct obs_transform_info &info,
|
||||
void LoadTransformState(obs_data_t *obj, struct obs_transform_info &info,
|
||||
struct obs_sceneitem_crop &crop);
|
||||
bool saveTransformState(obs_data_t *obj, const struct obs_transform_info &info,
|
||||
bool SaveTransformState(obs_data_t *obj, const struct obs_transform_info &info,
|
||||
const struct obs_sceneitem_crop &crop);
|
||||
|
||||
/* Scene item helpers */
|
||||
|
||||
std::string getSceneItemTransform(obs_scene_item *item);
|
||||
std::vector<obs_scene_item *> getSceneItemsWithName(obs_scene_t *scene,
|
||||
std::string &name);
|
||||
std::string GetSceneItemTransform(obs_scene_item *item);
|
||||
|
||||
/* Selection helpers */
|
||||
|
||||
|
|
@ -55,74 +53,77 @@ QStringList GetSourceNames();
|
|||
|
||||
/* Populate list helpers */
|
||||
|
||||
void addSelectionEntry(QComboBox *sel, const char *description,
|
||||
void AddSelectionEntry(QComboBox *sel, const char *description,
|
||||
bool selectable = false, const char *tooltip = "");
|
||||
void addSelectionGroup(QComboBox *selection, const QStringList &group,
|
||||
void AddSelectionGroup(QComboBox *selection, const QStringList &group,
|
||||
bool addSeparator = true);
|
||||
void populateTransitionSelection(QComboBox *sel, bool addCurrent = true,
|
||||
void PopulateTransitionSelection(QComboBox *sel, bool addCurrent = true,
|
||||
bool addAny = false);
|
||||
void populateWindowSelection(QComboBox *sel, bool addSelect = true);
|
||||
void populateAudioSelection(QComboBox *sel, bool addSelect = true);
|
||||
void PopulateWindowSelection(QComboBox *sel, bool addSelect = true);
|
||||
void PopulateAudioSelection(QComboBox *sel, bool addSelect = true);
|
||||
void populateVideoSelection(QComboBox *sel, bool addMainOutput = false,
|
||||
bool addScenes = false, bool addSelect = true);
|
||||
void populateMediaSelection(QComboBox *sel, bool addSelect = true);
|
||||
void populateProcessSelection(QComboBox *sel, bool addSelect = true);
|
||||
void populateSourceSelection(QComboBox *list, bool addSelect = true);
|
||||
void populateSceneSelection(QComboBox *sel, bool addPrevious = false,
|
||||
void PopulateMediaSelection(QComboBox *sel, bool addSelect = true);
|
||||
void PopulateProcessSelection(QComboBox *sel, bool addSelect = true);
|
||||
void PopulateSourceSelection(QComboBox *list, bool addSelect = true);
|
||||
void PopulateSceneSelection(QComboBox *sel, bool addPrevious = false,
|
||||
bool addCurrent = false, bool addAny = false,
|
||||
bool addSceneGroup = false,
|
||||
std::deque<SceneGroup> *sceneGroups = nullptr,
|
||||
bool addSelect = true, std::string selectText = "",
|
||||
bool selectable = false);
|
||||
void populateSourcesWithFilterSelection(QComboBox *list);
|
||||
void populateFilterSelection(QComboBox *list,
|
||||
void PopulateSourcesWithFilterSelection(QComboBox *list);
|
||||
void PopulateFilterSelection(QComboBox *list,
|
||||
OBSWeakSource weakSource = nullptr);
|
||||
void populateSourceGroupSelection(QComboBox *list);
|
||||
void populateProfileSelection(QComboBox *list);
|
||||
void populateMonitorTypeSelection(QComboBox *list);
|
||||
void PopulateSourceGroupSelection(QComboBox *list);
|
||||
void PopulateProfileSelection(QComboBox *list);
|
||||
void PopulateMonitorTypeSelection(QComboBox *list);
|
||||
|
||||
/* Widget helpers */
|
||||
|
||||
void placeWidgets(std::string text, QBoxLayout *layout,
|
||||
void PlaceWidgets(std::string text, QBoxLayout *layout,
|
||||
std::unordered_map<std::string, QWidget *> placeholders,
|
||||
bool addStretch = true);
|
||||
void deleteLayoutItemWidget(QLayoutItem *item);
|
||||
void clearLayout(QLayout *layout, int afterIdx = 0);
|
||||
void setLayoutVisible(QLayout *layout, bool visible);
|
||||
void DeleteLayoutItemWidget(QLayoutItem *item);
|
||||
void ClearLayout(QLayout *layout, int afterIdx = 0);
|
||||
void SetLayoutVisible(QLayout *layout, bool visible);
|
||||
void MinimizeSizeOfColumn(QGridLayout *layout, int idx);
|
||||
QMetaObject::Connection PulseWidget(QWidget *widget, QColor startColor,
|
||||
QColor endColor = QColor(0, 0, 0, 0),
|
||||
bool once = false);
|
||||
void listAddClicked(QListWidget *list, QWidget *newWidget,
|
||||
QPushButton *addButton = nullptr,
|
||||
QMetaObject::Connection *addHighlight = nullptr);
|
||||
bool listMoveUp(QListWidget *list);
|
||||
bool listMoveDown(QListWidget *list);
|
||||
void setHeightToContentHeight(QListWidget *list);
|
||||
void setButtonIcon(QPushButton *button, const char *path);
|
||||
int findIdxInRagne(QComboBox *list, int start, int stop,
|
||||
void SetHeightToContentHeight(QListWidget *list);
|
||||
void SetButtonIcon(QPushButton *button, const char *path);
|
||||
int FindIdxInRagne(QComboBox *list, int start, int stop,
|
||||
const std::string &value);
|
||||
|
||||
/* UI helpers */
|
||||
|
||||
bool DisplayMessage(const QString &msg, bool question = false);
|
||||
void DisplayTrayMessage(const QString &title, const QString &msg);
|
||||
bool windowPosValid(QPoint pos);
|
||||
bool WindowPosValid(QPoint pos);
|
||||
std::string GetThemeTypeName();
|
||||
|
||||
/* Generic helpers */
|
||||
|
||||
bool compareIgnoringLineEnding(QString &s1, QString &s2);
|
||||
std::string getDataFilePath(const std::string &file);
|
||||
bool matchJson(const std::string &json1, const std::string &json2,
|
||||
bool CompareIgnoringLineEnding(QString &s1, QString &s2);
|
||||
std::string GetDataFilePath(const std::string &file);
|
||||
bool MatchJson(const std::string &json1, const std::string &json2,
|
||||
const RegexConfig ®ex);
|
||||
QString formatJsonString(std::string);
|
||||
QString formatJsonString(QString);
|
||||
QString escapeForRegex(QString &s);
|
||||
bool doubleEquals(double left, double right, double epsilon);
|
||||
std::pair<int, int> getCursorPos();
|
||||
void replaceAll(std::string &str, const std::string &from,
|
||||
QString FormatJsonString(std::string);
|
||||
QString FormatJsonString(QString);
|
||||
QString EscapeForRegex(QString &s);
|
||||
bool DoubleEquals(double left, double right, double epsilon);
|
||||
std::pair<int, int> GetCursorPos();
|
||||
void ReplaceAll(std::string &str, const std::string &from,
|
||||
const std::string &to);
|
||||
QString GetDefaultSettingsSaveLocation();
|
||||
|
||||
/* Legacy helpers */
|
||||
|
||||
void listAddClicked(QListWidget *list, QWidget *newWidget,
|
||||
QPushButton *addButton = nullptr,
|
||||
QMetaObject::Connection *addHighlight = nullptr);
|
||||
bool listMoveUp(QListWidget *list);
|
||||
bool listMoveDown(QListWidget *list);
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ GenericVaraiableSpinbox::GenericVaraiableSpinbox(QWidget *parent,
|
|||
{
|
||||
_toggleType->setCheckable(true);
|
||||
_toggleType->setMaximumWidth(11);
|
||||
setButtonIcon(_toggleType, ":/res/images/dots-vert.svg");
|
||||
SetButtonIcon(_toggleType, ":/res/images/dots-vert.svg");
|
||||
|
||||
QWidget::connect(_fixedValueInt, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetFixedValue(int)));
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ std::string SubstitueVariables(std::string str)
|
|||
for (const auto &v : switcher->variables) {
|
||||
const auto &variable = std::dynamic_pointer_cast<Variable>(v);
|
||||
const std::string pattern = "${" + variable->Name() + "}";
|
||||
replaceAll(str, pattern, variable->Value());
|
||||
ReplaceAll(str, pattern, variable->Value());
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user