Plaquette
Loading...
Searching...
No Matches
SquareWave.h
1/*
2 * SquareWave.h
3 *
4 * (c) 2015 Sofian Audry :: info(@)sofianaudry(.)com
5 * (c) 2015 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 SQUARE_WAVE_H_
22#define SQUARE_WAVE_H_
23
24#include "Wave.h"
25
26namespace pq {
27
32class [[deprecated("Use Wave(SQUARE) instead.")]] SquareWave : public Wave {
33public:
34 SquareWave(Engine& engine = Engine::primary()) : Wave(SQUARE, engine) {}
35 SquareWave(float period, Engine& engine = Engine::primary()) : Wave(SQUARE, period, engine) {}
36 SquareWave(float period, float skew, Engine& engine = Engine::primary()) : Wave(SQUARE, period, skew, engine) {}
37 virtual ~SquareWave() {}
38
40 [[deprecated("Use skew(float) instead.")]]
41 virtual void dutyCycle(float dutyCycle) { skew(dutyCycle); }
42
44 [[deprecated("Use skew() instead.")]]
45 virtual float dutyCycle() const { return skew(); }
46};
47
49[[deprecated("Use Wave(SQUARE) instead.")]]
50typedef SquareWave SquareOsc;
51
52}
53
54#endif
virtual void period(float period)
Sets the period (in seconds).
Definition AbstractOscillator.cpp:123
virtual void skew(float skew)
Sets the skew of the signal as a % of period.
Definition AbstractWave.cpp:97
The main Plaquette static class containing all the units.
Definition PqCore.h:63
static Engine & primary()
Returns the main instance of Plaquette.
Definition PqCore.cpp:30
virtual float dutyCycle() const
Definition SquareWave.h:45
virtual void dutyCycle(float dutyCycle)
Definition SquareWave.h:41
Engine * engine() const
Returns the engine that owns this unit.
Definition PqCore.h:420
Wave(float period, Engine &engine=Engine::primary())
Constructor (creates default square wave).
Definition Wave.cpp:28