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

gapecontroller.h

00001 //gapecontroller.h
00002 //Dave Chisholm dkc@ccrma.stanford.edu
00003 //11/24/00
00004 
00005 #ifndef _GAPE_CONTROLLER_H_
00006 #define _GAPE_CONTROLLER_H_
00007 
00008 #include <qwidget.h>
00009 #include <qapplication.h>
00010 #include "gapeconsts.h"
00011 //#include "object.h"
00012 
00045 class GapeController : public QWidget
00046 {
00047   Q_OBJECT
00048     public:
00054         GapeController(QWidget* parent=0, const char * name=0)
00055         : QWidget(parent,name) {};
00056 
00060         ~GapeController() {};
00061 
00062 public slots:
00067     void setFreq(double freq) {
00068             emit emitFreq(freq);
00069         }
00070 
00075         void setGain(double gain) {
00076             emit emitGain(gain);
00077         }
00078 
00083         void setGainDb(double gain) {
00084             emit emitGainDb(gain);
00085         }
00086 
00091         void setSolo(bool s) {
00092             emit emitSolo(s);
00093         }
00094 
00099         void setMute(bool m) {
00100             emit emitMute(m);
00101         }
00102 
00107         void setNumChannels(int c) {
00108             emit emitNumChannels(c);
00109         }
00110         //setSampleRate(GapeFloat freq);
00111 
00112     signals:
00113         void emitFreq(double freq);
00114         void emitGain(double gain);
00115         void emitGainDb(double gain);
00116         void emitSolo(bool s);
00117         void emitMute(bool m);
00118         void emitNumChannels(int c);
00119         //emitSampleRate(GapeFloat freq);
00120 
00121     protected:
00125         virtual void requestUpdate() {
00126             //this is a horrible, horrible thing, but right now there doesn't seem to be any help
00127             //for it. For some reason, the custom event handling in QT linux doesn't seem to working -
00128             //well, at least not in GAPE... the only time custom events are handled is when mouse events
00129             //are also happening. So we do some terrible thread-unsafe sadness here. The event handling 
00130             //in Windows seems to work as expected. I need to investigate this.
00131             #ifdef DIRECTX_API
00132             GapeRedrawEvent* ge = new GapeRedrawEvent();   // Qt will delete it when done
00133             QApplication::postEvent( this, ge );
00134             #else
00135             updateDisplay();
00136             #endif
00137         }
00138 
00143         virtual void customEvent(QCustomEvent* e) {
00144             if ( e->type() == GAPE_REDRAW_EVENT ) {
00145                 updateDisplay();
00146             }
00147         }
00148 
00152         virtual void updateDisplay () {}
00153 
00154 };
00155 #endif

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