mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-03 07:05:52 -05:00
Compare commits
9 Commits
record-pat
...
1.32.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6314de8f37 | ||
|
|
6bfcabc4af | ||
|
|
69711d973a | ||
|
|
225913b44d | ||
|
|
7c6d657fdd | ||
|
|
12e38274f5 | ||
|
|
5d49e8825b | ||
|
|
21c34356ed | ||
|
|
266e470509 |
@@ -44,6 +44,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailureMessage="<html>
|
|||||||
AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage="The plugin installation seems to be corrupted and might crash!\nPlease make sure the plugin was installed correctly!"
|
AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage="The plugin installation seems to be corrupted and might crash!\nPlease make sure the plugin was installed correctly!"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs="Hide tabs which can be represented via macros"
|
AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs="Hide tabs which can be represented via macros"
|
||||||
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch="Always show macro search"
|
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch="Always show macro search"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs="Always show all feature tabs"
|
||||||
|
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs.tooltip="Show tabs that are normally hidden until first used in a macro (e.g. Action Queues, Variables, Twitch, Websockets)."
|
||||||
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
|
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
|
||||||
AdvSceneSwitcher.generalTab.priority="Priority"
|
AdvSceneSwitcher.generalTab.priority="Priority"
|
||||||
AdvSceneSwitcher.generalTab.priority.description="Switching methods priority (Highest priority is at the top)"
|
AdvSceneSwitcher.generalTab.priority.description="Switching methods priority (Highest priority is at the top)"
|
||||||
@@ -1256,12 +1258,14 @@ AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Disable chat's emote
|
|||||||
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Send chat message"
|
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Send chat message"
|
||||||
AdvSceneSwitcher.action.twitch.type.user.getInfo="Get user information"
|
AdvSceneSwitcher.action.twitch.type.user.getInfo="Get user information"
|
||||||
AdvSceneSwitcher.action.twitch.type.reward.getInfo="Get channel points reward information"
|
AdvSceneSwitcher.action.twitch.type.reward.getInfo="Get channel points reward information"
|
||||||
|
AdvSceneSwitcher.action.twitch.type.channel.getInfo="Get channel information"
|
||||||
AdvSceneSwitcher.action.twitch.reward.toggleControl="Toggle reward name / variable selection control"
|
AdvSceneSwitcher.action.twitch.reward.toggleControl="Toggle reward name / variable selection control"
|
||||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Cannot select category without selecting a Twitch account first!"
|
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Cannot select category without selecting a Twitch account first!"
|
||||||
AdvSceneSwitcher.action.twitch.entry.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
AdvSceneSwitcher.action.twitch.layout.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.chat="Using account{{account}}{{actions}}on{{channel}}"
|
AdvSceneSwitcher.action.twitch.layout.chat="Using account{{account}}{{actions}}on{{channel}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.user.getInfo="Using account{{account}}{{actions}}for{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
AdvSceneSwitcher.action.twitch.layout.channel.getInfo="Using account{{account}}{{actions}}of{{channel}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="Using account{{account}}{{actions}}for channel{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
AdvSceneSwitcher.action.twitch.layout.user.getInfo="Using account{{account}}{{actions}}for{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||||
|
AdvSceneSwitcher.action.twitch.layout.reward.getInfo="Using account{{account}}{{actions}}for channel{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||||
AdvSceneSwitcher.action.twitch.title.title="Enter title"
|
AdvSceneSwitcher.action.twitch.title.title="Enter title"
|
||||||
AdvSceneSwitcher.action.twitch.marker.description="Describe marker"
|
AdvSceneSwitcher.action.twitch.marker.description="Describe marker"
|
||||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="Add a slight delay before capturing the clip"
|
AdvSceneSwitcher.action.twitch.clip.hasDelay="Add a slight delay before capturing the clip"
|
||||||
@@ -2186,6 +2190,8 @@ AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the
|
|||||||
|
|
||||||
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
|
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
|
||||||
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
|
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
|
||||||
|
AdvSceneSwitcher.tempVar.recording.lastSavePath="Last save path"
|
||||||
|
AdvSceneSwitcher.tempVar.recording.lastSavePath.description="The file path of the last saved recording."
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.video.patternCount="Pattern count"
|
AdvSceneSwitcher.tempVar.video.patternCount="Pattern count"
|
||||||
AdvSceneSwitcher.tempVar.video.patternCount.description="The number of times the given pattern has been found in a given video input frame."
|
AdvSceneSwitcher.tempVar.video.patternCount.description="The number of times the given pattern has been found in a given video input frame."
|
||||||
|
|||||||
@@ -1193,10 +1193,10 @@ AdvSceneSwitcher.action.twitch.type.user.getInfo="ユーザー情報を取得"
|
|||||||
AdvSceneSwitcher.action.twitch.type.reward.getInfo="チャンネルポイントリワード情報を取得"
|
AdvSceneSwitcher.action.twitch.type.reward.getInfo="チャンネルポイントリワード情報を取得"
|
||||||
AdvSceneSwitcher.action.twitch.reward.toggleControl="リワード名/変数選択コントロールの切り替え"
|
AdvSceneSwitcher.action.twitch.reward.toggleControl="リワード名/変数選択コントロールの切り替え"
|
||||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Twitchアカウントを選択しないとカテゴリを選択できません!"
|
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Twitchアカウントを選択しないとカテゴリを選択できません!"
|
||||||
; AdvSceneSwitcher.action.twitch.entry.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}"
|
; AdvSceneSwitcher.action.twitch.layout.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.chat="{{channel}}でアカウント{{account}}{{actions}}を使用しています"
|
AdvSceneSwitcher.action.twitch.layout.chat="{{channel}}でアカウント{{account}}{{actions}}を使用しています"
|
||||||
AdvSceneSwitcher.action.twitch.entry.user.getInfo="{{userInfoQueryType}}{{userLogin}}{{userId}}でアカウント{{account}}{{actions}}を使用"
|
AdvSceneSwitcher.action.twitch.layout.user.getInfo="{{userInfoQueryType}}{{userLogin}}{{userId}}でアカウント{{account}}{{actions}}を使用"
|
||||||
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="チャンネル{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}でアカウント{{account}}{{actions}}を使用"
|
AdvSceneSwitcher.action.twitch.layout.reward.getInfo="チャンネル{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}でアカウント{{account}}{{actions}}を使用"
|
||||||
AdvSceneSwitcher.action.twitch.title.title="タイトルを入力"
|
AdvSceneSwitcher.action.twitch.title.title="タイトルを入力"
|
||||||
AdvSceneSwitcher.action.twitch.marker.description="マーカーの説明"
|
AdvSceneSwitcher.action.twitch.marker.description="マーカーの説明"
|
||||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="クリップをキャプチャする前にわずかな遅延を追加します"
|
AdvSceneSwitcher.action.twitch.clip.hasDelay="クリップをキャプチャする前にわずかな遅延を追加します"
|
||||||
|
|||||||
@@ -1065,8 +1065,8 @@ AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.enable="Habilitar modo apenas
|
|||||||
AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Desabilitar modo apenas emotes no chat"
|
AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Desabilitar modo apenas emotes no chat"
|
||||||
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Enviar mensagem de chat"
|
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Enviar mensagem de chat"
|
||||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Não é possível selecionar categoria sem selecionar uma conta Twitch primeiro!"
|
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Não é possível selecionar categoria sem selecionar uma conta Twitch primeiro!"
|
||||||
AdvSceneSwitcher.action.twitch.entry.default="Em{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
AdvSceneSwitcher.action.twitch.layout.default="Em{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.chat="Usando conta{{account}}{{actions}}em{{channel}}"
|
AdvSceneSwitcher.action.twitch.layout.chat="Usando conta{{account}}{{actions}}em{{channel}}"
|
||||||
AdvSceneSwitcher.action.twitch.title.title="Digite o título"
|
AdvSceneSwitcher.action.twitch.title.title="Digite o título"
|
||||||
AdvSceneSwitcher.action.twitch.marker.description="Descreva o marcador"
|
AdvSceneSwitcher.action.twitch.marker.description="Descreva o marcador"
|
||||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="Adicionar um leve atraso antes de capturar o clipe"
|
AdvSceneSwitcher.action.twitch.clip.hasDelay="Adicionar um leve atraso antes de capturar o clipe"
|
||||||
|
|||||||
@@ -1139,10 +1139,10 @@ AdvSceneSwitcher.action.twitch.type.user.getInfo="获取用户信息"
|
|||||||
AdvSceneSwitcher.action.twitch.type.reward.getInfo="获取频道积分奖励信息"
|
AdvSceneSwitcher.action.twitch.type.reward.getInfo="获取频道积分奖励信息"
|
||||||
AdvSceneSwitcher.action.twitch.reward.toggleControl="切换奖励名称/变量选择控制"
|
AdvSceneSwitcher.action.twitch.reward.toggleControl="切换奖励名称/变量选择控制"
|
||||||
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="在未选择 Twitch 帐户的情况下无法选择类别!"
|
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="在未选择 Twitch 帐户的情况下无法选择类别!"
|
||||||
AdvSceneSwitcher.action.twitch.entry.default="{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
AdvSceneSwitcher.action.twitch.layout.default="{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.chat="使用账户{{account}}{{actions}}{{channel}}"
|
AdvSceneSwitcher.action.twitch.layout.chat="使用账户{{account}}{{actions}}{{channel}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.user.getInfo="使用账户{{account}}{{actions}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
AdvSceneSwitcher.action.twitch.layout.user.getInfo="使用账户{{account}}{{actions}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
|
||||||
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="使用账户{{account}}{{actions}} 频道{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
AdvSceneSwitcher.action.twitch.layout.reward.getInfo="使用账户{{account}}{{actions}} 频道{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
|
||||||
AdvSceneSwitcher.action.twitch.title.title="输入标题"
|
AdvSceneSwitcher.action.twitch.title.title="输入标题"
|
||||||
AdvSceneSwitcher.action.twitch.marker.description="标记描述"
|
AdvSceneSwitcher.action.twitch.marker.description="标记描述"
|
||||||
AdvSceneSwitcher.action.twitch.clip.hasDelay="在捕捉视频片段前稍加延迟"
|
AdvSceneSwitcher.action.twitch.clip.hasDelay="在捕捉视频片段前稍加延迟"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>962</width>
|
<width>962</width>
|
||||||
<height>1132</height>
|
<height>1160</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_19">
|
<layout class="QVBoxLayout" name="verticalLayout_19">
|
||||||
@@ -268,9 +268,19 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="uiHintsDisable">
|
<widget class="QCheckBox" name="alwaysShowMacroSearch">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="alwaysShowFeatureTabs">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs.tooltip</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -282,9 +292,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="alwaysShowMacroSearch">
|
<widget class="QCheckBox" name="uiHintsDisable">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch</string>
|
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -1029,6 +1029,8 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
|||||||
setTabOrder(ui->importSettings, ui->cooldownTime);
|
setTabOrder(ui->importSettings, ui->cooldownTime);
|
||||||
setTabOrder(ui->cooldownTime, ui->noMatchDontSwitch);
|
setTabOrder(ui->cooldownTime, ui->noMatchDontSwitch);
|
||||||
|
|
||||||
|
SetupShowAllTabsCheckBox(ui->alwaysShowFeatureTabs, ui->tabWidget);
|
||||||
|
|
||||||
MinimizeSizeOfColumn(ui->statusLayout, 0);
|
MinimizeSizeOfColumn(ui->statusLayout, 0);
|
||||||
setWindowTitle(windowTitle() + " - " + g_GIT_TAG);
|
setWindowTitle(windowTitle() + " - " + g_GIT_TAG);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ static inline void populateActionSelection(QComboBox *list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
MacroActionEdit::MacroActionEdit(QWidget *parent,
|
||||||
std::shared_ptr<MacroAction> *entryData,
|
std::shared_ptr<MacroAction> *entryData)
|
||||||
const std::string &id)
|
|
||||||
: MacroSegmentEdit(parent),
|
: MacroSegmentEdit(parent),
|
||||||
_actionSelection(new FilterComboBox()),
|
_actionSelection(new FilterComboBox()),
|
||||||
_enable(new SwitchButton()),
|
_enable(new SwitchButton()),
|
||||||
|
|||||||
@@ -13,10 +13,8 @@ class MacroActionEdit : public MacroSegmentEdit {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroActionEdit(
|
MacroActionEdit(QWidget *parent = nullptr,
|
||||||
QWidget *parent = nullptr,
|
std::shared_ptr<MacroAction> * = nullptr);
|
||||||
std::shared_ptr<MacroAction> * = nullptr,
|
|
||||||
const std::string &id = MacroAction::GetDefaultID().data());
|
|
||||||
void SetupWidgets(bool basicSetup = false);
|
void SetupWidgets(bool basicSetup = false);
|
||||||
void SetEntryData(std::shared_ptr<MacroAction> *);
|
void SetEntryData(std::shared_ptr<MacroAction> *);
|
||||||
|
|
||||||
|
|||||||
@@ -93,33 +93,46 @@ bool MacroActionMacro::PerformAction()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_action) {
|
const auto performActionForMacro = [this](Macro *macro) {
|
||||||
case Action::PAUSE:
|
switch (_action) {
|
||||||
macro->SetPaused();
|
case Action::PAUSE:
|
||||||
break;
|
macro->SetPaused();
|
||||||
case Action::UNPAUSE:
|
break;
|
||||||
macro->SetPaused(false);
|
case Action::UNPAUSE:
|
||||||
break;
|
macro->SetPaused(false);
|
||||||
case Action::TOGGLE_PAUSE:
|
break;
|
||||||
macro->SetPaused(!macro->Paused());
|
case Action::TOGGLE_PAUSE:
|
||||||
break;
|
macro->SetPaused(!macro->Paused());
|
||||||
case Action::RESET_COUNTER:
|
break;
|
||||||
macro->ResetRunCount();
|
case Action::RESET_COUNTER:
|
||||||
break;
|
macro->ResetRunCount();
|
||||||
case Action::RUN_ACTIONS:
|
break;
|
||||||
RunActions(macro.get());
|
case Action::RUN_ACTIONS:
|
||||||
break;
|
RunActions(macro);
|
||||||
case Action::STOP:
|
break;
|
||||||
macro->Stop();
|
case Action::STOP:
|
||||||
break;
|
macro->Stop();
|
||||||
case Action::DISABLE_ACTION:
|
break;
|
||||||
case Action::ENABLE_ACTION:
|
case Action::DISABLE_ACTION:
|
||||||
case Action::TOGGLE_ACTION:
|
case Action::ENABLE_ACTION:
|
||||||
AdjustActionState(macro.get());
|
case Action::TOGGLE_ACTION:
|
||||||
break;
|
AdjustActionState(macro);
|
||||||
default:
|
break;
|
||||||
break;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!IsGroupMacro(macro.get())) {
|
||||||
|
performActionForMacro(macro.get());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto macros = GetGroupMacroEntries(macro.get());
|
||||||
|
for (const auto ¯o : macros) {
|
||||||
|
performActionForMacro(macro.get());
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,6 +417,7 @@ MacroActionMacroEdit::MacroActionMacroEdit(
|
|||||||
populateActionTypes(_actionTypes);
|
populateActionTypes(_actionTypes);
|
||||||
|
|
||||||
_conditionMacros->HideSelectedMacro();
|
_conditionMacros->HideSelectedMacro();
|
||||||
|
_conditionMacros->HideGroups();
|
||||||
|
|
||||||
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
||||||
this, SLOT(MacroChanged(const QString &)));
|
this, SLOT(MacroChanged(const QString &)));
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ void DurationModifierEdit::Collapse(bool collapse)
|
|||||||
|
|
||||||
MacroConditionEdit::MacroConditionEdit(
|
MacroConditionEdit::MacroConditionEdit(
|
||||||
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
|
||||||
const std::string &id, bool isRootCondition)
|
bool isRootCondition)
|
||||||
: MacroSegmentEdit(parent),
|
: MacroSegmentEdit(parent),
|
||||||
_logicSelection(new QComboBox()),
|
_logicSelection(new QComboBox()),
|
||||||
_conditionSelection(new FilterComboBox()),
|
_conditionSelection(new FilterComboBox()),
|
||||||
|
|||||||
@@ -34,11 +34,9 @@ class MacroConditionEdit : public MacroSegmentEdit {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroConditionEdit(
|
MacroConditionEdit(QWidget *parent = nullptr,
|
||||||
QWidget *parent = nullptr,
|
std::shared_ptr<MacroCondition> * = nullptr,
|
||||||
std::shared_ptr<MacroCondition> * = nullptr,
|
bool root = true);
|
||||||
const std::string &id = MacroCondition::GetDefaultID().data(),
|
|
||||||
bool root = true);
|
|
||||||
bool IsRootNode() const;
|
bool IsRootNode() const;
|
||||||
void SetRootNode(bool);
|
void SetRootNode(bool);
|
||||||
void SetupWidgets(bool basicSetup = false);
|
void SetupWidgets(bool basicSetup = false);
|
||||||
|
|||||||
@@ -315,6 +315,7 @@ MacroConditionMacroEdit::MacroConditionMacroEdit(
|
|||||||
_actionIndex(new MacroSegmentSelection(
|
_actionIndex(new MacroSegmentSelection(
|
||||||
this, MacroSegmentSelection::Type::ACTION))
|
this, MacroSegmentSelection::Type::ACTION))
|
||||||
{
|
{
|
||||||
|
_macros->HideGroups();
|
||||||
_count->setMaximum(10000000);
|
_count->setMaximum(10000000);
|
||||||
populateTypeSelection(_types);
|
populateTypeSelection(_types);
|
||||||
populateCounterConditionSelection(_counterConditions);
|
populateCounterConditionSelection(_counterConditions);
|
||||||
|
|||||||
@@ -418,8 +418,7 @@ void MacroEdit::PopulateMacroActions(Macro &m, uint32_t afterIdx)
|
|||||||
ui->actionsList->SetVisibilityCheckEnable(false);
|
ui->actionsList->SetVisibilityCheckEnable(false);
|
||||||
|
|
||||||
for (; afterIdx < actions.size(); afterIdx++) {
|
for (; afterIdx < actions.size(); afterIdx++) {
|
||||||
auto newEntry = new MacroActionEdit(this, &actions[afterIdx],
|
auto newEntry = new MacroActionEdit(this, &actions[afterIdx]);
|
||||||
actions[afterIdx]->GetId());
|
|
||||||
ui->actionsList->Add(newEntry);
|
ui->actionsList->Add(newEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,8 +443,7 @@ void MacroEdit::PopulateMacroElseActions(Macro &m, uint32_t afterIdx)
|
|||||||
ui->elseActionsList->SetVisibilityCheckEnable(false);
|
ui->elseActionsList->SetVisibilityCheckEnable(false);
|
||||||
|
|
||||||
for (; afterIdx < actions.size(); afterIdx++) {
|
for (; afterIdx < actions.size(); afterIdx++) {
|
||||||
auto newEntry = new MacroActionEdit(this, &actions[afterIdx],
|
auto newEntry = new MacroActionEdit(this, &actions[afterIdx]);
|
||||||
actions[afterIdx]->GetId());
|
|
||||||
ui->elseActionsList->Add(newEntry);
|
ui->elseActionsList->Add(newEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,8 +470,7 @@ void MacroEdit::PopulateMacroConditions(Macro &m, uint32_t afterIdx)
|
|||||||
|
|
||||||
for (; afterIdx < conditions.size(); afterIdx++) {
|
for (; afterIdx < conditions.size(); afterIdx++) {
|
||||||
auto newEntry = new MacroConditionEdit(
|
auto newEntry = new MacroConditionEdit(
|
||||||
this, &conditions[afterIdx],
|
this, &conditions[afterIdx], root);
|
||||||
conditions[afterIdx]->GetId(), root);
|
|
||||||
ui->conditionsList->Add(newEntry);
|
ui->conditionsList->Add(newEntry);
|
||||||
root = false;
|
root = false;
|
||||||
}
|
}
|
||||||
@@ -1083,8 +1080,7 @@ void MacroEdit::AddMacroAction(Macro *macro, int idx, const std::string &id,
|
|||||||
RunAndClearPostLoadSteps();
|
RunAndClearPostLoadSteps();
|
||||||
macro->UpdateActionIndices();
|
macro->UpdateActionIndices();
|
||||||
ui->actionsList->Insert(
|
ui->actionsList->Insert(
|
||||||
idx,
|
idx, new MacroActionEdit(this, ¯o->Actions()[idx]));
|
||||||
new MacroActionEdit(this, ¯o->Actions()[idx], id));
|
|
||||||
SetActionData(*macro);
|
SetActionData(*macro);
|
||||||
}
|
}
|
||||||
HighlightAction(idx);
|
HighlightAction(idx);
|
||||||
@@ -1386,8 +1382,8 @@ void MacroEdit::AddMacroElseAction(Macro *macro, int idx, const std::string &id,
|
|||||||
RunAndClearPostLoadSteps();
|
RunAndClearPostLoadSteps();
|
||||||
macro->UpdateElseActionIndices();
|
macro->UpdateElseActionIndices();
|
||||||
ui->elseActionsList->Insert(
|
ui->elseActionsList->Insert(
|
||||||
idx, new MacroActionEdit(
|
idx,
|
||||||
this, ¯o->ElseActions()[idx], id));
|
new MacroActionEdit(this, ¯o->ElseActions()[idx]));
|
||||||
SetElseActionData(*macro);
|
SetElseActionData(*macro);
|
||||||
}
|
}
|
||||||
HighlightElseAction(idx);
|
HighlightElseAction(idx);
|
||||||
@@ -1589,7 +1585,7 @@ void MacroEdit::AddMacroCondition(Macro *macro, int idx, const std::string &id,
|
|||||||
ui->conditionsList->Insert(
|
ui->conditionsList->Insert(
|
||||||
idx,
|
idx,
|
||||||
new MacroConditionEdit(this, ¯o->Conditions()[idx],
|
new MacroConditionEdit(this, ¯o->Conditions()[idx],
|
||||||
id, idx == 0));
|
idx == 0));
|
||||||
SetConditionData(*macro);
|
SetConditionData(*macro);
|
||||||
}
|
}
|
||||||
HighlightCondition(idx);
|
HighlightCondition(idx);
|
||||||
|
|||||||
@@ -117,9 +117,32 @@ GetMacroConditions(Macro *macro)
|
|||||||
return macro->Conditions();
|
return macro->Conditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view GetSceneSwitchActionId()
|
bool IsGroupMacro(Macro *macro)
|
||||||
{
|
{
|
||||||
return MacroAction::GetDefaultID();
|
return macro && macro->IsGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::shared_ptr<Macro>> GetGroupMacroEntries(Macro *macro)
|
||||||
|
{
|
||||||
|
if (!macro || !macro->IsGroup()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::shared_ptr<Macro>> entries;
|
||||||
|
entries.reserve(macro->GroupSize());
|
||||||
|
|
||||||
|
const auto ¯os = GetTopLevelMacros();
|
||||||
|
for (auto it = macros.begin(); it < macros.end(); it++) {
|
||||||
|
if ((*it)->Name() != macro->Name()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (uint32_t i = 1; i <= macro->GroupSize(); i++) {
|
||||||
|
entries.emplace_back(*std::next(it, i));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::condition_variable &GetMacroWaitCV()
|
std::condition_variable &GetMacroWaitCV()
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ class Macro;
|
|||||||
class MacroAction;
|
class MacroAction;
|
||||||
class MacroCondition;
|
class MacroCondition;
|
||||||
|
|
||||||
|
static const int macro_func = 10;
|
||||||
|
|
||||||
EXPORT std::deque<std::shared_ptr<Macro>> &GetTopLevelMacros();
|
EXPORT std::deque<std::shared_ptr<Macro>> &GetTopLevelMacros();
|
||||||
std::deque<std::shared_ptr<Macro>> &GetTemporaryMacros();
|
std::deque<std::shared_ptr<Macro>> &GetTemporaryMacros();
|
||||||
EXPORT std::deque<std::shared_ptr<Macro>> GetAllMacros();
|
EXPORT std::deque<std::shared_ptr<Macro>> GetAllMacros();
|
||||||
@@ -35,9 +37,8 @@ GetMacroElseActions(Macro *);
|
|||||||
EXPORT std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
EXPORT std::optional<std::deque<std::shared_ptr<MacroCondition>>>
|
||||||
GetMacroConditions(Macro *);
|
GetMacroConditions(Macro *);
|
||||||
|
|
||||||
std::string_view GetSceneSwitchActionId();
|
EXPORT bool IsGroupMacro(Macro *);
|
||||||
|
EXPORT std::vector<std::shared_ptr<Macro>> GetGroupMacroEntries(Macro *);
|
||||||
constexpr auto macro_func = 10;
|
|
||||||
|
|
||||||
EXPORT std::condition_variable &GetMacroWaitCV();
|
EXPORT std::condition_variable &GetMacroWaitCV();
|
||||||
EXPORT std::condition_variable &GetMacroTransitionCV();
|
EXPORT std::condition_variable &GetMacroTransitionCV();
|
||||||
|
|||||||
@@ -244,22 +244,9 @@ bool MacroMatchesSearchFilter(Macro *macro)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (macro->IsGroup()) {
|
if (macro->IsGroup()) {
|
||||||
std::vector<std::shared_ptr<Macro>> subItems;
|
const auto groupEntries = GetGroupMacroEntries(macro);
|
||||||
subItems.reserve(macro->GroupSize());
|
for (const auto &entry : groupEntries) {
|
||||||
|
if (MacroMatchesSearchFilter(entry.get())) {
|
||||||
const auto ¯os = GetTopLevelMacros();
|
|
||||||
for (auto it = macros.begin(); it < macros.end(); it++) {
|
|
||||||
if ((*it)->Name() != macro->Name()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (uint32_t i = 1; i <= macro->GroupSize(); i++) {
|
|
||||||
subItems.emplace_back(*std::next(it, i));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto &item : subItems) {
|
|
||||||
if (MacroMatchesSearchFilter(item.get())) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ MacroSelection::MacroSelection(QWidget *parent)
|
|||||||
obs_module_text("AdvSceneSwitcher.selectMacro"))
|
obs_module_text("AdvSceneSwitcher.selectMacro"))
|
||||||
{
|
{
|
||||||
for (const auto &m : GetTopLevelMacros()) {
|
for (const auto &m : GetTopLevelMacros()) {
|
||||||
if (m->IsGroup()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
addItem(QString::fromStdString(m->Name()));
|
addItem(QString::fromStdString(m->Name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +63,22 @@ void MacroSelection::HideSelectedMacro()
|
|||||||
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
|
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroSelection::HideGroups()
|
||||||
|
{
|
||||||
|
for (const auto ¯o : GetTopLevelMacros()) {
|
||||||
|
if (!macro->IsGroup()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int idx = findText(QString::fromStdString(macro->Name()));
|
||||||
|
if (idx == -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MacroSelection::ShowAllMacros()
|
void MacroSelection::ShowAllMacros()
|
||||||
{
|
{
|
||||||
auto v = qobject_cast<QListView *>(view());
|
auto v = qobject_cast<QListView *>(view());
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public:
|
|||||||
MacroSelection(QWidget *parent);
|
MacroSelection(QWidget *parent);
|
||||||
void SetCurrentMacro(const MacroRef &);
|
void SetCurrentMacro(const MacroRef &);
|
||||||
void HideSelectedMacro(); // Macro currently being edited
|
void HideSelectedMacro(); // Macro currently being edited
|
||||||
|
void HideGroups();
|
||||||
void ShowAllMacros();
|
void ShowAllMacros();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@@ -147,20 +147,7 @@ void AdvSceneSwitcher::on_macroAdd_clicked()
|
|||||||
static void addGroupSubitems(std::vector<std::shared_ptr<Macro>> ¯os,
|
static void addGroupSubitems(std::vector<std::shared_ptr<Macro>> ¯os,
|
||||||
const std::shared_ptr<Macro> &group)
|
const std::shared_ptr<Macro> &group)
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<Macro>> subitems;
|
auto subitems = GetGroupMacroEntries(group.get());
|
||||||
subitems.reserve(group->GroupSize());
|
|
||||||
|
|
||||||
// Find all subitems
|
|
||||||
auto allMacros = GetTopLevelMacros();
|
|
||||||
for (auto it = allMacros.begin(); it < allMacros.end(); it++) {
|
|
||||||
if ((*it)->Name() != group->Name()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (uint32_t i = 1; i <= group->GroupSize(); i++) {
|
|
||||||
subitems.emplace_back(*std::next(it, i));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove subitems which were already selected to avoid duplicates
|
// Remove subitems which were already selected to avoid duplicates
|
||||||
for (const auto &subitem : subitems) {
|
for (const auto &subitem : subitems) {
|
||||||
|
|||||||
@@ -948,12 +948,12 @@ bool Macro::PostLoad()
|
|||||||
bool Macro::SwitchesScene() const
|
bool Macro::SwitchesScene() const
|
||||||
{
|
{
|
||||||
for (const auto &a : _actions) {
|
for (const auto &a : _actions) {
|
||||||
if (a->GetId() == GetSceneSwitchActionId()) {
|
if (a->GetId() == MacroAction::GetDefaultID()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto &a : _elseActions) {
|
for (const auto &a : _elseActions) {
|
||||||
if (a->GetId() == GetSceneSwitchActionId()) {
|
if (a->GetId() == MacroAction::GetDefaultID()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ bool IsFullscreen(const std::string &title)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<std::string> GetTextInWindow(const std::string &window)
|
std::optional<std::string> GetTextInWindow(const std::string &)
|
||||||
{
|
{
|
||||||
// Not implemented
|
// Not implemented
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ std::optional<double> GetDouble(const std::string &str)
|
|||||||
std::optional<int> GetInt(const std::string &str)
|
std::optional<int> GetInt(const std::string &str)
|
||||||
{
|
{
|
||||||
char *end = nullptr;
|
char *end = nullptr;
|
||||||
int value = std::strtol(str.c_str(), &end, 10);
|
int value = (int)std::strtol(str.c_str(), &end, 10);
|
||||||
|
|
||||||
if (end != str.c_str() && *end == '\0' && value != INT_MAX &&
|
if (end != str.c_str() && *end == '\0' && value != INT_MAX &&
|
||||||
value != INT_MIN) {
|
value != INT_MIN) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "tab-helpers.hpp"
|
#include "tab-helpers.hpp"
|
||||||
#include "log-helper.hpp"
|
#include "log-helper.hpp"
|
||||||
#include "obs-module-helper.hpp"
|
#include "obs-module-helper.hpp"
|
||||||
|
#include "plugin-state-helpers.hpp"
|
||||||
|
|
||||||
#include <obs.hpp>
|
#include <obs.hpp>
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
@@ -33,6 +34,21 @@ struct TabCallbacks {
|
|||||||
static std::unordered_map<const char *, TabCallbacks> createTabCallbacks;
|
static std::unordered_map<const char *, TabCallbacks> createTabCallbacks;
|
||||||
|
|
||||||
static int lastOpenedTab = -1;
|
static int lastOpenedTab = -1;
|
||||||
|
static bool alwaysShowTabs = false;
|
||||||
|
|
||||||
|
[[maybe_unused]] static bool _ = []() {
|
||||||
|
AddPluginInitStep([]() {
|
||||||
|
AddSaveStep([](obs_data_t *data) {
|
||||||
|
obs_data_set_bool(data, "alwaysShowTabs",
|
||||||
|
alwaysShowTabs);
|
||||||
|
});
|
||||||
|
AddLoadStep([](obs_data_t *data) {
|
||||||
|
alwaysShowTabs =
|
||||||
|
obs_data_get_bool(data, "alwaysShowTabs");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}();
|
||||||
|
|
||||||
void SetTabVisibleByName(QTabWidget *tabWidget, bool visible,
|
void SetTabVisibleByName(QTabWidget *tabWidget, bool visible,
|
||||||
const QString &name)
|
const QString &name)
|
||||||
@@ -197,7 +213,41 @@ void SetupOtherTabs(QTabWidget *tabWidget)
|
|||||||
.c_str());
|
.c_str());
|
||||||
tabWidget->insertTab(0, widget, tabText);
|
tabWidget->insertTab(0, widget, tabText);
|
||||||
callbacks.setupTab(tabWidget);
|
callbacks.setupTab(tabWidget);
|
||||||
|
|
||||||
|
if (alwaysShowTabs) {
|
||||||
|
tabWidget->setTabVisible(0, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetupShowAllTabsCheckBox(QCheckBox *checkBox, QTabWidget *tabWidget)
|
||||||
|
{
|
||||||
|
const auto stateChanged = [tabWidget](int state) {
|
||||||
|
const bool newState = (state != 0);
|
||||||
|
if (newState == alwaysShowTabs) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
alwaysShowTabs = newState;
|
||||||
|
|
||||||
|
// Only show currently hidden tabs, but don't hide tabs which
|
||||||
|
// are already visible
|
||||||
|
if (!alwaysShowTabs) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto &[name, _] : createTabCallbacks) {
|
||||||
|
const auto localeKey =
|
||||||
|
std::string("AdvSceneSwitcher.") + name +
|
||||||
|
".title";
|
||||||
|
auto tabText = obs_module_text(localeKey.c_str());
|
||||||
|
SetTabVisibleByName(tabWidget, true, tabText);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
checkBox->setChecked(alwaysShowTabs);
|
||||||
|
QWidget::connect(checkBox, &QCheckBox::stateChanged, checkBox,
|
||||||
|
stateChanged);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#include "export-symbol-helper.hpp"
|
#include "export-symbol-helper.hpp"
|
||||||
|
|
||||||
#include <obs-data.h>
|
#include <obs-data.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
namespace advss {
|
namespace advss {
|
||||||
@@ -19,5 +21,6 @@ void SetupOtherTabs(QTabWidget *tabWidget);
|
|||||||
void SaveTabOrder(obs_data_t *obj);
|
void SaveTabOrder(obs_data_t *obj);
|
||||||
void LoadTabOrder(obs_data_t *obj);
|
void LoadTabOrder(obs_data_t *obj);
|
||||||
bool MacroTabIsInFocus();
|
bool MacroTabIsInFocus();
|
||||||
|
void SetupShowAllTabsCheckBox(QCheckBox *checkBox, QTabWidget *tabWidget);
|
||||||
|
|
||||||
} // namespace advss
|
} // namespace advss
|
||||||
|
|||||||
@@ -467,9 +467,9 @@ static void setupTab(QTabWidget *tab)
|
|||||||
setTabVisible(tab, false);
|
setTabVisible(tab, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget::connect(
|
QWidget::connect(VariableSignalManager::Instance(),
|
||||||
VariableSignalManager::Instance(), &VariableSignalManager::Add,
|
&VariableSignalManager::Add, tab,
|
||||||
tab, [tab](const QString &name) { setTabVisible(tab, true); });
|
[tab](const QString &) { setTabVisible(tab, true); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void VariableTable::Settings::Save(obs_data_t *data, const char *name)
|
void VariableTable::Settings::Save(obs_data_t *data, const char *name)
|
||||||
|
|||||||
@@ -453,7 +453,7 @@ void MacroActionSwitchSceneEdit::SceneSelectionCanvasChanged(
|
|||||||
SetWidgetVisibility();
|
SetWidgetVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroActionSwitchSceneEdit::ActionChanged(int value)
|
void MacroActionSwitchSceneEdit::ActionChanged(int)
|
||||||
{
|
{
|
||||||
GUARD_LOADING_AND_LOCK();
|
GUARD_LOADING_AND_LOCK();
|
||||||
_entryData->_action = static_cast<MacroActionSwitchScene::Action>(
|
_entryData->_action = static_cast<MacroActionSwitchScene::Action>(
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ MacroActionSequenceEdit::MacroActionSequenceEdit(
|
|||||||
_resetIndex(new VariableSpinBox()),
|
_resetIndex(new VariableSpinBox()),
|
||||||
_layout(new QHBoxLayout())
|
_layout(new QHBoxLayout())
|
||||||
{
|
{
|
||||||
|
_macros->HideGroups();
|
||||||
populateActionSelection(_actions);
|
populateActionSelection(_actions);
|
||||||
|
|
||||||
_resetIndex->setMinimum(1);
|
_resetIndex->setMinimum(1);
|
||||||
|
|||||||
@@ -31,15 +31,16 @@ bool MacroActionTimer::PerformAction()
|
|||||||
if (!macro) {
|
if (!macro) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auto conditions = *GetMacroConditions(macro.get());
|
|
||||||
for (auto condition : conditions) {
|
const auto updateCondition = [this](MacroCondition *condition) {
|
||||||
if (condition->GetId() != id) {
|
if (condition->GetId() != id) {
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto timerCondition =
|
auto timerCondition =
|
||||||
dynamic_cast<MacroConditionTimer *>(condition.get());
|
dynamic_cast<MacroConditionTimer *>(condition);
|
||||||
if (!timerCondition) {
|
if (!timerCondition) {
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_actionType) {
|
switch (_actionType) {
|
||||||
@@ -59,6 +60,23 @@ bool MacroActionTimer::PerformAction()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto updateMacro = [&](Macro *macro) {
|
||||||
|
auto conditions = *GetMacroConditions(macro);
|
||||||
|
for (auto condition : conditions) {
|
||||||
|
updateCondition(condition.get());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!IsGroupMacro(macro.get())) {
|
||||||
|
updateMacro(macro.get());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto macros = GetGroupMacroEntries(macro.get());
|
||||||
|
for (const auto ¯o : macros) {
|
||||||
|
updateMacro(macro.get());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -131,7 +149,7 @@ void MacroActionTimer::ResolveVariablesToFixedValues()
|
|||||||
_duration.ResolveVariables();
|
_duration.ResolveVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void populateTypeSelection(QComboBox *list)
|
static void populateTypeSelection(QComboBox *list)
|
||||||
{
|
{
|
||||||
for (const auto &[_, name] : timerActions) {
|
for (const auto &[_, name] : timerActions) {
|
||||||
list->addItem(obs_module_text(name.c_str()));
|
list->addItem(obs_module_text(name.c_str()));
|
||||||
@@ -140,12 +158,11 @@ static inline void populateTypeSelection(QComboBox *list)
|
|||||||
|
|
||||||
MacroActionTimerEdit::MacroActionTimerEdit(
|
MacroActionTimerEdit::MacroActionTimerEdit(
|
||||||
QWidget *parent, std::shared_ptr<MacroActionTimer> entryData)
|
QWidget *parent, std::shared_ptr<MacroActionTimer> entryData)
|
||||||
: QWidget(parent)
|
: QWidget(parent),
|
||||||
|
_macros(new MacroSelection(parent)),
|
||||||
|
_duration(new DurationSelection(this)),
|
||||||
|
_timerAction(new QComboBox(this))
|
||||||
{
|
{
|
||||||
_macros = new MacroSelection(parent);
|
|
||||||
_duration = new DurationSelection();
|
|
||||||
_timerAction = new QComboBox();
|
|
||||||
|
|
||||||
populateTypeSelection(_timerAction);
|
populateTypeSelection(_timerAction);
|
||||||
|
|
||||||
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
|
||||||
@@ -155,15 +172,13 @@ MacroActionTimerEdit::MacroActionTimerEdit(
|
|||||||
QWidget::connect(_timerAction, SIGNAL(currentIndexChanged(int)), this,
|
QWidget::connect(_timerAction, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(ActionTypeChanged(int)));
|
SLOT(ActionTypeChanged(int)));
|
||||||
|
|
||||||
_mainLayout = new QHBoxLayout;
|
auto layout = new QHBoxLayout;
|
||||||
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
|
|
||||||
{"{{macros}}", _macros},
|
|
||||||
{"{{duration}}", _duration},
|
|
||||||
{"{{timerAction}}", _timerAction},
|
|
||||||
};
|
|
||||||
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.timer.entry"),
|
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.timer.entry"),
|
||||||
_mainLayout, widgetPlaceholders);
|
layout,
|
||||||
setLayout(_mainLayout);
|
{{"{{macros}}", _macros},
|
||||||
|
{"{{duration}}", _duration},
|
||||||
|
{"{{timerAction}}", _timerAction}});
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
_entryData = entryData;
|
_entryData = entryData;
|
||||||
UpdateEntryData();
|
UpdateEntryData();
|
||||||
|
|||||||
@@ -58,16 +58,14 @@ private slots:
|
|||||||
signals:
|
signals:
|
||||||
void HeaderInfoChanged(const QString &);
|
void HeaderInfoChanged(const QString &);
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
void SetWidgetVisibility();
|
void SetWidgetVisibility();
|
||||||
|
|
||||||
MacroSelection *_macros;
|
MacroSelection *_macros;
|
||||||
DurationSelection *_duration;
|
DurationSelection *_duration;
|
||||||
QComboBox *_timerAction;
|
QComboBox *_timerAction;
|
||||||
std::shared_ptr<MacroActionTimer> _entryData;
|
|
||||||
|
|
||||||
private:
|
std::shared_ptr<MacroActionTimer> _entryData;
|
||||||
QHBoxLayout *_mainLayout;
|
|
||||||
bool _loading = true;
|
bool _loading = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ void MacroConditionProcessEdit::ProcessChanged(const QString &text)
|
|||||||
QString::fromStdString(_entryData->GetShortDesc()));
|
QString::fromStdString(_entryData->GetShortDesc()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroConditionProcessEdit::showEvent(QShowEvent *event)
|
void MacroConditionProcessEdit::showEvent(QShowEvent *)
|
||||||
{
|
{
|
||||||
const QSignalBlocker b(_processSelection);
|
const QSignalBlocker b(_processSelection);
|
||||||
const auto text = _processSelection->currentText();
|
const auto text = _processSelection->currentText();
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ static int currentRecordingDurationInSeconds = 0;
|
|||||||
|
|
||||||
bool MacroConditionRecord::CheckCondition()
|
bool MacroConditionRecord::CheckCondition()
|
||||||
{
|
{
|
||||||
|
char *lastSavePath = obs_frontend_get_last_recording();
|
||||||
|
SetTempVarValue("lastSavePath", lastSavePath ? lastSavePath : "");
|
||||||
|
bfree(lastSavePath);
|
||||||
|
|
||||||
switch (_condition) {
|
switch (_condition) {
|
||||||
case Condition::STOP:
|
case Condition::STOP:
|
||||||
return !obs_frontend_recording_active();
|
return !obs_frontend_recording_active();
|
||||||
@@ -74,6 +78,14 @@ void MacroConditionRecord::SetCondition(Condition condition)
|
|||||||
void MacroConditionRecord::SetupTempVars()
|
void MacroConditionRecord::SetupTempVars()
|
||||||
{
|
{
|
||||||
MacroCondition::SetupTempVars();
|
MacroCondition::SetupTempVars();
|
||||||
|
|
||||||
|
AddTempvar(
|
||||||
|
"lastSavePath",
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.tempVar.recording.lastSavePath"),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.tempVar.recording.lastSavePath.description"));
|
||||||
|
|
||||||
switch (_condition) {
|
switch (_condition) {
|
||||||
case Condition::DURATION:
|
case Condition::DURATION:
|
||||||
AddTempvar(
|
AddTempvar(
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ findListPropertyById(const obs_source_t *source, const std::string &id)
|
|||||||
}
|
}
|
||||||
auto property = obs_properties_first(properties);
|
auto property = obs_properties_first(properties);
|
||||||
return {findListPropertyByIdHelper(property, id),
|
return {findListPropertyByIdHelper(property, id),
|
||||||
properties_t(nullptr, obs_properties_destroy)};
|
properties_t(properties, obs_properties_destroy)};
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::pair<obs_property_t *, properties_t>
|
static std::pair<obs_property_t *, properties_t>
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ void EventSub::UnregisterInstance()
|
|||||||
void EventSub::ConnectThread()
|
void EventSub::ConnectThread()
|
||||||
{
|
{
|
||||||
_client->reset();
|
_client->reset();
|
||||||
_connected = true;
|
|
||||||
websocketpp::lib::error_code ec;
|
websocketpp::lib::error_code ec;
|
||||||
EventSubWSClient::connection_ptr con =
|
EventSubWSClient::connection_ptr con =
|
||||||
_client->get_connection(_url, ec);
|
_client->get_connection(_url, ec);
|
||||||
@@ -113,6 +112,7 @@ void EventSub::Connect()
|
|||||||
_thread.join();
|
_thread.join();
|
||||||
}
|
}
|
||||||
_disconnect = false;
|
_disconnect = false;
|
||||||
|
_connected = true;
|
||||||
_thread = std::thread(&EventSub::ConnectThread, this);
|
_thread = std::thread(&EventSub::ConnectThread, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ const static std::map<MacroActionTwitch::Action, std::string> actionTypes = {
|
|||||||
"AdvSceneSwitcher.action.twitch.type.user.getInfo"},
|
"AdvSceneSwitcher.action.twitch.type.user.getInfo"},
|
||||||
{MacroActionTwitch::Action::POINTS_REWARD_GET_INFO,
|
{MacroActionTwitch::Action::POINTS_REWARD_GET_INFO,
|
||||||
"AdvSceneSwitcher.action.twitch.type.reward.getInfo"},
|
"AdvSceneSwitcher.action.twitch.type.reward.getInfo"},
|
||||||
|
{MacroActionTwitch::Action::CHANNEL_GET_INFO,
|
||||||
|
"AdvSceneSwitcher.action.twitch.type.channel.getInfo"},
|
||||||
};
|
};
|
||||||
|
|
||||||
const static std::map<MacroActionTwitch::AnnouncementColor, std::string>
|
const static std::map<MacroActionTwitch::AnnouncementColor, std::string>
|
||||||
@@ -322,6 +324,41 @@ void MacroActionTwitch::GetUserInfo(const std::shared_ptr<TwitchToken> &token)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroActionTwitch::GetChannelInfo(const std::shared_ptr<TwitchToken> &token)
|
||||||
|
{
|
||||||
|
auto info = _channel.GetInfo(*token);
|
||||||
|
if (!info) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetTempVarValue("broadcaster_user_id", info->broadcaster_id);
|
||||||
|
SetTempVarValue("broadcaster_user_login", info->broadcaster_login);
|
||||||
|
SetTempVarValue("broadcaster_user_name", info->broadcaster_name);
|
||||||
|
SetTempVarValue("language", info->broadcaster_language);
|
||||||
|
SetTempVarValue("game_id", info->game_id);
|
||||||
|
SetTempVarValue("game_name", info->game_name);
|
||||||
|
SetTempVarValue("title", info->title);
|
||||||
|
SetTempVarValue("delay", std::to_string(info->delay));
|
||||||
|
std::string tags;
|
||||||
|
for (const auto &tag : info->tags) {
|
||||||
|
tags += tag + " ";
|
||||||
|
}
|
||||||
|
if (!tags.empty()) {
|
||||||
|
tags.pop_back();
|
||||||
|
}
|
||||||
|
SetTempVarValue("tags", tags);
|
||||||
|
std::string classificationLabels;
|
||||||
|
for (const auto &label : info->content_classification_labels) {
|
||||||
|
classificationLabels += label + " ";
|
||||||
|
}
|
||||||
|
if (!classificationLabels.empty()) {
|
||||||
|
classificationLabels.pop_back();
|
||||||
|
}
|
||||||
|
SetTempVarValue("content_classification_labels", classificationLabels);
|
||||||
|
SetTempVarValue("is_branded_content",
|
||||||
|
info->is_branded_content ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
bool MacroActionTwitch::ResolveVariableSelectionToRewardId(
|
bool MacroActionTwitch::ResolveVariableSelectionToRewardId(
|
||||||
const std::shared_ptr<TwitchToken> &token)
|
const std::shared_ptr<TwitchToken> &token)
|
||||||
{
|
{
|
||||||
@@ -505,6 +542,16 @@ void MacroActionTwitch::SetupTempVars()
|
|||||||
setupTempVarHelper("offline_image_url", ".user.getInfo");
|
setupTempVarHelper("offline_image_url", ".user.getInfo");
|
||||||
setupTempVarHelper("created_at", ".user.getInfo");
|
setupTempVarHelper("created_at", ".user.getInfo");
|
||||||
break;
|
break;
|
||||||
|
case Action::CHANNEL_GET_INFO:
|
||||||
|
setupTempVarHelper("language");
|
||||||
|
setupTempVarHelper("game_id");
|
||||||
|
setupTempVarHelper("game_name");
|
||||||
|
setupTempVarHelper("title");
|
||||||
|
setupTempVarHelper("delay");
|
||||||
|
setupTempVarHelper("tags");
|
||||||
|
setupTempVarHelper("content_classification_labels");
|
||||||
|
setupTempVarHelper("is_branded_content");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -563,6 +610,9 @@ bool MacroActionTwitch::PerformAction()
|
|||||||
case MacroActionTwitch::Action::POINTS_REWARD_GET_INFO:
|
case MacroActionTwitch::Action::POINTS_REWARD_GET_INFO:
|
||||||
GetRewardInfo(token);
|
GetRewardInfo(token);
|
||||||
break;
|
break;
|
||||||
|
case MacroActionTwitch::Action::CHANNEL_GET_INFO:
|
||||||
|
GetChannelInfo(token);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -772,6 +822,7 @@ bool MacroActionTwitch::ActionIsSupportedByToken()
|
|||||||
{Action::WHISPER_SEND, {{"user:manage:whispers"}}},
|
{Action::WHISPER_SEND, {{"user:manage:whispers"}}},
|
||||||
{Action::SEND_CHAT_MESSAGE, {{"chat:edit"}}},
|
{Action::SEND_CHAT_MESSAGE, {{"chat:edit"}}},
|
||||||
{Action::USER_GET_INFO, {}},
|
{Action::USER_GET_INFO, {}},
|
||||||
|
{Action::CHANNEL_GET_INFO, {}},
|
||||||
{Action::POINTS_REWARD_GET_INFO,
|
{Action::POINTS_REWARD_GET_INFO,
|
||||||
{{"channel:read:redemptions"},
|
{{"channel:read:redemptions"},
|
||||||
{"channel:manage:redemptions"}}}};
|
{"channel:manage:redemptions"}}}};
|
||||||
@@ -1127,6 +1178,8 @@ void MacroActionTwitchEdit::SetWidgetVisibility()
|
|||||||
_entryData->GetAction() ==
|
_entryData->GetAction() ==
|
||||||
MacroActionTwitch::Action::CHANNEL_INFO_CONTENT_LABELS_SET);
|
MacroActionTwitch::Action::CHANNEL_INFO_CONTENT_LABELS_SET);
|
||||||
_channel->setVisible(
|
_channel->setVisible(
|
||||||
|
_entryData->GetAction() ==
|
||||||
|
MacroActionTwitch::Action::CHANNEL_GET_INFO ||
|
||||||
_entryData->GetAction() ==
|
_entryData->GetAction() ==
|
||||||
MacroActionTwitch::Action::RAID_START ||
|
MacroActionTwitch::Action::RAID_START ||
|
||||||
_entryData->GetAction() ==
|
_entryData->GetAction() ==
|
||||||
@@ -1273,19 +1326,23 @@ void MacroActionTwitchEdit::SetWidgetLayout()
|
|||||||
switch (_entryData->GetAction()) {
|
switch (_entryData->GetAction()) {
|
||||||
case MacroActionTwitch::Action::SEND_CHAT_MESSAGE:
|
case MacroActionTwitch::Action::SEND_CHAT_MESSAGE:
|
||||||
layoutText = obs_module_text(
|
layoutText = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.twitch.entry.chat");
|
"AdvSceneSwitcher.action.twitch.layout.chat");
|
||||||
break;
|
break;
|
||||||
case MacroActionTwitch::Action::USER_GET_INFO:
|
case MacroActionTwitch::Action::USER_GET_INFO:
|
||||||
layoutText = obs_module_text(
|
layoutText = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.twitch.entry.user.getInfo");
|
"AdvSceneSwitcher.action.twitch.layout.user.getInfo");
|
||||||
break;
|
break;
|
||||||
case MacroActionTwitch::Action::POINTS_REWARD_GET_INFO:
|
case MacroActionTwitch::Action::POINTS_REWARD_GET_INFO:
|
||||||
layoutText = obs_module_text(
|
layoutText = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.twitch.entry.reward.getInfo");
|
"AdvSceneSwitcher.action.twitch.layout.reward.getInfo");
|
||||||
|
break;
|
||||||
|
case MacroActionTwitch::Action::CHANNEL_GET_INFO:
|
||||||
|
layoutText = obs_module_text(
|
||||||
|
"AdvSceneSwitcher.action.twitch.layout.channel.getInfo");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
layoutText = obs_module_text(
|
layoutText = obs_module_text(
|
||||||
"AdvSceneSwitcher.action.twitch.entry.default");
|
"AdvSceneSwitcher.action.twitch.layout.default");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ public:
|
|||||||
SEND_CHAT_MESSAGE = 5000,
|
SEND_CHAT_MESSAGE = 5000,
|
||||||
|
|
||||||
// Get user info
|
// Get user info
|
||||||
USER_GET_INFO = 6000
|
USER_GET_INFO = 6000,
|
||||||
|
CHANNEL_GET_INFO = 6100,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class AnnouncementColor {
|
enum class AnnouncementColor {
|
||||||
@@ -203,6 +204,7 @@ private:
|
|||||||
void SendChatMessage(const std::shared_ptr<TwitchToken> &);
|
void SendChatMessage(const std::shared_ptr<TwitchToken> &);
|
||||||
void GetUserInfo(const std::shared_ptr<TwitchToken> &);
|
void GetUserInfo(const std::shared_ptr<TwitchToken> &);
|
||||||
void GetRewardInfo(const std::shared_ptr<TwitchToken> &);
|
void GetRewardInfo(const std::shared_ptr<TwitchToken> &);
|
||||||
|
void GetChannelInfo(const std::shared_ptr<TwitchToken> &token);
|
||||||
|
|
||||||
bool ResolveVariableSelectionToRewardId(
|
bool ResolveVariableSelectionToRewardId(
|
||||||
const std::shared_ptr<TwitchToken> &);
|
const std::shared_ptr<TwitchToken> &);
|
||||||
|
|||||||
@@ -629,7 +629,7 @@ void MacroConditionTwitch::SetTempVarValues(const ChannelInfo &info)
|
|||||||
if (!classificationLabels.empty()) {
|
if (!classificationLabels.empty()) {
|
||||||
classificationLabels.pop_back();
|
classificationLabels.pop_back();
|
||||||
}
|
}
|
||||||
SetTempVarValue("content_classification_labels", tags);
|
SetTempVarValue("content_classification_labels", classificationLabels);
|
||||||
SetTempVarValue("is_branded_content",
|
SetTempVarValue("is_branded_content",
|
||||||
info.is_branded_content ? "true" : "false");
|
info.is_branded_content ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,8 +106,11 @@ target_sources(
|
|||||||
|
|
||||||
# --- variable --- #
|
# --- variable --- #
|
||||||
|
|
||||||
if(NOT OS_WINDOWS)
|
if(OS_WINDOWS)
|
||||||
target_compile_options(${PROJECT_NAME} PUBLIC -Wno-error=shadow)
|
target_compile_options(${PROJECT_NAME} PRIVATE /wd4100)
|
||||||
|
else()
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-error=shadow
|
||||||
|
-Wno-unused-parameter)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_sources(
|
target_sources(
|
||||||
|
|||||||
Reference in New Issue
Block a user