mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-18 14:50:16 -05:00
Allow switching to already active scene if in studio mode
Preview and program scene can differ in regards to the active scene items. Thus it can make sense to switch to the already active scene.
This commit is contained in:
parent
02e380a9f2
commit
c94a791d19
|
|
@ -343,7 +343,7 @@ bool SwitcherData::checkForMatch(OBSWeakSource &scene,
|
|||
return match;
|
||||
}
|
||||
|
||||
void switchScene(const sceneSwitchInfo &sceneSwitch)
|
||||
void switchScene(const sceneSwitchInfo &sceneSwitch, bool force)
|
||||
{
|
||||
if (!sceneSwitch.scene && switcher->verbose) {
|
||||
blog(LOG_INFO, "nothing to switch to");
|
||||
|
|
@ -353,7 +353,7 @@ void switchScene(const sceneSwitchInfo &sceneSwitch)
|
|||
obs_source_t *source = obs_weak_source_get_source(sceneSwitch.scene);
|
||||
obs_source_t *currentSource = obs_frontend_get_current_scene();
|
||||
|
||||
if (source && source != currentSource) {
|
||||
if (source && (source != currentSource || force)) {
|
||||
transitionData currentTransitionData;
|
||||
setNextTransition(sceneSwitch, currentSource,
|
||||
currentTransitionData);
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ void setNextTransition(const sceneSwitchInfo &ssi, obs_source_t *currentSource,
|
|||
void overwriteTransitionOverride(const sceneSwitchInfo &ssi,
|
||||
transitionData &td);
|
||||
void restoreTransitionOverride(obs_source_t *scene, const transitionData &td);
|
||||
void switchScene(const sceneSwitchInfo &ssi);
|
||||
void switchScene(const sceneSwitchInfo &ssi, bool force = false);
|
||||
void switchPreviewScene(const OBSWeakSource &ws);
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ bool MacroActionSwitchScene::PerformAction()
|
|||
{
|
||||
auto scene = _scene.GetScene();
|
||||
switchScene({scene, _transition.GetTransition(),
|
||||
(int)(_duration.seconds * 1000)});
|
||||
(int)(_duration.seconds * 1000)},
|
||||
obs_frontend_preview_program_mode_active());
|
||||
if (_blockUntilTransitionDone && scene) {
|
||||
waitForTransitionChange(scene);
|
||||
return !switcher->abortMacroWait;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user