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

◆ shutdown()

void MayaFlux::Core::TabletBackend::shutdown ( )
overridevirtual

Shutdown and release all resources.

Closes all devices and releases backend resources. After this call, initialize() must be called again to use the backend.

Implements MayaFlux::Core::IInputBackend.

Definition at line 528 of file TabletBackend.cpp.

529{
530 if (!m_initialized.load()) {
531 return;
532 }
533
534 stop();
535
536 {
537 std::lock_guard lock(m_devices_mutex);
538 for (auto& [path, device] : m_devices) {
539 if (device->handle) {
540 hid_close(device->handle);
541 device->handle = nullptr;
542 }
543 }
544 m_devices.clear();
545 m_tools.clear();
546 m_tool_paths.clear();
547 }
548
549 hid_exit();
550 m_initialized.store(false);
551
553 "TabletBackend shutdown complete");
554}
#define MF_INFO(comp, ctx,...)
void stop() override
Stop listening for input events.
std::atomic< bool > m_initialized
std::unordered_map< uint32_t, std::string > m_tool_paths
std::unordered_map< std::string, std::shared_ptr< TabletDevice > > m_devices
std::unordered_map< uint32_t, TabletToolInfo > m_tools
@ InputBackend
Input device backend (HID, MIDI, OSC)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::InputBackend, m_devices, m_devices_mutex, m_initialized, m_tool_paths, m_tools, MF_INFO, and stop().

Referenced by ~TabletBackend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: