Noatun API Documentation

plugin.h

Go to the documentation of this file.
00001 #ifndef NPLUGIN_H
00002 #define NPLUGIN_H
00003 
00004 #include <noatun/pluginloader.h>
00005 #include <qmemarray.h>
00006 #include <vector>
00007 
00008 
00009 namespace Noatun { class FFTScopeStereo; class FFTScope; class RawScope;
00010                    class RawScopeStereo; class StereoEffectStack;
00011                    class Listener;
00012                  }
00013 namespace Arts { class SoundServerV2; class Dispatcher; }
00014 
00015 //backwards compatibility
00016 
00017 #define NOATUNPLUGIND
00018 #define NOATUNPLUGINC(classname)  { }
00019 
00020 class Playlist;
00021 class Player;
00022 class ExitNotifier;
00023 class NoatunApp;
00024 
00025 class Plugin
00026 {
00027 public:
00028         Plugin();
00029         virtual ~Plugin();
00030 
00035         virtual void init();
00036 
00043         virtual bool unload();
00044 
00050         virtual Playlist *playlist() { return 0; }
00051 };
00052 
00053 class UserInterface : public Plugin
00054 {
00055 public:
00056         UserInterface();
00057         virtual ~UserInterface();
00058 };
00059 
00060 
00061 class TimerThingy;
00062 
00063 
00074 class Visualization
00075 {
00076 friend class TimerThingy;
00077 friend class ThingThatTellsAVisualizationThatNoatunIsGone;
00078 friend class ExitNotifier;
00079 friend class NoatunApp;
00080 public:
00090         Visualization(int interval=125, int pid=0);
00091         virtual ~Visualization();
00092 
00097         virtual void start();
00101         virtual void stop();
00102 
00106         int interval() const;
00107 
00113         virtual void setInterval(int msecs);
00114 
00118         virtual void timeout()=0;
00119 
00120         Noatun::StereoEffectStack visualizationStack();
00121         Arts::SoundServerV2 *server();
00122 
00132         static int noatunPid();
00133 
00137         bool connected();
00138 
00143         static void initDispatcher();
00144 
00145 private:
00146         int mTimeout;
00147         TimerThingy *mTimerThingy;
00148         QCString mVisualizationStack;
00149         Arts::SoundServerV2 *mServer;
00150         static Arts::Dispatcher *mDispatcher;
00151         static bool internalVis;
00152 };
00153 
00154 class FFTScope : public Visualization
00155 {
00156 public:
00157         FFTScope(int interval, int pid=0);
00158 
00162         virtual int bands() const=0;
00163 
00172         static float magic(int bands);
00173 
00190         virtual void setBands(float n)=0;
00191 };
00192 
00193 class StereoFFTScope : public FFTScope
00194 {
00195 public:
00196         StereoFFTScope(int timeout=250, int pid=0);
00197         virtual ~StereoFFTScope();
00198 
00204         virtual void scopeEvent(float *left, float *right, int len)
00205                 { (void)left; (void)right; (void)len; }
00206 
00214         void scopeData(std::vector<float> *&left, std::vector<float> *&right);
00215         virtual void timeout();
00216 
00217         virtual int bands() const;
00218         virtual void setBands(float f);
00219 
00220 private:
00221         Noatun::FFTScopeStereo *mScope;
00222         long mId;
00223 };
00224 
00225 class MonoFFTScope : public FFTScope
00226 {
00227 public:
00228         MonoFFTScope(int timeout=250, int pid=0);
00229         virtual ~MonoFFTScope();
00230 
00236         virtual void scopeEvent(float *data, int len)
00237                 { (void)data; (void)len; }
00238 
00246         void scopeData(std::vector<float> *&data);
00247 
00252         virtual void timeout();
00253 
00254         virtual int bands() const;
00255         virtual void setBands(float f);
00256 
00257 private:
00258         Noatun::FFTScope *mScope;
00259         long mId;
00260 };
00261 
00262 class Scope : public Visualization
00263 {
00264 public:
00265         Scope(int interval, int pid=0);
00266 
00270         virtual int samples() const=0;
00271 
00272         virtual void setSamples(int )=0;
00273 };
00274 
00275 class MonoScope : public Scope
00276 {
00277 public:
00278         MonoScope(int timeout=250, int pid=0);
00279         virtual ~MonoScope();
00280 
00286         virtual void scopeEvent(float *data, int len)
00287                 {(void)data; (void)len; }
00288 
00296         void scopeData(std::vector<float> *&data);
00297 
00302         virtual void timeout();
00303 
00304 
00305         virtual int samples() const;
00306         virtual void setSamples(int);
00307 
00308 private:
00309         Noatun::RawScope *mScope;
00310         long mId;
00311 };
00312 
00313 class StereoScope : public Scope
00314 {
00315 public:
00316         StereoScope(int timeout=250, int pid=0);
00317         virtual ~StereoScope();
00318 
00324         virtual void scopeEvent(float *left, float *right, int len)
00325                 { (void)left; (void)right; (void)len; }
00326 
00334         void scopeData(std::vector<float> *&left, std::vector<float> *&right);
00335 
00340         virtual void timeout();
00341 
00342 
00343         virtual int samples() const;
00344         virtual void setSamples(int);
00345 
00346 
00347 private:
00348         Noatun::RawScopeStereo *mScope;
00349         long mId;
00350 };
00351 
00352 class SessionManagement : public Plugin
00353 {
00354 public:
00355         SessionManagement();
00356         virtual ~SessionManagement();
00357 
00358         virtual void restore();
00359 };
00360 
00361 class NoatunListenerNotif;
00362 
00363 class NoatunListener : public QObject
00364 {
00365 Q_OBJECT
00366 friend class NoatunListenerNotif;
00367 
00368 public:
00369         NoatunListener(QObject *parent=0);
00370         virtual ~NoatunListener();
00371 
00372 signals:
00373         void event();
00374 
00375 protected:
00376         virtual void message();
00377 
00378         NoatunListenerNotif *mNotif;
00379 };
00380 
00387 class ExitNotifier : public NoatunListener
00388 {
00389 public:
00390         ExitNotifier(int pid, QObject *parent=0);
00391         virtual ~ExitNotifier();
00392 
00393 private:
00394         QCString appid;
00395 };
00396 
00402 class BoolNotifier : public QObject
00403 {
00404 Q_OBJECT
00405 public:
00406         BoolNotifier(bool *value, NoatunListener *listener, QObject *parent=0);
00407 
00408 private slots:
00409         void event() {*mValue=false;}
00410 
00411 private:
00412         bool *mValue;
00413 };
00414 
00415 #endif
00416 
KDE Logo
This file is part of the documentation for Noatun 2.6.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 22 00:20:36 2004 by doxygen 1.3.8-20040913 written by Dimitri van Heesch, © 1997-2003