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

◆ create_backend()

std::unique_ptr< IAudioBackend > MayaFlux::Core::AudioBackendFactory::create_backend ( Core::AudioBackendType  type)
static

Creates a specific audio backend implementation.

Parameters
typeIdentifier for the requested backend type
api_preferenceOptional preference for a specific audio API
Returns
Unique pointer to an IAudioBackend implementation

Instantiates and configures the appropriate backend implementation based on the specified type, abstracting the details of backend selection and initialization.

Definition at line 18 of file AudioBackendFactory.cpp.

19{
20 switch (type) {
21
22#ifdef PIPEWIRE_BACKEND
24 return std::make_unique<PipewireBackend>();
25#endif
26
27#ifdef WASAPI_BACKEND
29 return std::make_unique<WasapiBackend>();
30#endif
31
32#ifdef COREAUDIO_BACKEND
34 return std::make_unique<CoreAudioBackend>();
35#endif
36
37 default:
38 error<std::runtime_error>(Journal::Component::Core, Journal::Context::AudioBackend, std::source_location::current(),
39 "Unsupported audio backend type: {}", static_cast<int>(type));
40 }
41}
@ AudioBackend
Audio processing backend (Pipewire, wasapi, coreaudio)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::AudioBackend, MayaFlux::Journal::Core, MayaFlux::Core::COREAUDIO, MayaFlux::Core::PIPEWIRE, and MayaFlux::Core::WASAPI.