ofxPDSP
SequencerGateOutput.h
1 
2 // SequencerGateOutput.h
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016
5 
6 #ifndef PDSP_CONTROL_GATESEQUENCER_H_INCLUDED
7 #define PDSP_CONTROL_GATESEQUENCER_H_INCLUDED
8 
9 #include "../pdspCore.h"
10 #include "SequencerBridge.h"
11 
12 namespace pdsp{
13 
20 class SequencerGateOutput : public SequencerBridge{
21 
22 public:
25 
30  void link(MessageBuffer &messageBuffer) override;
31 
35  void unLink() override;
36 
41  void setSingleTrigger(bool state);
42 
47 
51  int meter_last_ticks() const;
52 
56  float meter_last_value() const;
57 
58 private:
59 
60  void prepareUnit( int expectedBufferSize, double sampleRate ) override;
61  void releaseResources () override;
62  void process (int bufferSize) noexcept override;
63 
64  OutputNode output_trig;
65 
66 
67  bool singleTrigger;
68  bool gateState;
69 
70  std::atomic<int> meter_ticks;
71  std::atomic<float> meter_value;
72 
73 };
74 
75 
76 } // pdsp namespace end
77 
78 
79 
80 #endif // PDSP_CONTROL_GATESEQUENCER_H_INCLUDED
int meter_last_ticks() const
returns how many time this Unit has been processed since the last trigger, useful for visual...
Definition: SequencerGateOutput.cpp:22
Takes messages from a MessageBuffer and convert them in a trigger output.
Definition: SequencerGateOutput.h:20
float meter_last_value() const
returns the last trigger value received. Thread-safe.
Definition: SequencerGateOutput.cpp:26
Abstract class for implementing Units and Modules.
Definition: BasicNodes.h:82
void link(MessageBuffer &messageBuffer) override
connect the SequencerGateOutput to a MessageBuffer. You can also use the >> operator with the same ef...
Definition: SequencerGateOutput.cpp:30
Patchable & out_trig()
Sets "trig" as selected output and returns this Unit ready to be patched. This is the default output...
Definition: SequencerGateOutput.cpp:51
void unLink() override
disconnect the SequencerGateOutput from the connected MessageBuffer.
Definition: SequencerGateOutput.cpp:36
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
void setSingleTrigger(bool state)
Sets the behavior in the trigger signals generation. If true some of the connected envelopes will not...
Definition: SequencerGateOutput.cpp:47