Merge pull request #2107 from cg2121/mantis-1554

UI: Fix swap scene issue with double click mode
master
Jim 2019-11-20 01:51:44 -08:00 committed by GitHub
commit 317d058bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 27 deletions

View File

@ -131,7 +131,7 @@ void OBSBasic::TriggerQuickTransition(int id)
overridingTransition = true;
}
TransitionToScene(source, false, false, true, qt->duration,
TransitionToScene(source, false, true, qt->duration,
qt->fadeToBlack);
}
}
@ -255,10 +255,10 @@ obs_source_t *OBSBasic::FindTransition(const char *name)
return nullptr;
}
void OBSBasic::TransitionToScene(OBSScene scene, bool force, bool direct)
void OBSBasic::TransitionToScene(OBSScene scene, bool force)
{
obs_source_t *source = obs_scene_get_source(scene);
TransitionToScene(source, force, direct);
TransitionToScene(source, force);
}
void OBSBasic::TransitionStopped()
@ -304,7 +304,7 @@ void OBSBasic::TransitionFullyStopped()
}
}
void OBSBasic::TransitionToScene(OBSSource source, bool force, bool direct,
void OBSBasic::TransitionToScene(OBSSource source, bool force,
bool quickTransition, int quickDuration,
bool black)
{
@ -319,7 +319,7 @@ void OBSBasic::TransitionToScene(OBSSource source, bool force, bool direct,
lastProgramScene = programScene;
programScene = OBSGetWeakRef(source);
if (swapScenesMode && !force && !direct && !black) {
if (swapScenesMode && !force && !black) {
OBSSource newScene = OBSGetStrongRef(lastProgramScene);
if (!sceneDuplicationMode && newScene == source)
@ -676,10 +676,10 @@ int OBSBasic::GetQuickTransitionIdx(int id)
return -1;
}
void OBSBasic::SetCurrentScene(obs_scene_t *scene, bool force, bool direct)
void OBSBasic::SetCurrentScene(obs_scene_t *scene, bool force)
{
obs_source_t *source = obs_scene_get_source(scene);
SetCurrentScene(source, force, direct);
SetCurrentScene(source, force);
}
template<typename T> static T GetOBSRef(QListWidgetItem *item)
@ -687,14 +687,10 @@ template<typename T> static T GetOBSRef(QListWidgetItem *item)
return item->data(static_cast<int>(QtDataRole::OBSRef)).value<T>();
}
void OBSBasic::SetCurrentScene(OBSSource scene, bool force, bool direct)
void OBSBasic::SetCurrentScene(OBSSource scene, bool force)
{
if (!IsPreviewProgramMode() && !direct) {
TransitionToScene(scene, force, false);
} else if (IsPreviewProgramMode() && direct) {
TransitionToScene(scene, force, true);
if (!IsPreviewProgramMode()) {
TransitionToScene(scene, force);
} else {
OBSSource actualLastScene = OBSGetStrongRef(lastScene);
if (actualLastScene != scene) {

View File

@ -4570,12 +4570,8 @@ void OBSBasic::on_scenes_itemDoubleClicked(QListWidgetItem *witem)
config_get_bool(App()->GlobalConfig(), "BasicWindow",
"TransitionOnDoubleClick");
if (doubleClickSwitch) {
OBSScene scene = GetCurrentScene();
if (scene)
SetCurrentScene(scene, false, true);
}
if (doubleClickSwitch)
TransitionClicked();
}
}

View File

@ -372,8 +372,7 @@ private:
void SetPreviewProgramMode(bool enabled);
void ResizeProgram(uint32_t cx, uint32_t cy);
void SetCurrentScene(obs_scene_t *scene, bool force = false,
bool direct = false);
void SetCurrentScene(obs_scene_t *scene, bool force = false);
static void RenderProgram(void *data, uint32_t cx, uint32_t cy);
std::vector<QuickTransition> quickTransitions;
@ -477,14 +476,11 @@ public slots:
void SetTransition(OBSSource transition);
void OverrideTransition(OBSSource transition);
void TransitionToScene(OBSScene scene, bool force = false,
bool direct = false);
void TransitionToScene(OBSScene scene, bool force = false);
void TransitionToScene(OBSSource scene, bool force = false,
bool direct = false,
bool quickTransition = false,
int quickDuration = 0, bool black = false);
void SetCurrentScene(OBSSource scene, bool force = false,
bool direct = false);
void SetCurrentScene(OBSSource scene, bool force = false);
bool AddSceneCollection(bool create_new,
const QString &name = QString());