Olivier Smeesters
/
DtmfKit
A DTMF sequence editor and player for HAM radio equipment command & control.
Diff: mbed_dtmf_generator.hpp
- Revision:
- 0:1324e7d9d471
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed_dtmf_generator.hpp Mon Mar 07 22:51:19 2011 +0000 @@ -0,0 +1,29 @@ +#ifndef _MBED_DTMF_GENERATOR_HPP +#define _MBED_DTMF_GENERATOR_HPP + +#include "dtmf_generator.hpp" + +#include "snd_wave_generator/SoundWaveGenerator.h" +#include "snd_wave_generator/Wave.h" + +#include <memory> + +class MbedDtmfGenerator : public DtmfGenerator { +public: + MbedDtmfGenerator(); + + virtual void play(char ch); + virtual void stop(); + +private: + void makeWaves(); + void makeKeyWave(int pos, int row, int col); + snd_wave_generator::Wave * getWaveFor(char ch); + + snd_wave_generator::SoundWaveGenerator generator; + std::auto_ptr<snd_wave_generator::Wave> rowWaves[4]; + std::auto_ptr<snd_wave_generator::Wave> colWaves[4]; + std::auto_ptr<snd_wave_generator::Wave> waves[16]; +}; + +#endif \ No newline at end of file