mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-22 01:05:53 -05:00
move transition warning label and change default transition only once per scene change
This commit is contained in:
@@ -614,22 +614,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_36">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>The settings below only affect scene transitions caused by the scene switcher and not the ones you are causing manually. Additionally they will take priority over transition settings configured elsewhere in the scene switcher.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="transitionsGroup">
|
||||
<property name="title">
|
||||
<string>Use transition for automated scene switch from scene1 to scene2</string>
|
||||
<string>Use transition for automated scene switch from scene A to scene B</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_36">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-style:italic;">Only</span> transitions caused by the scene switcher and not the ones you are causing manually are affected by these settings. <br/>Settings defined here take priority over transition settings configured elsewhere in the scene switcher.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="sceneTransitions">
|
||||
<property name="sizePolicy">
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -93,6 +93,7 @@ struct SwitcherData {
|
||||
|
||||
std::deque<SceneTransition> sceneTransitions;
|
||||
std::deque<DefaultSceneTransition> defaultSceneTransitions;
|
||||
bool changedDefTransitionRecently = false;
|
||||
|
||||
std::deque<MediaSwitch> mediaSwitches;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user