Olivier Smeesters
/
DtmfKit
A DTMF sequence editor and player for HAM radio equipment command & control.
SoundWaveGenerator/snd_wave_generator/SineWave.h@0:1324e7d9d471, 2011-03-07 (annotated)
- Committer:
- osmeest
- Date:
- Mon Mar 07 22:51:19 2011 +0000
- Revision:
- 0:1324e7d9d471
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
osmeest | 0:1324e7d9d471 | 1 | #ifndef SINE_WAVE_H_ |
osmeest | 0:1324e7d9d471 | 2 | #define SINE_WAVE_H_ |
osmeest | 0:1324e7d9d471 | 3 | |
osmeest | 0:1324e7d9d471 | 4 | #include "snd_wave_generator/BufferedWave.h" |
osmeest | 0:1324e7d9d471 | 5 | |
osmeest | 0:1324e7d9d471 | 6 | namespace snd_wave_generator { |
osmeest | 0:1324e7d9d471 | 7 | |
osmeest | 0:1324e7d9d471 | 8 | /** |
osmeest | 0:1324e7d9d471 | 9 | * @brief A class producing a sine wave of a given frequency. |
osmeest | 0:1324e7d9d471 | 10 | */ |
osmeest | 0:1324e7d9d471 | 11 | class SineWave : public BufferedWave { |
osmeest | 0:1324e7d9d471 | 12 | public: |
osmeest | 0:1324e7d9d471 | 13 | SineWave(unsigned freq) : BufferedWave(), frequency(freq) { } |
osmeest | 0:1324e7d9d471 | 14 | |
osmeest | 0:1324e7d9d471 | 15 | virtual void prepare(std::size_t sampleRate); |
osmeest | 0:1324e7d9d471 | 16 | |
osmeest | 0:1324e7d9d471 | 17 | private: |
osmeest | 0:1324e7d9d471 | 18 | unsigned frequency; |
osmeest | 0:1324e7d9d471 | 19 | }; |
osmeest | 0:1324e7d9d471 | 20 | |
osmeest | 0:1324e7d9d471 | 21 | } // snd_wave_generator |
osmeest | 0:1324e7d9d471 | 22 | |
osmeest | 0:1324e7d9d471 | 23 | #endif // SINE_WAVE_H_ |