Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
fanout.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Roc Streaming authors
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 
9 //! @file roc_audio/fanout.h
10 //! @brief Fanout.
11 
12 #ifndef ROC_AUDIO_FANOUT_H_
13 #define ROC_AUDIO_FANOUT_H_
14 
16 #include "roc_audio/sample.h"
17 #include "roc_core/list.h"
18 #include "roc_core/noncopyable.h"
19 #include "roc_core/slice.h"
20 
21 namespace roc {
22 namespace audio {
23 
24 //! Fanout.
25 //! Duplicates audio stream to multiple output writers.
26 class Fanout : public IFrameWriter, public core::NonCopyable<> {
27 public:
28  //! Check if writer is already added.
30 
31  //! Add output writer.
33 
34  //! Remove output writer.
36 
37  //! Write audio frame.
38  //! @remarks
39  //! Writes samples to every output writer.
40  virtual void write(Frame& frame);
41 
42 private:
44 };
45 
46 } // namespace audio
47 } // namespace roc
48 
49 #endif // ROC_AUDIO_FANOUT_H_
Fanout. Duplicates audio stream to multiple output writers.
Definition: fanout.h:26
virtual void write(Frame &frame)
Write audio frame.
bool has_output(IFrameWriter &)
Check if writer is already added.
void add_output(IFrameWriter &)
Add output writer.
void remove_output(IFrameWriter &)
Remove output writer.
Audio frame.
Definition: frame.h:25
Frame writer interface.
Definition: iframe_writer.h:22
Intrusive doubly-linked list.
Definition: list.h:40
Base class for non-copyable objects.
Definition: noncopyable.h:23
Frame writer interface.
Intrusive doubly-linked list.
Root namespace.
Non-copyable object.
Audio sample.
Slice.