mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-04 10:33:30 +00:00
UI: Add obs_frontend_get_current_profile_path()
Returns the path of the current profile's location on the filesystem.
This commit is contained in:
parent
53a8a326da
commit
9ca70f4470
|
@ -238,6 +238,16 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
|||
return bstrdup(name);
|
||||
}
|
||||
|
||||
char *obs_frontend_get_current_profile_path(void) override
|
||||
{
|
||||
char profilePath[512];
|
||||
int ret = GetProfilePath(profilePath, sizeof(profilePath), "");
|
||||
if (ret <= 0)
|
||||
return nullptr;
|
||||
|
||||
return bstrdup(profilePath);
|
||||
}
|
||||
|
||||
void obs_frontend_set_current_profile(const char *profile) override
|
||||
{
|
||||
QList<QAction *> menuActions = main->ui->profileMenu->actions();
|
||||
|
|
|
@ -204,6 +204,12 @@ char *obs_frontend_get_current_profile(void)
|
|||
: nullptr;
|
||||
}
|
||||
|
||||
char *obs_frontend_get_current_profile_path(void)
|
||||
{
|
||||
return !!callbacks_valid() ? c->obs_frontend_get_current_profile_path()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
void obs_frontend_set_current_profile(const char *profile)
|
||||
{
|
||||
if (callbacks_valid())
|
||||
|
|
|
@ -117,6 +117,7 @@ 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);
|
||||
EXPORT char *obs_frontend_get_current_profile_path(void);
|
||||
EXPORT void obs_frontend_set_current_profile(const char *profile);
|
||||
|
||||
typedef void (*obs_frontend_cb)(void *private_data);
|
||||
|
|
|
@ -37,6 +37,7 @@ struct obs_frontend_callbacks {
|
|||
virtual void
|
||||
obs_frontend_get_profiles(std::vector<std::string> &strings) = 0;
|
||||
virtual char *obs_frontend_get_current_profile(void) = 0;
|
||||
virtual char *obs_frontend_get_current_profile_path(void) = 0;
|
||||
virtual void obs_frontend_set_current_profile(const char *profile) = 0;
|
||||
|
||||
virtual void obs_frontend_streaming_start(void) = 0;
|
||||
|
|
|
@ -314,6 +314,13 @@ Functions
|
|||
|
||||
---------------------------------------
|
||||
|
||||
.. function:: char *obs_frontend_get_current_profile_path(void)
|
||||
|
||||
:return: A new pointer to the current profile's path on the filesystem. Free
|
||||
with :c:func:`bfree()`.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
.. function:: void obs_frontend_set_current_profile(const char *profile)
|
||||
|
||||
:param profile: Name of the profile to activate.
|
||||
|
|
Loading…
Reference in a new issue