UI: Add obs_frontend_add_scene_collection API call

Allows the ability to add a new scene collection via the frontend API.
Blocks until the scene collection has been successfully added to ensure
synchronization between the calling thread and the UI thread.

(Jim: Added detailed description to commit message)

Closes obsproject/obs-studio#1232
This commit is contained in:
Ilya Melamed
2018-05-04 15:36:01 -07:00
committed by jp9000
parent 3eec139b2e
commit c768f703ad
6 changed files with 37 additions and 4 deletions

View File

@@ -148,6 +148,13 @@ void obs_frontend_set_current_scene_collection(const char *collection)
c->obs_frontend_set_current_scene_collection(collection);
}
bool obs_frontend_add_scene_collection(const char *name)
{
return callbacks_valid()
? c->obs_frontend_add_scene_collection(name)
: false;
}
char **obs_frontend_get_profiles(void)
{
if (!callbacks_valid())

View File

@@ -95,6 +95,7 @@ EXPORT void obs_frontend_set_current_transition(obs_source_t *transition);
EXPORT char **obs_frontend_get_scene_collections(void);
EXPORT char *obs_frontend_get_current_scene_collection(void);
EXPORT void obs_frontend_set_current_scene_collection(const char *collection);
EXPORT bool obs_frontend_add_scene_collection(const char *name);
EXPORT char **obs_frontend_get_profiles(void);
EXPORT char *obs_frontend_get_current_profile(void);

View File

@@ -26,6 +26,7 @@ struct obs_frontend_callbacks {
virtual char *obs_frontend_get_current_scene_collection(void)=0;
virtual void obs_frontend_set_current_scene_collection(
const char *collection)=0;
virtual bool obs_frontend_add_scene_collection(const char *name)=0;
virtual void obs_frontend_get_profiles(
std::vector<std::string> &strings)=0;