Noatun API Documentation

equalizer.h

Go to the documentation of this file.
00001 #ifndef NOATUN_EQUALIZER_H
00002 #define NOATUN_EQUALIZER_H
00003 
00004 #include <qptrlist.h>
00005 #include <qobject.h>
00006 #include <kurl.h>
00007 #include <noatun/vequalizer.h>
00008 
00009 class Engine;
00010 class Equalizer;
00011 
00019 class Preset
00020 {
00021 friend class Equalizer;
00022 
00023         Preset(const QString &file);
00024         Preset();
00025         Preset(VPreset p);
00026 
00027 public:
00028         QString name() const;
00029         bool setName(const QString &name);
00030         bool save() const;
00031         bool load();
00032 
00033         void remove();
00034 
00035         QString file() const;
00036 
00037         VPreset &vpreset() const;
00038 private:
00039         QString mFile;
00040 };
00041 
00049 class Band
00050 {
00051 friend class Equalizer;
00052 friend class QPtrList<Band>;
00053 
00054 private:
00055         Band();
00056         Band(int start, int end);
00057         Band(int band);
00058         virtual ~Band();
00059 public:
00067         int level();
00068         void setLevel(int l);
00069 
00070         int start() const;
00071         int end() const;
00072 
00076         int center() const;
00077 
00078         QString formatStart(bool withHz=true) const;
00079         QString formatEnd(bool withHz=true) const;
00083         QString format(bool withHz=true) const;
00084 
00085 private:
00086         int mOffset;
00087         int mNum, mEnd;
00088 };
00089 
00090 
00102 class Equalizer : public QObject
00103 {
00104 friend class Band;
00105 friend class Preset;
00106 friend class Engine;
00107 
00108 Q_OBJECT
00109 public:
00110         Equalizer();
00111         ~Equalizer();
00112 
00113         const QPtrList<Band> &bands() const;
00114         Band *band(int num) const;
00115         int bandCount() const;
00116 
00117         int preamp() const;
00118         bool isEnabled() const;
00119 
00120         void init();
00121 
00122 public slots:
00130         void setPreamp(int p);
00131         void enable();
00132         void disable();
00133         void setEnabled(bool e);
00134 
00135 
00136 public:
00137 // saving eq stuff
00144         bool save(const KURL &file, const QString &friendly) const;
00145 
00149         bool load(const KURL &file);
00150 
00157         QString toString(const QString &name="stored") const;
00158 
00164         bool fromString(const QString &str);
00165 
00174         Preset *createPreset(const QString &name, bool smart=true);
00175 
00180         QPtrList<Preset> presets() const;
00181 
00182         Preset *preset(const QString &file);
00183         bool presetExists(const QString &name) const;
00184 
00185 signals:
00186         void changed(Band *band);
00187         void changed();
00188         void enabled();
00189         void disabled();
00190         void enabled(bool e);
00191 
00192         void preampChanged(int p);
00193         void preampChanged();
00194 
00199         void changed(Preset *);
00200 
00204         void created(Preset*);
00205 
00209         void renamed(Preset *);
00210 
00214         void removed(Preset *);
00215 
00216 private slots:
00217         void created(VPreset preset);
00218         void selected(VPreset preset);
00219         void renamed(VPreset preset);
00220         void removed(VPreset preset);
00221 
00222 private:
00223         void add(Band*);
00224         void remove(Band*);
00225         // apply the data to artsd
00226         void enableUpdates(bool on=true);
00227         void update(bool full=false);
00228 
00229 private:
00230         QPtrList<Band> mBands;
00231         bool mUpdates;
00232         int mPreamp;
00233 };
00234 
00235 
00236 
00237 #endif
00238 
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