NAP
multichannel.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 // Nap includes
8 #include <rtti/objectptr.h>
9 
10 // Audio includes
11 #include <audio/core/audiopin.h>
12 
13 namespace nap
14 {
15  namespace audio
16  {
20  class NAPAPI IMultiChannelOutput
21  {
22  public:
26  virtual ~IMultiChannelOutput() = default;
27 
32  virtual int getChannelCount() const = 0;
33 
39  virtual OutputPin* getOutputForChannel(int channel) = 0;
40 
44  OutputPin* tryGetOutputForChannel(unsigned int);
45 
46  };
47 
48 
52  class NAPAPI IMultiChannelInput
53  {
54  public:
58  virtual ~IMultiChannelInput() = default;
59 
65  virtual void connect(unsigned int channel, OutputPin& pin) { }
66 
71  virtual int getInputChannelCount() const { return 0; }
72 
78  void tryConnect(unsigned int channel, OutputPin& pin);
79 
85  void connect(IMultiChannelOutput& inputObject);
86  };
87  }
88 }
nap::audio::IMultiChannelOutput
Definition: multichannel.h:20
nap::audio::IMultiChannelInput
Definition: multichannel.h:52
nap::audio::IMultiChannelInput::connect
virtual void connect(unsigned int channel, OutputPin &pin)
Definition: multichannel.h:65
nap::audio::OutputPin
Definition: audiopin.h:204
nap
Definition: templateapp.h:17
nap::audio::IMultiChannelInput::getInputChannelCount
virtual int getInputChannelCount() const
Definition: multichannel.h:71