ofxPDSP
PatchNode.h
1 
2 // PatchNode.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 
7 #ifndef PDSP_CORE_PATCHNODE_H_INCLUDED
8 #define PDSP_CORE_PATCHNODE_H_INCLUDED
9 
10 #include "BasicNodes.h"
11 #include <iostream>
12 
13 namespace pdsp{
14 
15 
16 class PatchNode;
17 
18 
19 //--------------CUSTOM OUTPUTNODE------------------------------------------------
23 class PatchOutputNode : public OutputNode{
24 public:
25 
26  void prepareToPlay(int expectedBufferSize, double sampleRate) override {};
27  void releaseResources() override {};
28 
29  void setOversampleLevel(int newOversample) override;
30 };
35 //--------------PATCH NODE------------------------------------------------
41 class PatchNode : public Unit {
42  friend class Processor;
43 
44 public:
45 
46  PatchNode();
47  PatchNode(const PatchNode& other);
48  PatchNode& operator=(const PatchNode& other);
49  ~PatchNode();
50 
54  Patchable& set(float defaultValue);
55 
61  void enableBoundaries( float low, float high);
62 
66  void disableBoundaries();
67 
68 private:
69 
70  void process(int bufferSize) noexcept override;
71 
72  void disableAutomaticProcessing();
73 
74  int getState();
75 
76  const float* getBuffer();
77 
78  void prepareUnit( int expectedBufferSize, double sampleRate ) override;
79  void releaseResources() override;
80 
81  InputNode input;
82  PatchOutputNode output;
83 };
84 
85 //--------------CHANNEL NODE-----------------------------------------
90 class ChannelNode : public Patchable {
91 public:
92  ChannelNode();
93  PatchNode input;
94  PatchNode output;
95 };
96 
97 }//END NAMESPACE
98 
99 
100 #endif // PATCHNODE_H_INCLUDED
Abstract class for implementing Units.
Definition: BasicNodes.h:223
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
Input of a Unit, process all the connected Outputs and sum them. Has an internal variable state...
Definition: BasicNodes.h:536
A module with no dsp inside, just two public pdsp::PatchNode set as default input and output and not ...
Definition: PatchNode.h:90
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
A Unit with no dsp inside, it just pass it&#39;s input to the output. Patching float to this Unit is thre...
Definition: PatchNode.h:41
The bridge between pdsp and the audio callback.
Definition: Processor.h:21