Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
WaveCombo.h
00001 #ifndef WAVE_COMBO_H_ 00002 #define WAVE_COMBO_H_ 00003 00004 #include "snd_wave_generator/Wave.h" 00005 #include <vector> 00006 00007 namespace snd_wave_generator { 00008 00009 /** 00010 * @brief A class that produces a wave that results of the combination of multiple waves. 00011 * The combined wave does not buffer itself (as it does not know the length of the combined cycle. 00012 * During preparation phase, it invokes the prepare() method of its contained waves. 00013 */ 00014 class WaveCombo : public Wave { 00015 public: 00016 WaveCombo(Wave *wave = NULL) : waves(), numWaves(0) 00017 { 00018 add(wave); 00019 } 00020 00021 WaveCombo & add(Wave *wave); 00022 00023 virtual void prepare(std::size_t sampleRate); 00024 virtual float read(std::size_t pos) const; 00025 00026 private: 00027 std::vector<Wave*> waves; 00028 float numWaves; 00029 }; 00030 00031 } // snd_wave_generator 00032 00033 #endif // WAVE_COMBO_H_
Generated on Wed Jul 13 2022 16:23:43 by
1.7.2