1/*
2Copyright 2018 Google Inc. All Rights Reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS-IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef RESONANCE_AUDIO_NODE_SINK_NODE_H_
18#define RESONANCE_AUDIO_NODE_SINK_NODE_H_
19
20#include <memory>
21#include <vector>
22
23#include "base/audio_buffer.h"
24#include "node/publisher_node.h"
25#include "node/subscriber_node.h"
26
27namespace vraudio {
28
29// Audio sink node that reads from multiple inputs.
30class SinkNode : public Node, public SubscriberNode<const AudioBuffer*> {
31 public:
32 typedef PublisherNode<const AudioBuffer*> PublisherNodeType;
33
34 SinkNode();
35
36 // Polls for data on all inputs of the sink node.
37 //
38 // @return A vector of input data.
39 const std::vector<const AudioBuffer*>& ReadInputs();
40
41 // SubscriberNode<AudioBuffer> implementation.
42 void Connect(
43 const std::shared_ptr<PublisherNodeType>& publisher_node) override;
44
45 // Node implementation.
46 void Process() final;
47 bool CleanUp() final;
48
49 // Disable copy constructor.
50 SinkNode(const SinkNode& that) = delete;
51
52 private:
53 // Input stream to poll for incoming data.
54 Node::Input<const AudioBuffer*> input_stream_;
55};
56
57} // namespace vraudio
58
59#endif // RESONANCE_AUDIO_NODE_SINK_NODE_H_
60

source code of qtmultimedia/src/3rdparty/resonance-audio/resonance_audio/node/sink_node.h