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

@@ -614,22 +614,22 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_36">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Only&lt;/span&gt; transitions caused by the scene switcher and not the ones you are causing manually are affected by these settings. &lt;br/&gt;Settings defined here take priority over transition settings configured elsewhere in the scene switcher.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="sceneTransitions">
<property name="sizePolicy">

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);
}