Skip to content

Commit 732d5af

Browse files
committed
EventHandler: Add Ui category
1 parent 0939273 commit 732d5af

File tree

3 files changed

+41
-20
lines changed

3 files changed

+41
-20
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ set(obs-websocket_SOURCES
103103
src/eventhandler/EventHandler_Outputs.cpp
104104
src/eventhandler/EventHandler_SceneItems.cpp
105105
src/eventhandler/EventHandler_MediaInputs.cpp
106+
src/eventhandler/EventHandler_Ui.cpp
106107
src/requesthandler/RequestHandler.cpp
107108
src/requesthandler/RequestBatchHandler.cpp
108109
src/requesthandler/RequestHandler_General.cpp

src/eventhandler/EventHandler_General.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,3 @@ void EventHandler::HandleExitStarted()
3434
{
3535
BroadcastEvent(EventSubscription::General, "ExitStarted");
3636
}
37-
38-
/**
39-
* Studio mode has been enabled or disabled.
40-
*
41-
* @dataField studioModeEnabled | Boolean | True == Enabled, False == Disabled
42-
*
43-
* @eventType StudioModeStateChanged
44-
* @eventSubscription General
45-
* @complexity 1
46-
* @rpcVersion -1
47-
* @initialVersion 5.0.0
48-
* @category general
49-
* @api events
50-
*/
51-
void EventHandler::HandleStudioModeStateChanged(bool enabled)
52-
{
53-
json eventData;
54-
eventData["studioModeEnabled"] = enabled;
55-
BroadcastEvent(EventSubscription::General, "StudioModeStateChanged", eventData);
56-
}

src/eventhandler/EventHandler_Ui.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
obs-websocket
3+
Copyright (C) 2016-2021 Stephane Lepin <[email protected]>
4+
Copyright (C) 2020-2021 Kyle Manning <[email protected]>
5+
6+
This program is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License along
17+
with this program. If not, see <https://www.gnu.org/licenses/>
18+
*/
19+
20+
#include "EventHandler.h"
21+
22+
/**
23+
* Studio mode has been enabled or disabled.
24+
*
25+
* @dataField studioModeEnabled | Boolean | True == Enabled, False == Disabled
26+
*
27+
* @eventType StudioModeStateChanged
28+
* @eventSubscription Ui
29+
* @complexity 1
30+
* @rpcVersion -1
31+
* @initialVersion 5.0.0
32+
* @category ui
33+
* @api events
34+
*/
35+
void EventHandler::HandleStudioModeStateChanged(bool enabled)
36+
{
37+
json eventData;
38+
eventData["studioModeEnabled"] = enabled;
39+
BroadcastEvent(EventSubscription::Ui, "StudioModeStateChanged", eventData);
40+
}

0 commit comments

Comments
 (0)