MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
AudioBackendFactory.cpp
Go to the documentation of this file.
1#include "AudioBackend.hpp"
3
4#ifdef PIPEWIRE_BACKEND
5#include "PipewireBackend.hpp"
6#endif
7
8#ifdef WASAPI_BACKEND
9#include "WasapiBackend.hpp"
10#endif
11
12#ifdef COREAUDIO_BACKEND
13#include "CoreAudioBackend.hpp"
14#endif
15
16namespace MayaFlux::Core {
17
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}
42
43} // namespace MayaFlux::Core
static std::unique_ptr< IAudioBackend > create_backend(Core::AudioBackendType type)
Creates a specific audio backend implementation.
@ AudioBackend
Audio processing backend (Pipewire, wasapi, coreaudio)
@ Core
Core engine, backend, subsystems.