Olivier Smeesters
/
DtmfKit
A DTMF sequence editor and player for HAM radio equipment command & control.
SoundWaveGenerator/snd_wave_generator/Wave.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 WAVE_H_ |
osmeest | 0:1324e7d9d471 | 2 | #define WAVE_H_ |
osmeest | 0:1324e7d9d471 | 3 | |
osmeest | 0:1324e7d9d471 | 4 | #include <cstddef> |
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 Interface of a playable sound wave. |
osmeest | 0:1324e7d9d471 | 10 | * Waves are processed in two phases. |
osmeest | 0:1324e7d9d471 | 11 | * Before sending out signal, the wave is "prepared" for the generator sample rate. |
osmeest | 0:1324e7d9d471 | 12 | * Once the preparation is done, the generator will repeatedly "read" the wave samples. |
osmeest | 0:1324e7d9d471 | 13 | * The sample position is measured in samples. |
osmeest | 0:1324e7d9d471 | 14 | */ |
osmeest | 0:1324e7d9d471 | 15 | class Wave { |
osmeest | 0:1324e7d9d471 | 16 | public: |
osmeest | 0:1324e7d9d471 | 17 | virtual void prepare(std::size_t sampleRate) = 0; |
osmeest | 0:1324e7d9d471 | 18 | virtual float read(std::size_t pos) const = 0; |
osmeest | 0:1324e7d9d471 | 19 | }; |
osmeest | 0:1324e7d9d471 | 20 | |
osmeest | 0:1324e7d9d471 | 21 | } // snd_wave_generator |
osmeest | 0:1324e7d9d471 | 22 | |
osmeest | 0:1324e7d9d471 | 23 | #endif // WAVE_H_ |