MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ initialize()

bool MayaFlux::Core::HIDBackend::initialize ( )
overridevirtual

Initialize the input backend.

Returns
true if initialization succeeded

Should discover available devices but not start polling/listening.

Implements MayaFlux::Core::IInputBackend.

Definition at line 26 of file HIDBackend.cpp.

27{
28 if (m_initialized.load()) {
30 "HIDBackend already initialized");
31 return true;
32 }
33
34 if (hid_init() != 0) {
36 "Failed to initialize HIDAPI");
37 return false;
38 }
39
41 "HIDBackend initialized (HIDAPI version: {})", get_version());
42
43 m_initialized.store(true);
45
46 return true;
47}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::atomic< bool > m_initialized
std::string get_version() const override
Get backend version string.
size_t refresh_devices() override
Refresh the device list.
@ InputBackend
Input device backend (HID, MIDI, OSC)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, get_version(), MayaFlux::Journal::InputBackend, m_initialized, MF_ERROR, MF_INFO, MF_WARN, and refresh_devices().

+ Here is the call graph for this function: