MayaFlux 0.2.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 196 of file InputSubsystem.cpp.

197{
198 if (!backend)
199 return false;
200
201 InputType type = backend->get_type();
202
203 std::unique_lock lock(m_backends_mutex);
204
205 if (m_backends.find(type) != m_backends.end()) {
207 "Backend type {} already registered", static_cast<int>(type));
208 return false;
209 }
210
211 if (!backend->initialize()) {
213 "Failed to initialize backend: {}", backend->get_name());
214 return false;
215 }
216
217 wire_backend_to_manager(backend.get());
218
219 m_backends[type] = std::move(backend);
220
222 "Added input backend: {}", m_backends[type]->get_name());
223
224 return true;
225}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
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, and wire_backend_to_manager().

Referenced by initialize_hid_backend(), and initialize_midi_backend().

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