MayaFlux 1.0.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 537 of file TabletBackend.cpp.

538{
539 if (!m_initialized.load()) {
540 return;
541 }
542
543 stop();
544
545 {
546 std::lock_guard lock(m_devices_mutex);
547 for (auto& [path, device] : m_devices) {
548 if (device->handle) {
549 hid_close(device->handle);
550 device->handle = nullptr;
551 }
552 }
553 m_devices.clear();
554 m_tools.clear();
555 m_tool_paths.clear();
556 }
557
558 hid_exit();
559 m_initialized.store(false);
560
562 "TabletBackend shutdown complete");
563}
#define MF_INFO(comp, ctx,...)
vk::PhysicalDevice device
Definition VKDevice.cpp:121
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, device, 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: