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

gapeconsts.h

00001 //gapeconsts.h
00002 //Dave Chisholm dkc@ccrma.stanford.edu
00003 //11/19/00
00004 #ifndef _GAPE_CONSTS_H
00005 #define _GAPE_CONSTS_H
00006 
00007 #include "Object.h"//for stk's MY_FLOAT definition (ie float or double sample values)
00008 #include <qpixmap.h>
00009 #include <qevent.h>
00010 #include <qobject.h>
00011 #include <qstring.h>
00012 
00013 #define GAPE_REDRAW_EVENT 21380//this is my birthday, which is a very important number!
00014 #define GAPE_GLOBAL_REDRAW_EVENT 53153//Happy birthday Dad!
00015 
00016 //this is the default starting capacity of a GapeUnitGroup.
00017 #define GAPE_DEFAULT_GROUP_CAPACITY 8
00018 //#define GAPE_DEFAULT_NUM_UNITS 8
00019 
00020 /*
00021 #define GAPE_TICK_MODE_SEQUENTIAL 0
00022 #define GAPE_TICK_MODE_PARALLEL 1
00023 */
00024 
00025 //this is the size (in samples) of the buffers we will use when doing real time sound io
00026 //ideally this would be editable at runtime, but right now the STK code we rely on does not allow
00027 //this
00028 #define GAPE_RT_IO_BUFFER_SIZE 256
00029 
00030 
00031 #define GAPE_DEFAULT_NUM_CHANNELS 1
00032 #define GAPE_NFFT_LENGTH 2048
00033 //#define GAPE_REALTIME_IO_BUFFER_LENGTH
00034 
00035 //this is by no means a hard standard - it just means that the built in GAPE classes will not support more
00036 //than this many channels - feel free to redefine this and re-compile if 16 isn't enough. A smaller number
00037 //would be slightly more memory efficient.
00038 #define GAPE_MAX_NUM_CHANNELS 16
00039 //#define GAPE_MAX_NUM_CHANNELS 2
00040 
00041 #define GAPE_ERROR_FILE "error.txt"
00042 
00043 //each gapeunit has an array to hold controllers. This is the starting size of the array, although it will grow as needed.
00044 #define GAPE_DEFAULT_NUM_CONTROLLERS 3
00045 
00046 //this compile time constant can be used to compile only the non graphical parts of Gape. Right now,
00047 //this functionality has not been implemented.
00048 //#define GAPE_NON_GRAPHICAL
00049 
00066 #define GapeFloat MY_FLOAT
00067 //#define GapeFloat double
00068 //#define GapeFloat float
00069 
00080 #define GapeIntSample short
00081 
00082 
00083 //uncomment and re-compile for more printf's for debugging
00084 //#define GAPE_DEBUG
00085 
00096 class GapeConsts {
00097     public:
00101         enum PlaybackMode {LOOPING,ONEPLAY};
00102 
00106         enum TickMode {SEQUENTIAL,PARALLEL};
00107 
00108         /*static QPixmap* sinePic;// = QPixmap(3,4);//(3,4);
00109         static const QPixmap trianglePic;
00110         static const QPixmap halfwavePic;
00111         static const QPixmap squarePic;
00112         static const QPixmap sawtoothPic;
00113         static const QPixmap gapePic;
00114         static const QPixmap gapeControllerPic;
00115         static const QPixmap sourcesPic;
00116         static const QPixmap filtersPic;
00117         static const QPixmap outputsPic;
00118 */
00123         static void reportError(const char* error);
00124 
00129         static GapeIntSample floatToInt(GapeFloat value) {
00130             return ((GapeIntSample) (value * 32767));
00131         }
00132 
00137         static GapeFloat IntToFloat(GapeIntSample value) {
00138             return (((GapeFloat) value) / 32768);
00139         }
00140 
00148         static void** expandArray(void** array, int* oldCapacity, int factor = 2);
00149 
00150 
00157         static int sampleRate;// = 22050;
00158 
00169         static int updateMutexPeriod;// = 22050;
00170         //static const RTDuplex???
00171 };
00172 
00173 
00181 class GapeRedrawEvent : public QCustomEvent {
00182   public:
00183     GapeRedrawEvent()
00184         : QCustomEvent( GAPE_REDRAW_EVENT ) {}
00185 };
00186 
00187 /*
00188 class GapeGlobalRedrawEvent : public QCustomEvent {
00189   public:
00190         GapeGlobalRedrawEvent()
00191             : QCustomEvent( GAPE_GLOBAL_REDRAW_EVENT )
00192         {}
00193 };
00194 */
00195 
00196 
00553 #endif
00554 

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