ofxPDSP
LinearCrossfader.h
1 
2 // LinearCrossfader.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef PDSP_MODULE_LINEARCROSSFADER_H_INCLUDED
7 #define PDSP_MODULE_LINEARCROSSFADER_H_INCLUDED
8 
9 #include "../../DSP/pdspCore.h"
10 #include "../../DSP/utility/OneMinusInput.h"
11 
12 namespace pdsp{
16 class LinearCrossfader : public Patchable {
17 
18 public:
20  LinearCrossfader(const LinearCrossfader& other);
21  LinearCrossfader& operator=(const LinearCrossfader& other);
22 
23 
27  float meter_fade();
28 
32  Patchable& in_A();
33 
37  Patchable& in_B();
38 
42  Patchable& in_fade();
43 
44 
49 
50 
54  [[deprecated("in_0() deprecated, use in_A() instead")]]
55  Patchable& in_0();
56 
57  [[deprecated("in_1() deprecated, use in_B() instead")]]
58  Patchable& in_1();
63 private:
64  void patch();
65 
66  Amp in1amp;
67  Amp in2amp;
68  OneMinusInput oneMinusX;
69  PatchNode control;
70  PatchNode output;
71 
72 };
73 
74 
75 
76 } // end namespace
77 
78 #endif // PDSP_MODULE_LINEARCROSSFADER_H_INCLUDED
Patchable & out_signal()
Sets "signal" as selected output and returns this Unit ready to be patched. This is the default outpu...
Definition: LinearCrossfader.cpp:40
float meter_fade()
meters the fader position between 0.0f and 1.0f. This method is thread safe.
Definition: LinearCrossfader.cpp:24
Linearly fades between A/B inputs.
Definition: LinearCrossfader.h:16
Patchable & in_B()
Sets "B" as selected input and returns this module ready to be patched. This is the channel at 1...
Definition: LinearCrossfader.cpp:32
Patchable & in_fade()
Sets "fade" as selected input and returns this module ready to be patched. This input is clampled to ...
Definition: LinearCrossfader.cpp:36
output is 1.0f - input
Definition: OneMinusInput.h:18
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Multiply in("signal") for in("mod").
Definition: Amp.h:23
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
A Unit with no dsp inside, it just pass it's input to the output. Patching float to this Unit is thre...
Definition: PatchNode.h:41
Patchable & in_A()
Sets "A" as selected input and returns this module ready to be patched. This is the default input...
Definition: LinearCrossfader.cpp:28