SpectMorph
smwavdata.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_WAVE_DATA_HH
4 #define SPECTMORPH_WAVE_DATA_HH
5 
6 #include "smutils.hh"
7 
8 #include <vector>
9 
10 namespace SpectMorph
11 {
12 
13 class WavData
14 {
15  std::vector<float> m_samples;
16  float m_mix_freq;
17  int m_n_channels;
18  std::string m_error_blurb;
19 
20 public:
21  WavData();
22  WavData (const std::vector<float>& samples, int n_channels, float mix_freq);
23 
24  bool load (const std::string& filename);
25  bool load_mono (const std::string& filename);
26 
27  void load (const std::vector<float>& samples, int n_channels, float mix_freq);
28 
29  bool save (const std::string& filename);
30 
31  void clear();
32  void prepend (const std::vector<float>& samples);
33 
34  float mix_freq() const;
35  int n_channels() const;
36  size_t n_values() const;
37  const std::vector<float>& samples() const;
38  const char *error_blurb() const;
39 
40  float operator[] (size_t pos) const;
41 };
42 
43 }
44 
45 #endif /* SPECTMORPH_WAVE_DATA_HH */
Definition: smalignedarray.cc:7
Definition: smwavdata.hh:13