BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
bwtwave.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BWT_WAVE_H__
3 #define __BWT_WAVE_H__
4 
5 #include <bse/gsldatahandle.hh>
6 #include <bse/gslwavechunk.hh>
7 #include <bse/bseenums.hh>
8 #include <string>
9 #include <list>
10 #include <vector>
11 
12 namespace BseWaveTool {
13 using namespace std;
14 
15 class WaveChunk {
16 public:
17  GslDataHandle *dhandle; /* always open */
18  /*Con*/ WaveChunk();
19  /*Copy*/ WaveChunk (const WaveChunk &rhs);
20  WaveChunk& operator= (const WaveChunk &);
21  Bse::ErrorType set_dhandle_from_file (const string &fname,
22  gdouble osc_freq,
23  gchar **xinfos);
24  Bse::ErrorType change_dhandle (GslDataHandle *xhandle,
25  gdouble osc_freq,
26  gchar **xinfos);
27  /*Des*/ ~WaveChunk();
28 };
29 
30 struct Wave {
31  guint n_channels;
32  string name;
33  list<WaveChunk> chunks;
34  gchar **wave_xinfos;
35  void set_chunks_xinfo (const gchar *key,
36  const gchar *value,
37  gfloat osc_freq,
38  bool all_chunks);
39 public:
40  /*Con*/ Wave (const gchar *wave_name,
41  guint n_channels,
42  gchar **xinfos);
43  void set_xinfo (const gchar *key,
44  const gchar *value);
45  void set_all_xinfo (const gchar *key,
46  const gchar *value)
47  {
48  set_chunks_xinfo (key, value, -1, true);
49  }
50  void set_chunk_xinfo (gfloat osc_freq,
51  const gchar *key,
52  const gchar *value)
53  {
54  set_chunks_xinfo (key, value, osc_freq, false);
55  }
56  Bse::ErrorType add_chunk (GslDataHandle *dhandle,
57  gchar **xinfos = NULL);
58  GslDataHandle* lookup (gfloat osc_freq);
59  bool match (const WaveChunk &wchunk,
60  vector<float> &sorted_freqs);
61  void remove (list<WaveChunk>::iterator it);
62  void sort ();
63  Bse::ErrorType store (const string file_name);
64  /*Des*/ ~Wave ();
65 };
66 
67 } // BseWaveTool
68 
69 #endif /* __BWT_WAVE_H__ */
Definition: bwtwave.hh:15
STL namespace.
The BseWaveTool namespace contains all functions of the bse wave tool utility.
Definition: bsewavetool.cc:23
STL class.
Interface for PCM wave samples.
Definition: bseapi.idl:574
T sort(T...args)