mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-14 19:45:31 -04:00
Add basic playback capability using Bluetooth A2DP profile. Only stereo/44100/16bit files are supported at the moment Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
26 lines
666 B
C++
26 lines
666 B
C++
// Copyright (c) 2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "AudioDeviceFactory.hpp"
|
|
|
|
using namespace audio;
|
|
|
|
AudioDeviceFactory::AudioDeviceFactory(Observer *observer) : _observer(observer)
|
|
{}
|
|
|
|
std::shared_ptr<AudioDevice> AudioDeviceFactory::CreateDevice(AudioDevice::Type deviceType)
|
|
{
|
|
std::shared_ptr<AudioDevice> device = getDeviceFromType(deviceType);
|
|
|
|
if (_observer != nullptr && device) {
|
|
_observer->onDeviceCreated(device, deviceType);
|
|
}
|
|
|
|
return device;
|
|
}
|
|
|
|
void AudioDeviceFactory::setObserver(Observer *observer) noexcept
|
|
{
|
|
_observer = observer;
|
|
}
|