-
Notifications
You must be signed in to change notification settings - Fork 0
/
nomad-tools.cpp
58 lines (43 loc) · 1.72 KB
/
nomad-tools.cpp
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
#include "nomad-tools.h"
#include "group-recordings.h"
#include <obs-module.h>
#include <obs-frontend-api.h>
#include <QtWidgets/qmainwindow.h>
#include <QtWidgets/qboxlayout.h>
OBS_DECLARE_MODULE()
OBS_MODULE_USE_DEFAULT_LOCALE("nomad-tools", "en-US")
GroupRecordings *groupRecordingsPlugin;
void OnClose(enum obs_frontend_event evt, void* data) {
if (evt == OBS_FRONTEND_EVENT_EXIT) {
// Before OBS exits, always set the plugin to disabled and reset the path to original value
groupRecordingsPlugin->SetPluginCurrentlyEnabled(false);
}
}
bool obs_module_load(void)
{
// Main housing dock for all custom tools.
MainDock *mainDock = new MainDock();
mainDock->setWindowTitle(QString::fromUtf8("Nomad Tools"));
mainDock->setObjectName(QString::fromUtf8("nomadTools"));
mainDock->setFloating(false);
mainDock->setEnabled(true);
mainDock->setVisible(true);
QWidget *mainDockContents = new QWidget(mainDock);
groupRecordingsPlugin = new GroupRecordings();
groupRecordingsPlugin->InitializePlugin(mainDock);
QVBoxLayout *mainBoxLayout = new QVBoxLayout(mainDockContents);
mainBoxLayout->setSpacing(1);
mainBoxLayout->setAlignment(Qt::AlignTop);
mainBoxLayout->setContentsMargins(QMargins(2, 4, 2, 4));
QWidget *boxLayoutContainer = new QWidget();
boxLayoutContainer->setLayout(
groupRecordingsPlugin->groupRecordingsBoxLayout);
mainBoxLayout->addWidget(boxLayoutContainer);
mainBoxLayout->addWidget(groupRecordingsPlugin->groupRecordingsButtonToggle);
QMainWindow *mainWindow = (QMainWindow *)obs_frontend_get_main_window();
mainWindow->addDockWidget(Qt::BottomDockWidgetArea, mainDock);
mainDock->setWidget(mainDockContents);
obs_frontend_add_dock(mainDock);
obs_frontend_add_event_callback(OnClose, NULL);
return true;
}