-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
41 lines (29 loc) · 1 KB
/
main.c
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
#include <stdio.h>
#include "gettally.h"
#define OBS_URL "ws://127.0.0.1:4455/"
// This supports ONLY the new 5.0 protocol.
void setSceneIsProgram(const char *sceneName);
void setSceneIsPreview(const char *sceneName, bool alsoOnProgram);
void setSceneIsInactive(const char *sceneName);
int main(int argc, char *argv[]) {
char *password = "";
if (argc > 1) {
password = argv[1];
}
registerOBSProgramCallback(&setSceneIsProgram);
registerOBSPreviewCallback(&setSceneIsPreview);
registerOBSInactiveCallback(&setSceneIsInactive);
runOBSTally(OBS_URL, password);
return 0;
}
#pragma mark - Module callbacks
void setSceneIsProgram(const char *sceneName) {
fprintf(stderr, "PROGRAM SCENE: %s\n", sceneName);
}
void setSceneIsPreview(const char *sceneName, bool alsoOnProgram) {
fprintf(stderr, "PREVIEW SCENE: %s (on program: %s)\n", sceneName,
alsoOnProgram ? "true" : "false");
}
void setSceneIsInactive(const char *sceneName) {
fprintf(stderr, "INACTIVE SCENE: %s\n", sceneName);
}