CSL  6.0
BlockResizer.h
Go to the documentation of this file.
1 ///
2 /// BlockResizer.h -- Regularizes the amount of data called for,
3 /// meaning that different parts of a graph can run at different callback block sizes.
4 /// This is useful for time-frequency transformations that only work with fixed buffer sizes.
5 /// A BlockResizer either caches large blocks between multiple smaller callbacks, or it calls a
6 /// smaller-block-size graph several times per larger-sized downstream callbacks.
7 /// BlockResizer works for up-block and down-block situations.
8 /// This version also handles multi-channel mapping, so you can use a mono input and ask it for
9 /// multi-channel output; it will copy.
10 ///
11 /// See the copyright notice and acknowledgment of authors in the file COPYRIGHT
12 ///
13 
14 #ifndef CSL_BlockResizer_H
15 #define CSL_BlockResizer_H
16 
17 #include "CSL_Core.h"
18 
19 namespace csl {
20 
21 /// Regularizes the amount of data called for.
22 /// This is useful for time-frequency transformations that only work with certain buffer sizes.
23 
24 class BlockResizer : public UnitGenerator { // it could be an Effect
25 
26 public: /// ctor / dtor
27  BlockResizer(UnitGenerator & input, unsigned blockSize);
28  ~BlockResizer();
29  /// the work-horse method calls the up-hill graph as needed
30  void nextBuffer(Buffer & outputBuffer) throw(CException);
31 
32 protected:
33  UnitGenerator * mInput; ///< my input unit generator (pointer)
34  Buffer mInputBuffer; ///< buffer used to pull input
35  unsigned mBufferSize; ///< fixed buffer size of the up-hill graph
36  int mFramePointer; ///< where am I in reading the input?
37 };
38 
39 }
40 
41 #endif
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Definition: Accessor.h:17
Regularizes the amount of data called for. This is useful for time-frequency transformations that onl...
Definition: BlockResizer.h:24
UnitGenerator * mInput
my input unit generator (pointer)
Definition: BlockResizer.h:33
Buffer mInputBuffer
buffer used to pull input
Definition: BlockResizer.h:34
int mFramePointer
where am I in reading the input?
Definition: BlockResizer.h:36
void nextBuffer(Buffer &outputBuffer)
the work-horse method calls the up-hill graph as needed
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
Definition: CSL_Core.h:106
BlockResizer(UnitGenerator &input, unsigned blockSize)
ctor / dtor
forward declaration
Definition: CSL_Core.h:241
Base class of CSL exceptions (written upper-case). Has a string message.
unsigned mBufferSize
fixed buffer size of the up-hill graph
Definition: BlockResizer.h:35