libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
ndilib.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <promeki/namespace.h>
11#include <promeki/config.h>
12
13#if PROMEKI_ENABLE_NDI
14
15#include <promeki/string.h>
16
17// Forward-declare the SDK's function-pointer table so callers that only
18// need NdiLib::api() can include this header without dragging in the
19// full NDI SDK headers (which are large and pollute the global
20// namespace with C macros). The struct is defined in
21// Processing.NDI.DynamicLoad.h; users that actually call NDI functions
22// through the table will include that header alongside this one.
23struct NDIlib_v6;
24
25PROMEKI_NAMESPACE_BEGIN
26
68class NdiLib {
69 public:
76 static NdiLib &instance();
77
85 bool isLoaded() const { return _api != nullptr; }
86
95 const NDIlib_v6 *api() const { return _api; }
96
100 const String &libraryPath() const { return _libraryPath; }
101
105 const String &version() const { return _version; }
106
114 bool isAdvanced() const { return _isAdvanced; }
115
116 NdiLib(const NdiLib &) = delete;
117 NdiLib &operator=(const NdiLib &) = delete;
118
119 private:
120 NdiLib();
121 ~NdiLib();
122
123 void *_handle = nullptr;
124 const NDIlib_v6 *_api = nullptr;
125 String _libraryPath;
126 String _version;
127 bool _isAdvanced = false;
128 bool _initialized = false;
129};
130
131PROMEKI_NAMESPACE_END
132
133#endif // PROMEKI_ENABLE_NDI