NAP
outputnode.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Std includes
8 #include <atomic>
9 
10 // Audio includes
11 #include <audio/core/audionode.h>
12 #include <audio/core/process.h>
13 
14 namespace nap
15 {
16  namespace audio
17  {
18 
23  class NAPAPI OutputNode final : public Node
24  {
25  RTTI_ENABLE(Node)
26 
27  public:
32  OutputNode(NodeManager& nodeManager, bool rootProcess = true);
33 
34  ~OutputNode() override final;
35 
39  InputPin audioInput = {this};
40 
45  void setOutputChannel(int outputChannel) { mOutputChannel = outputChannel; }
46 
50  int getOutputChannel() const { return mOutputChannel; }
51 
52  private:
53  void process() override;
54 
55  std::atomic<int> mOutputChannel = {
56  0}; // The audio channel that this node's input will be played on by the node manager.
57 
58  bool mRootProcess = false;
59  };
60 
61 
62  }
63 }
64 
65 
66 
67 
68 
nap::audio::OutputNode
Definition: outputnode.h:23
nap::audio::NodeManager
Definition: audionodemanager.h:33
nap::audio::Node
Definition: audionode.h:33
nap::audio::InputPin
Definition: audiopin.h:87
nap::audio::OutputNode::setOutputChannel
void setOutputChannel(int outputChannel)
Definition: outputnode.h:45
nap
Definition: templateapp.h:17
nap::audio::OutputNode::getOutputChannel
int getOutputChannel() const
Definition: outputnode.h:50