ofxPDSP
SampleBufferPlotter.h
1 
2 // SampleBufferPlotter.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef OFXPDSP_SAMPLEBUFFER_PLOTTER_H_INCLUDED
7 #define OFXPDSP_SAMPLEBUFFER_PLOTTER_H_INCLUDED
8 
9 #include "ofMain.h"
10 #include "../DSP/samplers/SampleBuffer.h"
11 
12 
13 namespace pdsp {
14 
19 
20 public:
22 
31  void setWaveform(pdsp::SampleBuffer& sampleBuffer, int channel, ofColor color, int width, int height);
32 
38  void draw(int x, int y);
39 
47  void draw(int x, int y, int w, int h);
48 
52  const ofFbo& getFbo();
53 
54 private:
55  ofFbo waveformCanvas;
56  bool fboFilled;
57  int width;
58  int height;
59 
60 };
61 
62 } // end namespaces
63 
64 
65 #endif // OFXPDSP_SAMPLEBUFFER_PLOTTER_H_INCLUDED
utility class to generate a waveform plot
Definition: SampleBufferPlotter.h:18
void draw(int x, int y)
draws the waveform to the given coordinates #param[in] x x coordinate #param[in] y y coordinate ...
Definition: SampleBufferPlotter.cpp:45
void setWaveform(pdsp::SampleBuffer &sampleBuffer, int channel, ofColor color, int width, int height)
generates the waveform grafic for the given buffer.
Definition: SampleBufferPlotter.cpp:15
Contains the data loaded from an audio file.
Definition: SampleBuffer.h:28
const ofFbo & getFbo()
returns a read-only reference to the internally stored ofFbo
Definition: SampleBufferPlotter.cpp:53
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11