summaryrefslogtreecommitdiff
path: root/libs/audiographer/audiographer/general/deinterleaver.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/audiographer/audiographer/general/deinterleaver.h')
-rw-r--r--libs/audiographer/audiographer/general/deinterleaver.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/audiographer/audiographer/general/deinterleaver.h b/libs/audiographer/audiographer/general/deinterleaver.h
index 63b6c95589..491c07fcb6 100644
--- a/libs/audiographer/audiographer/general/deinterleaver.h
+++ b/libs/audiographer/audiographer/general/deinterleaver.h
@@ -26,7 +26,7 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
/// Constructor. \n RT safe
DeInterleaver()
: channels (0)
- , max_frames (0)
+ , max_samples (0)
, buffer (0)
{}
@@ -35,12 +35,12 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
typedef boost::shared_ptr<Source<T> > SourcePtr;
/// Inits the deinterleaver. Must be called before using. \n Not RT safe
- void init (unsigned int num_channels, framecnt_t max_frames_per_channel)
+ void init (unsigned int num_channels, samplecnt_t max_samples_per_channel)
{
reset();
channels = num_channels;
- max_frames = max_frames_per_channel;
- buffer = new T[max_frames];
+ max_samples = max_samples_per_channel;
+ buffer = new T[max_samples];
for (unsigned int i = 0; i < channels; ++i) {
outputs.push_back (OutputPtr (new IdentityVertex<T>));
@@ -60,28 +60,28 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
/// Deinterleaves data and outputs it to the outputs. \n RT safe
void process (ProcessContext<T> const & c)
{
- framecnt_t frames = c.frames();
+ samplecnt_t samples = c.samples();
T const * data = c.data();
- framecnt_t const frames_per_channel = frames / channels;
+ samplecnt_t const samples_per_channel = samples / channels;
if (throw_level (ThrowProcess) && c.channels() != channels) {
throw Exception (*this, "wrong amount of channels given to process()");
}
- if (throw_level (ThrowProcess) && frames_per_channel > max_frames) {
- throw Exception (*this, "too many frames given to process()");
+ if (throw_level (ThrowProcess) && samples_per_channel > max_samples) {
+ throw Exception (*this, "too many samples given to process()");
}
unsigned int channel = 0;
for (typename std::vector<OutputPtr>::iterator it = outputs.begin(); it != outputs.end(); ++it, ++channel) {
if (!*it) { continue; }
- for (unsigned int i = 0; i < frames_per_channel; ++i) {
+ for (unsigned int i = 0; i < samples_per_channel; ++i) {
buffer[i] = data[channel + (channels * i)];
}
- ProcessContext<T> c_out (c, buffer, frames_per_channel, 1);
+ ProcessContext<T> c_out (c, buffer, samples_per_channel, 1);
(*it)->process (c_out);
}
}
@@ -96,12 +96,12 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
delete [] buffer;
buffer = 0;
channels = 0;
- max_frames = 0;
+ max_samples = 0;
}
std::vector<OutputPtr> outputs;
unsigned int channels;
- framecnt_t max_frames;
+ samplecnt_t max_samples;
T * buffer;
};