Skip to content

Commit

Permalink
Add option to open properties and filter windows of sources
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Oct 5, 2023
1 parent e13e4b5 commit 4801502
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ AdvSceneSwitcher.action.source.type.refreshSettings.tooltip="Can be used to refr
AdvSceneSwitcher.action.source.type.deinterlaceMode="Set deinterlace mode"
AdvSceneSwitcher.action.source.type.deinterlaceOrder="Set deinterlace field order"
AdvSceneSwitcher.action.source.type.openInteractionDialog="Open interaction dialog"
AdvSceneSwitcher.action.source.type.openFilterDialog="Open filter dialog"
AdvSceneSwitcher.action.source.type.openPropertiesDialog="Open properties dialog"
AdvSceneSwitcher.action.source.noSettingsButtons="No buttons found!"
AdvSceneSwitcher.action.source.entry="{{actions}}{{sources}}{{settingsButtons}}{{deinterlaceMode}}{{deinterlaceOrder}}"
AdvSceneSwitcher.action.source.warning="Warning: Enabling and disabling sources globally cannot be controlled by the OBS UI\nYou might be looking for \"Scene item visibility\""
Expand Down
10 changes: 10 additions & 0 deletions src/macro-core/macro-action-source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const static std::map<MacroActionSource::Action, std::string> actionTypes = {
"AdvSceneSwitcher.action.source.type.deinterlaceOrder"},
{MacroActionSource::Action::OPEN_INTERACTION_DIALOG,
"AdvSceneSwitcher.action.source.type.openInteractionDialog"},
{MacroActionSource::Action::OPEN_FILTER_DIALOG,
"AdvSceneSwitcher.action.source.type.openFilterDialog"},
{MacroActionSource::Action::OPEN_PROPERTIES_DIALOG,
"AdvSceneSwitcher.action.source.type.openPropertiesDialog"},
};

const static std::map<obs_deinterlace_mode, std::string> deinterlaceModes = {
Expand Down Expand Up @@ -153,6 +157,12 @@ bool MacroActionSource::PerformAction()
_source.ToString().c_str());
}
break;
case Action::OPEN_FILTER_DIALOG:
obs_frontend_open_source_filters(s);
break;
case Action::OPEN_PROPERTIES_DIALOG:
obs_frontend_open_source_properties(s);
break;
default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions src/macro-core/macro-action-source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class MacroActionSource : public MacroAction {
DEINTERLACE_MODE,
DEINTERLACE_FIELD_ORDER,
OPEN_INTERACTION_DIALOG,
OPEN_FILTER_DIALOG,
OPEN_PROPERTIES_DIALOG,
};
Action _action = Action::ENABLE;

Expand Down

0 comments on commit 4801502

Please sign in to comment.