A generic class representing a unit in the system. More...
#include <PqCore.h>


Public Member Functions | |
| virtual void | clearEvents () |
| float | seconds () const |
| Returns engine time in seconds. | |
| uint32_t | milliSeconds () const |
| Returns engine time in milliseconds. | |
| uint64_t | microSeconds () const |
| Returns engine time in microseconds. | |
| unsigned long | nSteps () const |
| Returns number of engine steps. | |
| float | sampleRate () const |
| Returns engine sample rate. | |
| float | samplePeriod () const |
| Returns enginesample period. | |
| virtual float | get () |
| Returns value (typically between 0 and 1, may vary depending on class). | |
| operator float () | |
| Object can be used directly to access its value. | |
| virtual float | mapTo (float toLow, float toHigh) |
| Maps value to new range. | |
| virtual float | put (float value) |
| Pushes value into the unit. | |
| operator bool () | |
| Operator that allows usage in conditional expressions. | |
Protected Member Functions | |
| virtual void | begin () |
| virtual void | step () |
| Unit (Engine &engine=Engine::primary()) | |
| Constructor. | |
| virtual bool | eventTriggered (EventType eventType) |
| Returns true iff an event of a certain type has been triggered. | |
| virtual void | onEvent (EventCallback callback, EventType eventType) |
| Registers event callback. | |
| Engine * | engine () const |
| Returns the engine that owns this unit. | |
Friends | |
| class | Engine |
| class | EventManager |
A generic class representing a unit in the system.
Main class for components to be added to Plaquette. Each such unit can be read using function get(). Values can also be sent to a unit using put().
|
inlineprotectedvirtual |
Returns true iff an event of a certain type has been triggered.
Reimplemented in pq::AbstractWave, pq::Alarm, pq::Metronome, pq::PeakDetector, pq::DigitalSource, pq::Ramp, pq::StreamIn, and pq::TimeSliceField< COUNT >.
|
inlinevirtualinherited |
Returns value (typically between 0 and 1, may vary depending on class).
Reimplemented in pq::AbstractWave, pq::Chronometer, pq::DigitalUnit, pq::AnalogSource, pq::AnalogIn, pq::Ramp, pq::Smoother, pq::PivotField, and pq::TimeSliceField< COUNT >.
|
inlinevirtualinherited |
Maps value to new range.
This function guarantees that the value is within [toLow, toHigh]. If the unit's values are unbounded, returns get() constrained to [toLow, toHigh].
Reimplemented in pq::Normalizer, pq::DigitalUnit, pq::AnalogSource, pq::AnalogIn, pq::Ramp, pq::StreamIn, and pq::StreamOut.
|
inlinevirtualinherited |
Pushes value into the unit.
| value | the value sent to the unit |
Reimplemented in pq::Chronometer, pq::MinMaxScaler, pq::Normalizer, pq::PeakDetector, pq::DigitalUnit, pq::AnalogOut, pq::AbstractServoOut, pq::Ramp, pq::Smoother, pq::StreamOut, pq::PivotField, and pq::TimeSliceField< COUNT >.