~aleteoryx/muditaos

ref: 7dee85f011b50783da4aff0e96b33893c1600e3a muditaos/module-audio/Audio/Endpoint.hpp -rw-r--r-- 709 bytes
7dee85f0 — Tomas Rogala [EGD-4711] Change calendar events endpoints 5 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-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "Stream.hpp"

namespace audio
{
    class Endpoint
    {
      public:
        void setStream(Stream &stream);
        Stream *getStream() const noexcept;
        void unsetStream();
        bool isConnected() const noexcept;

      private:
        Stream *_stream = nullptr;
    };

    class Sink : public Endpoint
    {};

    class Source : public Endpoint
    {
      public:
        void connect(Sink &sink, Stream &stream);
        void disconnectStream();

      private:
        Sink *connectedSink = nullptr;
    };

}; // namespace audio