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

◆ add_backend()

bool MayaFlux::Core::InputSubsystem::add_backend ( std::unique_ptr< IInputBackend backend)

Add a custom input backend.

Parameters
backendBackend instance (takes ownership)
Returns
true if added successfully

Definition at line 207 of file InputSubsystem.cpp.

208{
209 if (!backend)
210 return false;
211
212 InputType type = backend->get_type();
213
214 std::unique_lock lock(m_backends_mutex);
215
216 if (m_backends.find(type) != m_backends.end()) {
218 "Backend type {} already registered", static_cast<int>(type));
219 return false;
220 }
221
222 if (!backend->initialize()) {
224 "Failed to initialize backend: {}", backend->get_name());
225 return false;
226 }
227
228 wire_backend_to_manager(backend.get());
229
230 m_backends[type] = std::move(backend);
231
233 "Added input backend: {}", m_backends[type]->get_name());
234
235 return true;
236}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
vk::PhysicalDeviceType type
Definition VKDevice.cpp:146
std::unordered_map< InputType, std::unique_ptr< IInputBackend > > m_backends
void wire_backend_to_manager(IInputBackend *backend)
InputType
Input backend type enumeration.
@ InputSubsystem
Input subsystem operations (device management, event dispatch)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::InputSubsystem, m_backends, m_backends_mutex, MF_ERROR, MF_INFO, MF_WARN, type, and wire_backend_to_manager().

Referenced by initialize_hid_backend(), initialize_midi_backend(), and initialize_tablet_backend().

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