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

◆ initialize()

bool MayaFlux::Core::TabletBackend::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 475 of file TabletBackend.cpp.

476{
477 if (m_initialized.load()) {
478 return true;
479 }
480
481 if (hid_init() != 0) {
483 "Failed to initialize HIDAPI for tablet backend: {}",
484 hid_failure_reason(nullptr));
485 return false;
486 }
487
488#ifdef MAYAFLUX_PLATFORM_MACOS
489 hid_darwin_set_open_exclusive(0);
490#endif
491
492 m_initialized.store(true);
493
494 const size_t found = refresh_devices();
495
497 "TabletBackend initialized, {} tool(s)", found);
498
499 return true;
500}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
std::atomic< bool > m_initialized
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, MayaFlux::Journal::InputBackend, m_initialized, MF_ERROR, MF_INFO, and refresh_devices().

+ Here is the call graph for this function: