This repository has been archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
event_utils.go
160 lines (156 loc) · 6.36 KB
/
event_utils.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package obsws
// This file is automatically generated.
// https://github.com/christopher-dG/go-obs-websocket/blob/master/codegen/protocol.py
var eventMap = map[string]func() Event{
"SwitchScenes": func() Event { return &SwitchScenesEvent{} },
"ScenesChanged": func() Event { return &ScenesChangedEvent{} },
"SceneCollectionChanged": func() Event { return &SceneCollectionChangedEvent{} },
"SceneCollectionListChanged": func() Event { return &SceneCollectionListChangedEvent{} },
"SwitchTransition": func() Event { return &SwitchTransitionEvent{} },
"TransitionListChanged": func() Event { return &TransitionListChangedEvent{} },
"TransitionDurationChanged": func() Event { return &TransitionDurationChangedEvent{} },
"TransitionBegin": func() Event { return &TransitionBeginEvent{} },
"ProfileChanged": func() Event { return &ProfileChangedEvent{} },
"ProfileListChanged": func() Event { return &ProfileListChangedEvent{} },
"StreamStarting": func() Event { return &StreamStartingEvent{} },
"StreamStarted": func() Event { return &StreamStartedEvent{} },
"StreamStopping": func() Event { return &StreamStoppingEvent{} },
"StreamStopped": func() Event { return &StreamStoppedEvent{} },
"StreamStatus": func() Event { return &StreamStatusEvent{} },
"RecordingStarting": func() Event { return &RecordingStartingEvent{} },
"RecordingStarted": func() Event { return &RecordingStartedEvent{} },
"RecordingStopping": func() Event { return &RecordingStoppingEvent{} },
"RecordingStopped": func() Event { return &RecordingStoppedEvent{} },
"RecordingPaused": func() Event { return &RecordingPausedEvent{} },
"RecordingResumed": func() Event { return &RecordingResumedEvent{} },
"ReplayStarting": func() Event { return &ReplayStartingEvent{} },
"ReplayStarted": func() Event { return &ReplayStartedEvent{} },
"ReplayStopping": func() Event { return &ReplayStoppingEvent{} },
"ReplayStopped": func() Event { return &ReplayStoppedEvent{} },
"Exiting": func() Event { return &ExitingEvent{} },
"Heartbeat": func() Event { return &HeartbeatEvent{} },
"BroadcastCustomMessage": func() Event { return &BroadcastCustomMessageEvent{} },
"SourceCreated": func() Event { return &SourceCreatedEvent{} },
"SourceDestroyed": func() Event { return &SourceDestroyedEvent{} },
"SourceVolumeChanged": func() Event { return &SourceVolumeChangedEvent{} },
"SourceMuteStateChanged": func() Event { return &SourceMuteStateChangedEvent{} },
"SourceAudioSyncOffsetChanged": func() Event { return &SourceAudioSyncOffsetChangedEvent{} },
"SourceAudioMixersChanged": func() Event { return &SourceAudioMixersChangedEvent{} },
"SourceRenamed": func() Event { return &SourceRenamedEvent{} },
"SourceFilterAdded": func() Event { return &SourceFilterAddedEvent{} },
"SourceFilterRemoved": func() Event { return &SourceFilterRemovedEvent{} },
"SourceFilterVisibilityChanged": func() Event { return &SourceFilterVisibilityChangedEvent{} },
"SourceFiltersReordered": func() Event { return &SourceFiltersReorderedEvent{} },
"SourceOrderChanged": func() Event { return &SourceOrderChangedEvent{} },
"SceneItemAdded": func() Event { return &SceneItemAddedEvent{} },
"SceneItemRemoved": func() Event { return &SceneItemRemovedEvent{} },
"SceneItemVisibilityChanged": func() Event { return &SceneItemVisibilityChangedEvent{} },
"SceneItemTransformChanged": func() Event { return &SceneItemTransformChangedEvent{} },
"SceneItemSelected": func() Event { return &SceneItemSelectedEvent{} },
"SceneItemDeselected": func() Event { return &SceneItemDeselectedEvent{} },
"PreviewSceneChanged": func() Event { return &PreviewSceneChangedEvent{} },
"StudioModeSwitched": func() Event { return &StudioModeSwitchedEvent{} },
}
// derefEvent returns an Event struct from a pointer to an Event struct.
func derefEvent(e Event) Event {
switch e := e.(type) {
case *SwitchScenesEvent:
return *e
case *ScenesChangedEvent:
return *e
case *SceneCollectionChangedEvent:
return *e
case *SceneCollectionListChangedEvent:
return *e
case *SwitchTransitionEvent:
return *e
case *TransitionListChangedEvent:
return *e
case *TransitionDurationChangedEvent:
return *e
case *TransitionBeginEvent:
return *e
case *ProfileChangedEvent:
return *e
case *ProfileListChangedEvent:
return *e
case *StreamStartingEvent:
return *e
case *StreamStartedEvent:
return *e
case *StreamStoppingEvent:
return *e
case *StreamStoppedEvent:
return *e
case *StreamStatusEvent:
return *e
case *RecordingStartingEvent:
return *e
case *RecordingStartedEvent:
return *e
case *RecordingStoppingEvent:
return *e
case *RecordingStoppedEvent:
return *e
case *RecordingPausedEvent:
return *e
case *RecordingResumedEvent:
return *e
case *ReplayStartingEvent:
return *e
case *ReplayStartedEvent:
return *e
case *ReplayStoppingEvent:
return *e
case *ReplayStoppedEvent:
return *e
case *ExitingEvent:
return *e
case *HeartbeatEvent:
return *e
case *BroadcastCustomMessageEvent:
return *e
case *SourceCreatedEvent:
return *e
case *SourceDestroyedEvent:
return *e
case *SourceVolumeChangedEvent:
return *e
case *SourceMuteStateChangedEvent:
return *e
case *SourceAudioSyncOffsetChangedEvent:
return *e
case *SourceAudioMixersChangedEvent:
return *e
case *SourceRenamedEvent:
return *e
case *SourceFilterAddedEvent:
return *e
case *SourceFilterRemovedEvent:
return *e
case *SourceFilterVisibilityChangedEvent:
return *e
case *SourceFiltersReorderedEvent:
return *e
case *SourceOrderChangedEvent:
return *e
case *SceneItemAddedEvent:
return *e
case *SceneItemRemovedEvent:
return *e
case *SceneItemVisibilityChangedEvent:
return *e
case *SceneItemTransformChangedEvent:
return *e
case *SceneItemSelectedEvent:
return *e
case *SceneItemDeselectedEvent:
return *e
case *PreviewSceneChangedEvent:
return *e
case *StudioModeSwitchedEvent:
return *e
default:
return nil
}
}