MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
InputService.hpp
Go to the documentation of this file.
1#pragma once
2
4
6
7/**
8 * @brief Backend input device service interface
9 *
10 * Provides device discovery and management for input subsystem.
11 * Follows the same service pattern as DisplayService, BufferService, and ComputeService.
12 *
13 * Enables InputManager to query and open devices without coupling to InputSubsystem.
14 */
15struct MAYAFLUX_API InputService {
16
17 /**
18 * @brief Query all available input devices across all backends
19 * @return Vector of device info structures
20 *
21 * Returns devices from all registered backends (HID, MIDI, OSC, Serial).
22 * Used by InputManager to resolve VID/PID bindings to device IDs.
23 */
24 std::function<std::vector<Core::InputDeviceInfo>()> get_all_devices;
25
26 /**
27 * @brief Open a specific input device
28 * @param backend_type Backend type (HID, MIDI, OSC, Serial)
29 * @param device_id Device identifier from InputDeviceInfo
30 * @return true if device opened successfully
31 *
32 * Delegates to appropriate backend's open_device() method.
33 * Device must exist in get_all_devices() results before opening.
34 */
35 std::function<bool(Core::InputType, uint32_t)> open_device;
36
37 /**
38 * @brief Close a specific input device
39 * @param backend_type Backend type (HID, MIDI, OSC, Serial)
40 * @param device_id Device identifier
41 *
42 * Stops receiving events from device and releases resources.
43 * Safe to call on already-closed or non-existent devices (no-op).
44 */
45 std::function<void(Core::InputType, uint32_t)> close_device;
46};
47
48} // namespace MayaFlux::Registry::Service
InputType
Input backend type enumeration.
std::function< std::vector< Core::InputDeviceInfo >()> get_all_devices
Query all available input devices across all backends.
std::function< bool(Core::InputType, uint32_t)> open_device
Open a specific input device.
std::function< void(Core::InputType, uint32_t)> close_device
Close a specific input device.
Backend input device service interface.