ofxPDSP
TriggerControl.h
1 
2 // TriggerControl.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef PDSP_CONTROL_TRIGGERCONTROL_H_INCLUDED
7 #define PDSP_CONTROL_TRIGGERCONTROL_H_INCLUDED
8 
9 #include "../pdspCore.h"
10 
11 namespace pdsp{
12 
19 class TriggerControl : public Unit {
20 
21 public:
23 
24  TriggerControl(const TriggerControl & other);
25 
30 
34  void trigger(float value);
35 
39  void off();
40 
41 private:
42  void prepareUnit( int expectedBufferSize, double sampleRate ) override;
43  void releaseResources () override ;
44  void process (int bufferSize) noexcept override;
45 
46  OutputNode output;
47 
48  std::atomic<float> nextTrigger;
49 
50 };
51 
52 } // pdsp namespace end
53 
54 
55 #endif //PDSP_CONTROL_TRIGGERCONTROL_H_INCLUDED
Patchable & out_trig()
Sets "trig" as selected output and returns this Unit ready to be patched. This is the default output...
Definition: TriggerControl.cpp:23
void off()
A trigger off will be emitted as soon as possible (usually this means at the start of the next audio ...
Definition: TriggerControl.cpp:32
Abstract class for implementing Units.
Definition: BasicNodes.h:223
Generate trigger on/off messages when the input values are greater than a set value.
Definition: TriggerControl.h:19
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
void trigger(float value)
A trigger with the given value will be emitted as soon as possible (usually this means at the start o...
Definition: TriggerControl.cpp:28
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