~aleteoryx/muditaos

ref: b64f8283a7342b5362fded7c68706ea5ea961ee5 muditaos/module-audio/board/rt1051/bellpx/BellPxAudioDeviceFactory.cpp -rw-r--r-- 915 bytes
b64f8283 — Przemyslaw Brudny Merge remote-tracking branch 'origin/stable' 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "BellPxAudioDeviceFactory.hpp"
#include "BellPxAudioCodec.hpp"

#include <Audio/Profiles/Profile.hpp>

#include <log/log.hpp>

#include <stdexcept>

using audio::AudioDevice;
using audio::BellPxAudioDeviceFactory;

std::shared_ptr<AudioDevice> BellPxAudioDeviceFactory::getDevice(const audio::Profile &profile)
{
    std::shared_ptr<AudioDevice> device;

    switch (profile.GetAudioDeviceType()) {
    case AudioDevice::Type::Audiocodec: {
        device = std::make_shared<BellPxAudioCodec>(profile.GetAudioConfiguration());
    } break;

    default:
        break;
    };

    return device;
}

std::shared_ptr<AudioDevice> BellPxAudioDeviceFactory::createCellularAudioDevice()
{
    throw std::runtime_error("Cellular audio device not valid for Bell platform.");
}