~aleteoryx/muditaos

ref: a3e512a89b698b4d8a8f8046521c327ab2eec147 muditaos/module-audio/Audio/test/TestEndpoint.cpp -rw-r--r-- 1.3 KiB
a3e512a8 — Marcin Smoczyński [EGD-6674] Change negotiation of audio block size 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "TestEndpoint.hpp"

#include <Audio/AudioFormat.hpp>

using audio::AudioFormat;
using audio::test::TestSink;
using audio::test::TestSource;

TestSink::TestSink(std::vector<AudioFormat> supportedFormats) : formats(std::move(supportedFormats))
{}

auto TestSink::getSupportedFormats() -> const std::vector<AudioFormat> &
{
    return formats;
}

void TestSink::onDataSend()
{}

void TestSink::enableOutput()
{}

void TestSink::disableOutput()
{}

auto TestSink::getTraits() const -> ::audio::Endpoint::Traits
{
    return testTraits;
}

TestSource::TestSource(std::vector<AudioFormat> supportedFormats, AudioFormat sourceFormat)
    : formats(std::move(supportedFormats)), sourceFormat(std::move(sourceFormat))
{}

TestSource::TestSource(AudioFormat audioFormat)
    : formats(std::vector<AudioFormat>{audioFormat}), sourceFormat(std::move(audioFormat))
{}

auto TestSource::getSourceFormat() -> AudioFormat
{
    return sourceFormat;
}

void TestSource::onDataReceive()
{}

void TestSource::enableInput()
{}

void TestSource::disableInput()
{}

auto TestSource::getSupportedFormats() -> const std::vector<AudioFormat> &
{
    return formats;
}

auto TestSource::getTraits() const -> ::audio::Endpoint::Traits
{
    return testTraits;
}