Plaquette
 
Loading...
Searching...
No Matches
Metronome.h
1/*
2 * Metronome.h
3 *
4 * (c) 2018 Sofian Audry :: info(@)sofianaudry(.)com
5 * (c) 2018 Thomas O Fredericks :: tof(@)t-o-f(.)info
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef METRO_H_
22#define METRO_H_
23
24#include "PqCore.h"
25#include "AbstractOscillator.h"
26#include "pq_phase_utils.h"
27
28namespace pq {
29
34public:
40
47
49 virtual bool isOn() { return _overflowed; }
50
52 virtual void onBang(EventCallback callback);
53
54protected:
55 // Core Plaquette methods.
56 virtual void begin();
57 virtual void step();
58
59 // Returns true if event is triggered.
60 virtual bool eventTriggered(EventType eventType);
61};
62
64[[deprecated("Use Metronome instead.")]]
65typedef Metronome Metro;
66
67}
68
69#endif
Triangle/sawtooth oscillator.
Definition AbstractOscillator.h:33
virtual float period() const
Returns the period (in seconds).
Definition AbstractOscillator.h:50
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
Chronometer digital unit which emits 1/true/"on" for one frame, at a regular pace.
Definition Metronome.h:33
virtual bool eventTriggered(EventType eventType)
Returns true iff an event of a certain type has been triggered.
Definition Metronome.cpp:42
virtual void onBang(EventCallback callback)
Registers event callback on metronome tick ("bang") event.
Definition Metronome.cpp:38
virtual bool isOn()
Returns true iff the metronome fires.
Definition Metronome.h:49
Engine * engine() const
Returns the engine that owns this unit.
Definition PqCore.h:382