20#ifndef PEAK_DETECTOR_H_
21#define PEAK_DETECTOR_H_
97 uint8_t
mode()
const {
return _mode; }
104 virtual float put(
float value);
107 virtual bool isOn() {
return _onValue; }
110 virtual void onBang(EventCallback callback);
120 float _triggerThreshold;
121 float _reloadThreshold;
122 float _fallbackTolerance;
A generic class representing a simple digital (true/false)unit.
Definition PqCore.h:386
The main Plaquette static class containing all the units.
Definition PqCore.h:60
static Engine & primary()
Returns the main instance of Plaquette.
Definition PqCore.cpp:31
Emits a "bang" signal when another signal peaks.
Definition PeakDetector.h:38
float fallbackTolerance() const
Returns minimal relative "drop" after peak to trigger detection in peak modes.
Definition PeakDetector.h:82
virtual float put(float value)
Pushes value into the unit.
Definition PeakDetector.cpp:99
bool modeCrossing() const
Returns true if mode is PEAK_RISING or PEAK_FALLING.
Definition PeakDetector.cpp:91
float reloadThreshold() const
Returns minimal value "drop" for reset.
Definition PeakDetector.h:73
virtual bool eventTriggered(EventType eventType)
Returns true iff an event of a certain type has been triggered.
Definition PeakDetector.cpp:165
virtual void onBang(EventCallback callback)
Registers event callback on peak detection.
Definition PeakDetector.cpp:161
float triggerThreshold() const
Returns triggerThreshold.
Definition PeakDetector.h:64
bool modeApex() const
Returns true if mode is PEAK_MAX or PEAK_MIN.
Definition PeakDetector.cpp:95
uint8_t mode() const
Returns mode.
Definition PeakDetector.h:97
virtual bool isOn()
Returns true iff the triggerThreshold is crossed.
Definition PeakDetector.h:107
bool modeInverted() const
Returns true if mode is PEAK_FALLING or PEAK_MIN.
Definition PeakDetector.cpp:87
Engine * engine() const
Returns the engine that owns this unit.
Definition PqCore.h:382