mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-25 06:18:18 -05:00
This refactoring removes invalid interface dependencies of the original AudioDevice implementation: - move things characteristic to RT1051AudioCodec to audio::codec - remove dead methods - make start/stop optional and codec configuration independent - add more convenient way to get supported formats Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
33 lines
779 B
C++
33 lines
779 B
C++
// Copyright (c) 2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include <Audio/AudioPlatform.hpp>
|
|
#include <Audio/Profiles/Profile.hpp>
|
|
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
using audio::AudioDevice;
|
|
using audio::AudioDeviceFactory;
|
|
using audio::AudioPlatform;
|
|
|
|
class DummyAudioFactory : public AudioDeviceFactory
|
|
{
|
|
public:
|
|
std::shared_ptr<AudioDevice> createCellularAudioDevice() override
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
protected:
|
|
std::shared_ptr<AudioDevice> getDevice([[maybe_unused]] const audio::Profile &profile) override
|
|
{
|
|
return nullptr;
|
|
}
|
|
};
|
|
|
|
std::unique_ptr<AudioDeviceFactory> AudioPlatform::GetDeviceFactory()
|
|
{
|
|
return std::make_unique<DummyAudioFactory>();
|
|
}
|