comparison trunk/src/Support/SignalBank.h @ 397:7a573750b186

- First add of a lot of graphics code from the old version. Not working yet, not even compiling yet.
author tomwalters
date Fri, 15 Oct 2010 05:40:53 +0000
parents d10433224758
children 733a11a65f3d
comparison
equal deleted inserted replaced
396:06a26f5cdad7 397:7a573750b186
52 * and centre frequencies as the input signal bank 52 * and centre frequencies as the input signal bank
53 */ 53 */
54 bool Initialize(const SignalBank &input); 54 bool Initialize(const SignalBank &input);
55 bool Validate() const; 55 bool Validate() const;
56 56
57 // Return a const reference to an individual signal. Allows for
58 // signal[channel][sample] referencing of SignalBanks.
57 inline const vector<float> &operator[](int channel) const { 59 inline const vector<float> &operator[](int channel) const {
58 return signals_[channel]; 60 return signals_[channel];
59 }; 61 };
60 62
63 // Return a const reference to an individual signal.
61 inline const vector<float> &get_signal(int channel) const { 64 inline const vector<float> &get_signal(int channel) const {
65 return signals_[channel];
66 };
67
68 // Return a reference to the signal vector. The reference is not
69 // const, so the vector is directly modifiable. In order to maintain
70 // consistency of the data within the filterbank, the size of this
71 // vector should not be changed. Changes to the vector size can be picked
72 // up with a call to Validate(), which will return false if the sizes of
73 // channle vectors are not consistent.
74 inline vector<float> &get_mutable_signal(int channel) {
62 return signals_[channel]; 75 return signals_[channel];
63 }; 76 };
64 77
65 inline void set_signal(int channel, vector<float> input) { 78 inline void set_signal(int channel, vector<float> input) {
66 signals_[channel] = input; 79 signals_[channel] = input;