mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-27 09:47:18 -04:00
Audio devices are created in the audio subsystem and it is not possible to send a device to bt service upon creation. Introduce hookable audio device factory to allow sharing bluetooth audio device. Move audio devices from bsp to audio allowing removal of unwanted bsp -> audio dependency. Remove Bluetooth proxy device which turned out to be a dead end. Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
35 lines
789 B
C++
35 lines
789 B
C++
// Copyright (c) 2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include "AudioDevice.hpp"
|
|
|
|
#include <memory>
|
|
|
|
namespace audio
|
|
{
|
|
|
|
class AudioDeviceFactory
|
|
{
|
|
class Observer
|
|
{
|
|
public:
|
|
virtual void onDeviceCreated(std::shared_ptr<AudioDevice> device) = 0;
|
|
};
|
|
|
|
public:
|
|
explicit AudioDeviceFactory(Observer *observer = nullptr);
|
|
|
|
void setObserver(Observer *observer) noexcept;
|
|
std::shared_ptr<AudioDevice> CreateDevice(AudioDevice::Type);
|
|
|
|
protected:
|
|
virtual std::shared_ptr<AudioDevice> getDeviceFromType(AudioDevice::Type) = 0;
|
|
|
|
private:
|
|
Observer *_observer = nullptr;
|
|
};
|
|
|
|
}; // namespace audio
|