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

◆ start()

void MayaFlux::Core::HIDBackend::start ( )
overridevirtual

Start listening for input events.

Begins polling/callback registration for all opened devices. Input events will be delivered via registered callbacks.

Implements MayaFlux::Core::IInputBackend.

Definition at line 49 of file HIDBackend.cpp.

50{
51 if (!m_initialized.load()) {
53 "Cannot start HIDBackend: not initialized");
54 return;
55 }
56
57 if (m_running.load()) {
59 "HIDBackend already running");
60 return;
61 }
62
63 m_stop_requested.store(false);
64 m_running.store(true);
65
66 m_poll_thread = std::thread(&HIDBackend::poll_thread_func, this);
67
69 "HIDBackend started polling {} open device(s)", get_open_devices().size());
70}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::atomic< bool > m_running
std::atomic< bool > m_initialized
std::atomic< bool > m_stop_requested
std::vector< uint32_t > get_open_devices() const override
Get list of currently open device IDs.
@ InputBackend
Input device backend (HID, MIDI, OSC)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, get_open_devices(), MayaFlux::Journal::InputBackend, m_initialized, m_poll_thread, m_running, m_stop_requested, MF_ERROR, MF_INFO, MF_WARN, and poll_thread_func().

+ Here is the call graph for this function: