#include <gapeaccumulator.h>
Inheritance diagram for GapeAccumulator::
Public Slots | |
virtual void | receiveTick (const GapeFloat *values, int numValues) |
The accumulator will save the ticks it receives until its buffer is full, and then emit them. More... | |
virtual void | resizeAccumulator (int newSize) |
Change the size of the buffer the accumulator will save. More... | |
Public Methods | |
GapeAccumulator (int numSamples) | |
The constructor. More... | |
virtual | ~GapeAccumulator () |
The destructor. | |
Protected Methods | |
int | spaceRemaining () |
void | adjustBuffers (int newSize) |
Protected Attributes | |
int | d_numSamples |
int | d_writeIndex |
GapeFloat* | d_samples |
QMutex | d_mutex |
bool | resizeNeeded |
int | resizeSize |
int | tickCounter |
The accumulator class simply receives a specified number of ticks, saves them in a buffer, and emits them all at once. In this way, the "numValues" parameter when it performs emitTick() is used subtly different; generally it specifies how many channels of audio in a single sample cycle are sent, but here it specifies how many samples total are sent. This class is generally meant for mono channels audio (consider using a GapeChannelSplitter for multichannel audio), although its flexible enough to be used in another scheme. I'm not sure if it is threadsafe - I doubt it, but need to look into Randal's code more to be sure.
Definition at line 23 of file gapeaccumulator.h.
|
The constructor.
Definition at line 4 of file gapeaccumulator.cpp. |
|
The accumulator will save the ticks it receives until its buffer is full, and then emit them.
Reimplemented from GapeUnit. Definition at line 21 of file gapeaccumulator.cpp. Referenced by GapeFreqDomainDisplay::receiveTick(), and GapeTimeDomainDisplay::receiveTick().
|
|
Change the size of the buffer the accumulator will save. If the new buffer is large enough, the accumulator will just copy its currently saved samples into it. If it is not, it will call emitTick() to send out samples until it has enough room.
Definition at line 101 of file gapeaccumulator.cpp. |