Events: Prepare to add a few new OBS events

Pending PR merge and version release
This commit is contained in:
tt2468 2021-10-06 00:44:42 -07:00
parent 1b25e98dc2
commit 42c78f1831
3 changed files with 22 additions and 0 deletions

View File

@ -237,12 +237,18 @@ void EventHandler::OnFrontendEvent(enum obs_frontend_event event, void *private_
break;
// Config
//case OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING:
// eventHandler->HandleCurrentSceneCollectionChanging();
// break;
case OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED:
eventHandler->HandleCurrentSceneCollectionChanged();
break;
case OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED:
eventHandler->HandleSceneCollectionListChanged();
break;
//case OBS_FRONTEND_EVENT_PROFILE_CHANGING:
// eventHandler->HandleCurrentProfileChanging();
// break;
case OBS_FRONTEND_EVENT_PROFILE_CHANGED:
eventHandler->HandleCurrentProfileChanged();
break;

View File

@ -69,8 +69,10 @@ class EventHandler
void HandleStudioModeStateChanged(bool enabled);
// Config
void HandleCurrentSceneCollectionChanging();
void HandleCurrentSceneCollectionChanged();
void HandleSceneCollectionListChanged();
void HandleCurrentProfileChanging();
void HandleCurrentProfileChanged();
void HandleProfileListChanged();

View File

@ -1,5 +1,12 @@
#include "EventHandler.h"
void EventHandler::HandleCurrentSceneCollectionChanging()
{
json eventData;
eventData["sceneCollectionName"] = Utils::Obs::StringHelper::GetCurrentSceneCollection();
BroadcastEvent(EventSubscription::Config, "CurrentSceneCollectionChanging", eventData);
}
void EventHandler::HandleCurrentSceneCollectionChanged()
{
json eventData;
@ -14,6 +21,13 @@ void EventHandler::HandleSceneCollectionListChanged()
BroadcastEvent(EventSubscription::Config, "SceneCollectionListChanged", eventData);
}
void EventHandler::HandleCurrentProfileChanging()
{
json eventData;
eventData["profileName"] = Utils::Obs::StringHelper::GetCurrentProfile();
BroadcastEvent(EventSubscription::Config, "CurrentProfileChanging", eventData);
}
void EventHandler::HandleCurrentProfileChanged()
{
json eventData;