UI: Change certain scene functions to slot functions
This allows using the functions via Qt message queue. The reason for this is so a frontend API can queue these functions to call safely from another thread.
This commit is contained in:
parent
7224e8d36e
commit
9ed95b2497
@ -220,7 +220,7 @@ obs_source_t *OBSBasic::FindTransition(const char *name)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void OBSBasic::TransitionToScene(obs_scene_t *scene, bool force)
|
||||
void OBSBasic::TransitionToScene(OBSScene scene, bool force)
|
||||
{
|
||||
obs_source_t *source = obs_scene_get_source(scene);
|
||||
TransitionToScene(source, force);
|
||||
@ -237,7 +237,7 @@ void OBSBasic::TransitionStopped()
|
||||
swapScene = nullptr;
|
||||
}
|
||||
|
||||
void OBSBasic::TransitionToScene(obs_source_t *source, bool force)
|
||||
void OBSBasic::TransitionToScene(OBSSource source, bool force)
|
||||
{
|
||||
obs_scene_t *scene = obs_scene_from_source(source);
|
||||
bool usingPreviewProgram = IsPreviewProgramMode();
|
||||
@ -293,7 +293,7 @@ static inline void SetComboTransition(QComboBox *combo, obs_source_t *tr)
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::SetTransition(obs_source_t *transition)
|
||||
void OBSBasic::SetTransition(OBSSource transition)
|
||||
{
|
||||
obs_source_t *oldTransition = obs_get_output_source(0);
|
||||
|
||||
@ -530,7 +530,7 @@ static T GetOBSRef(QListWidgetItem *item)
|
||||
return item->data(static_cast<int>(QtDataRole::OBSRef)).value<T>();
|
||||
}
|
||||
|
||||
void OBSBasic::SetCurrentScene(obs_source_t *scene, bool force)
|
||||
void OBSBasic::SetCurrentScene(OBSSource scene, bool force)
|
||||
{
|
||||
if (!IsPreviewProgramMode()) {
|
||||
TransitionToScene(scene, force);
|
||||
|
@ -232,10 +232,7 @@ private:
|
||||
|
||||
void InitDefaultTransitions();
|
||||
void InitTransition(obs_source_t *transition);
|
||||
void TransitionToScene(obs_scene_t *scene, bool force = false);
|
||||
void TransitionToScene(obs_source_t *scene, bool force = false);
|
||||
obs_source_t *FindTransition(const char *name);
|
||||
void SetTransition(obs_source_t *transition);
|
||||
OBSSource GetCurrentTransition();
|
||||
obs_data_array_t *SaveTransitions();
|
||||
void LoadTransitions(obs_data_array_t *transitions);
|
||||
@ -265,7 +262,6 @@ private:
|
||||
void SetPreviewProgramMode(bool enabled);
|
||||
void ResizeProgram(uint32_t cx, uint32_t cy);
|
||||
void SetCurrentScene(obs_scene_t *scene, bool force = false);
|
||||
void SetCurrentScene(obs_source_t *scene, bool force = false);
|
||||
static void RenderProgram(void *data, uint32_t cx, uint32_t cy);
|
||||
|
||||
std::vector<QuickTransition> quickTransitions;
|
||||
@ -316,6 +312,11 @@ public slots:
|
||||
void SaveProjectDeferred();
|
||||
void SaveProject();
|
||||
|
||||
void SetTransition(OBSSource transition);
|
||||
void TransitionToScene(OBSScene scene, bool force = false);
|
||||
void TransitionToScene(OBSSource scene, bool force = false);
|
||||
void SetCurrentScene(OBSSource scene, bool force = false);
|
||||
|
||||
private slots:
|
||||
void AddSceneItem(OBSSceneItem item);
|
||||
void RemoveSceneItem(OBSSceneItem item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user