ofxPDSP
Scope.h
1 
2 // Scope.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 
7 #ifndef OFXPDSP_SCOPE_H_INCLUDED
8 #define OFXPDSP_SCOPE_H_INCLUDED
9 
10 #include "../DSP/pdspCore.h"
11 #include "ofMain.h"
12 
13 
18 namespace pdsp{
19 
20 class Scope : public pdsp::Unit{
21 
22 public:
23 
24  Scope();
25 
26  Scope(const Scope& other);
27  Scope& operator=(const Scope& other);
28 
33  Patchable& set( int samplesLength);
34 
39 
40 
45 
53  void draw( int x, int y, int w, int h) const;
54 
58  const vector<float> & getBuffer() const;
59 
60 private:
61 
62  void prepareUnit ( int expectedBufferSize, double sampleRate ) override;
63 
64  void releaseResources () override;
65 
66  void process (int bufferSize) noexcept override;
67 
68  pdsp::OutputNode output;
69 
70  pdsp::InputNode input_signal;
71 
72  std::vector<float> buffer;
73 
74  int bufferLen;
75  int bufferPos;
76 
77 };
78 
79 }
80 
81 #endif // OFXPDSP_SCOPE_H_INCLUDED
Definition: Scope.h:20
void draw(int x, int y, int w, int h) const
draws the scope at the given coordinates
Definition: Scope.cpp:85
Patchable & out_signal()
Sets "signal" as selected output and returns this Unit ready to be patched. This is the default outpu...
Definition: Scope.cpp:39
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
const vector< float > & getBuffer() const
returns a reference to the vector where the samples value are stored.
Definition: Scope.cpp:112
Patchable & in_signal()
Sets "signal" as selected input and returns this Unit ready to be patched. This is the default input...
Definition: Scope.cpp:35
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
Output of a Unit, contains a buffer of rendered floats and has a variable state flag.
Definition: BasicNodes.h:354