mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
events(ProfileListChanged): add profile list property
This commit is contained in:
parent
0dc8e070ff
commit
542761e411
@ -572,14 +572,21 @@ void WSEvents::OnProfileChange() {
|
||||
/**
|
||||
* Triggered when a profile is created, added, renamed, or removed.
|
||||
*
|
||||
* @return {Array} `profiles` Profiles list.
|
||||
* @return {String} `profiles.*.name` Profile name.
|
||||
*
|
||||
* @api events
|
||||
* @name ProfileListChanged
|
||||
* @category profiles
|
||||
* @since 4.0.0
|
||||
*/
|
||||
void WSEvents::OnProfileListChange() {
|
||||
char** profiles = obs_frontend_get_profiles();
|
||||
OBSDataArrayAutoRelease profilesList = Utils::StringListToArray(profiles, "name");
|
||||
bfree(profiles);
|
||||
|
||||
OBSDataAutoRelease fields = obs_data_create();
|
||||
// TODO provide new profile list
|
||||
obs_data_set_array(fields, "profiles", profilesList);
|
||||
broadcastUpdate("ProfileListChanged", fields);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user