mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
EventHandler: Add EventSubscriptions enum
This commit is contained in:
parent
4d6901c075
commit
11d28d17f1
@ -94,6 +94,7 @@ set(obs-websocket_HEADERS
|
||||
src/WebSocketProtocol.h
|
||||
src/WebSocketSession.h
|
||||
src/eventhandler/EventHandler.h
|
||||
src/eventhandler/types/EventSubscriptions.h
|
||||
src/requesthandler/RequestHandler.h
|
||||
src/requesthandler/rpc/Request.h
|
||||
src/requesthandler/rpc/RequestResult.h
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "WebSocketSession.h"
|
||||
#include "eventhandler/types/EventSubscriptions.h"
|
||||
|
||||
#include "plugin-macros.generated.h"
|
||||
|
||||
@ -13,7 +14,7 @@ WebSocketSession::WebSocketSession() :
|
||||
_isIdentified(false),
|
||||
_ignoreInvalidMessages(false),
|
||||
_ignoreNonFatalRequestChecks(false),
|
||||
_eventSubscriptions(0)
|
||||
_eventSubscriptions(EventSubscriptions::All)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "../obs-websocket.h"
|
||||
#include "../WebSocketServer.h"
|
||||
#include "types/EventSubscriptions.h"
|
||||
|
||||
class EventHandler
|
||||
{
|
||||
|
28
src/eventhandler/types/EventSubscriptions.h
Normal file
28
src/eventhandler/types/EventSubscriptions.h
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
namespace EventSubscriptions {
|
||||
enum EventSubscriptions {
|
||||
// Set subscriptions to 0 to disable all events
|
||||
None = 0,
|
||||
// Receive events in the `General` category
|
||||
General = (1 << 0),
|
||||
// Receive events in the `Config` category
|
||||
Config = (1 << 1),
|
||||
// Receive events in the `Scenes` category
|
||||
Scenes = (1 << 2),
|
||||
// Receive events in the `Inputs` category
|
||||
Inputs = (1 << 3),
|
||||
// Receive events in the `Transitions` category
|
||||
Transitions = (1 << 4),
|
||||
// Receive events in the `Filters` category
|
||||
Filters = (1 << 5),
|
||||
// Receive events in the `Outputs` category
|
||||
Outputs = (1 << 6),
|
||||
// Receive events in the `Scene Items` category
|
||||
SceneItems = (1 << 7),
|
||||
// Receive events in the `MediaInputs` category
|
||||
MediaInputs = (1 << 8),
|
||||
// Receive all event categories
|
||||
All = (General | Config | Scenes | Inputs | Transitions | Filters | Outputs | SceneItems | MediaInputs),
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user