Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

gapeaccumulator.h

00001 //gapeaccumulator.h
00002 //Dave Chisholm dkc@ccrma.stanford.edu 11/21/00
00003 //Code in this file was contributed by Randal Leistikow randal@ccrma.stanford.edu
00004 
00005 #ifndef _GAPE_ACCUMULATOR_H
00006 #define _GAPE_ACCUMULATOR_H
00007 
00008 #include "gapeunit.h"
00009 #include <qthread.h>
00010 
00023 class GapeAccumulator : public GapeUnit
00024 {
00025   Q_OBJECT
00026 
00027     public:
00028 
00034    GapeAccumulator(int numSamples);
00035 
00039    virtual ~GapeAccumulator();
00040 
00041    public slots:
00042 
00048      virtual void receiveTick( const GapeFloat* values, int numValues );
00049 
00057         virtual void resizeAccumulator( int newSize );
00058 
00059    protected:
00060         int spaceRemaining() {
00061              return d_numSamples - d_writeIndex;
00062         }
00063 
00064         void adjustBuffers(int newSize);
00065 
00066     int        d_numSamples;
00067     int        d_writeIndex;
00068     GapeFloat*  d_samples;
00069     QMutex d_mutex;
00070     bool resizeNeeded;
00071     int resizeSize;
00072     int tickCounter;
00073 };
00074 
00075 
00076 
00077 #endif // _GAPE_ACCUMULATOR

Generated at Thu Jun 21 13:28:49 2001 for GAPE by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001