move transition warning label and change default transition only once per scene change

This commit is contained in:
WarmUpTill
2020-10-18 19:21:52 +02:00
parent 0b7faee84f
commit 6b1a01de5e
4 changed files with 21 additions and 13 deletions

View File

@@ -534,8 +534,9 @@ void handleSceneChange(SwitcherData *s)
s->PreviousScene2 = ws;
}
//reset autostart
//reset events only hanled on scene change
s->autoStartedRecently = false;
s->changedDefTransitionRecently = false;
}
void setLiveTime(SwitcherData *s)

View File

@@ -93,6 +93,7 @@ struct SwitcherData {
std::deque<SceneTransition> sceneTransitions;
std::deque<DefaultSceneTransition> defaultSceneTransitions;
bool changedDefTransitionRecently = false;
std::deque<MediaSwitch> mediaSwitches;

View File

@@ -144,6 +144,9 @@ void AdvSceneSwitcher::on_defaultTransitionsDown_clicked()
void SwitcherData::setDefaultSceneTransitions()
{
if (changedDefTransitionRecently)
return;
obs_source_t *currentSource = obs_frontend_get_current_scene();
obs_weak_source_t *ws = obs_source_get_weak_source(currentSource);
@@ -167,6 +170,7 @@ void SwitcherData::setDefaultSceneTransitions()
}
obs_source_release(currentSource);
obs_weak_source_release(ws);
changedDefTransitionRecently = true;
}
void AdvSceneSwitcher::on_transitionOverridecheckBox_stateChanged(int state)
@@ -191,8 +195,10 @@ obs_weak_source_t *getNextTransition(obs_weak_source_t *scene1,
if (!t.initialized())
continue;
if (t.scene == scene1 && t.scene2 == scene2)
if (t.scene == scene1 && t.scene2 == scene2) {
ws = t.transition;
break;
}
}
obs_weak_source_addref(ws);
}