Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

effects.h

Go to the documentation of this file.
00001 #ifndef EFFECTS_H
00002 #define EFFECTS_H
00003 
00004 #include <qptrlist.h>
00005 #include <qcstring.h>
00006 #include <qstrlist.h>
00007 #include <qobject.h>
00008 
00009 namespace Arts { class StereoEffect; }
00010 class Engine;
00011 class EffectConfigWidget;
00012 
00013 /**
00014  * new Effect("Arts::SomeEffect");
00015  * then you can add,insert,bleh it with class Effects
00016  **/
00017 class Effect
00018 {
00019 friend class Effects;
00020 friend class EffectConfigWidget;
00021 public:
00022     Effect(const char *name);
00023     ~Effect();
00024 
00025     /**
00026      * return the effect processed
00027      * directly before this one
00028      **/
00029     Effect *before() const;
00030     /**
00031      * return the effect processed
00032      * directly after this one
00033      **/
00034     Effect *after() const;
00035     long id() const;
00036 
00037     /**
00038      * get the Arts object.
00039      * @internal
00040      **/
00041     Arts::StereoEffect *effect() const;
00042 
00043     /**
00044      * Get the name of the object.
00045      **/
00046     QCString name() const;
00047     
00048     /**
00049      * get the "clean" title of effect
00050      **/
00051     QString title() const;
00052 
00053     /**
00054      * is this effect name invalid? e.g., will it segfault
00055      * if you StereoEffect::start() this?
00056      **/
00057     bool isNull() const;
00058 
00059     /**
00060      * show the configure dialog box for
00061      * this effect.  if friendly is true, 
00062      * then create a top-level window,
00063      * set an icon and make it purdy. Otherwise
00064      * create a plan widget that you can reparent.
00065      **/
00066     QWidget *configure(bool friendly=true);
00067 
00068     /**
00069      * Does this widget have a configurable
00070      * dialog box.  E.g., will configure
00071      * return null?
00072      **/
00073     bool configurable() const;
00074 
00075     /**
00076      * turn Arts::FREEVERB into just FREEVERB
00077      **/
00078     static QString clean(const QCString &name);
00079 private:
00080     long mId;
00081     Arts::StereoEffect *mEffect;
00082     QCString mName;
00083     QWidget *mConfig;
00084 };
00085 
00086 class Effects : public QObject
00087 {
00088 Q_OBJECT
00089 friend class Effect;
00090 public:
00091     Effects();
00092 
00093     bool insert(const Effect *after, Effect *item);
00094 
00095     /**
00096      * create the Effect, by getting the proper item
00097      * from the list, then append it here.
00098      *
00099      * for example, append(new Effect(available()[0]));
00100      **/
00101     bool append(Effect *item);
00102 
00103     /**
00104      * reorder the effect stack.  if after is null,
00105      * it'l be first
00106      **/
00107     void move(const Effect *after, Effect *item);
00108     /**
00109      * remove @param item from the effect stack, but
00110      * don't deallocate it unless del is true (default true)
00111      **/
00112     void remove(Effect *item, bool del=true);
00113     /**
00114      * @r remove() all items from the effect stack
00115      * only delete them if del is true (default true)
00116      **/
00117     void removeAll(bool del=true);
00118 
00119     /**
00120      * a list of all available effects, by name
00121      * each of these can be given to the first
00122      * argument of the Effect constructor
00123      **/
00124     QStrList available() const;
00125 
00126     QPtrList<Effect> effects() const;
00127 
00128     /**
00129      * Get the Effect that has the following id
00130      **/
00131     Effect *findId(long id) const;
00132 
00133 private:
00134     QPtrListIterator<Effect> stackPosition() const;
00135     
00136 signals:
00137     /**
00138      * called when @param effect has been
00139      * added to the effect stack
00140      **/
00141     void added(Effect *effect);
00142     /**
00143      * called when @param effect has been
00144      * removed from the effect stack
00145      **/
00146     void removed(Effect *effect);
00147     /**
00148      * called when @param effect has been moved
00149      **/
00150     void moved(Effect *effect);
00151     /**
00152      * callsed when @p effect is about to be
00153      * deleted (from memory)
00154      **/
00155     void deleting(Effect *effect);
00156 
00157 private:
00158     // stored in no specific order
00159     QPtrList<Effect> mItems;
00160 };
00161 
00162 
00163 
00164 #endif
00165 

Generated at Mon Apr 1 11:45:00 2002 for noatun by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001