diff 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
line wrap: on
line diff
--- a/trunk/src/Support/SignalBank.h	Wed Sep 29 00:24:03 2010 +0000
+++ b/trunk/src/Support/SignalBank.h	Fri Oct 15 05:40:53 2010 +0000
@@ -54,14 +54,27 @@
   bool Initialize(const SignalBank &input);
   bool Validate() const;
 
+  // Return a const reference to an individual signal. Allows for 
+  // signal[channel][sample] referencing of SignalBanks.
   inline const vector<float> &operator[](int channel) const {
     return signals_[channel];
   };
 
+  // Return a const reference to an individual signal.
   inline const vector<float> &get_signal(int channel) const {
     return signals_[channel];
   };
   
+  // Return a reference to the signal vector. The reference is not
+  // const, so the vector is directly modifiable. In order to maintain
+  // consistency of the data within the filterbank, the size of this
+  // vector should not be changed. Changes to the vector size can be picked
+  // up with a call to Validate(), which will return false if the sizes of
+  // channle vectors are not consistent.
+  inline vector<float> &get_mutable_signal(int channel) {
+    return signals_[channel];
+  };
+  
   inline void set_signal(int channel, vector<float> input) {
     signals_[channel] = input;
   }