00001 //GapeUnitGroup.h 00002 //Dave Chisholm dkc@ccrma.stanford.edu 00003 //11/20/00 00004 #ifndef _GAPE_UNIT_GROUP_H 00005 #define _GAPE_UNIT_GROUP_H 00006 00007 #include "gapeunit.h" 00008 00028 00029 class GapeUnitGroup : public GapeUnit { 00030 Q_OBJECT 00031 00032 public: 00039 GapeUnitGroup(GapeController* c = NULL, int capacity = GAPE_DEFAULT_GROUP_CAPACITY); 00040 00044 virtual ~GapeUnitGroup(); 00045 00046 public slots: 00047 virtual void receiveTick(const GapeFloat* values, int numValues) { 00048 if (muted || (numUnits == 0)) { 00049 emitTick(values,numValues); 00050 return; 00051 } 00052 //if (updateMutex.locked()) GapeConsts::reportError("locked GUG\n"); 00053 //else GapeConsts::reportError("NOT locked GUG\n"); 00054 //updateMutex.lock(); 00055 units[0]->receiveTick(values,numValues); 00056 //updateMutex.unlock(); 00057 } 00058 00063 virtual void addUnit(GapeUnit* u); 00064 00070 virtual void removeUnit(GapeUnit* u); 00071 00076 virtual int getNumUnits() { 00077 return numUnits; 00078 } 00079 00085 virtual GapeUnit* getUnit(int index); 00086 00091 virtual void requestSolo(GapeUnit* requestingUnit); 00092 00097 virtual void endSolo(GapeUnit* requestingUnit); 00098 00103 virtual void addController(GapeController* c); 00104 00105 00110 virtual void removeController(GapeController* c); 00111 00112 00113 /* 00114 * Unmutes all other units in the group when the currently soloed unit ends its solo mode 00115 * @param requestingUnit A pointer to the unit to be played in solo mode 00116 00117 virtual void endSolo(GapeUnit* requestingUnit); 00118 */ 00119 00120 00121 00122 //solo, endsolo(), endsolo(gapeunit*) 00123 00124 protected: 00125 GapeUnit** units; 00126 int numUnits, currentCapacity; 00127 }; 00128 00129 #endif