diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmp/decoder.h | 2 | ||||
| -rw-r--r-- | src/qmmp/decoderfactory.h | 2 | ||||
| -rw-r--r-- | src/qmmp/effect.h | 68 | ||||
| -rw-r--r-- | src/qmmp/effectfactory.h | 45 |
4 files changed, 76 insertions, 41 deletions
diff --git a/src/qmmp/decoder.h b/src/qmmp/decoder.h index a9553cf8f..c9f52d56b 100644 --- a/src/qmmp/decoder.h +++ b/src/qmmp/decoder.h @@ -170,7 +170,7 @@ public: */ static void setEnabled(DecoderFactory* factory, bool enable = TRUE); /*! - * Return \b true if input plugin is enabled, otherwise \b false + * Returns \b true if input plugin is enabled, otherwise \b false * @param factory Decoder plugin factory. */ static bool isEnabled(DecoderFactory* factory); diff --git a/src/qmmp/decoderfactory.h b/src/qmmp/decoderfactory.h index d9d83d24a..cd7345e32 100644 --- a/src/qmmp/decoderfactory.h +++ b/src/qmmp/decoderfactory.h @@ -59,7 +59,7 @@ public: bool noInput; /*!< Should be \b true if plugin has own input, otherwise \b false */ bool noOutput; /*!< Should be \b true if plugin has own output, otherwise \b false */ }; -/*! @brief Input plugin interface. +/*! @brief Input plugin interface (decoder factory). * @author Ilya Kotov <forkotov02@hotmail.ru> */ class DecoderFactory diff --git a/src/qmmp/effect.h b/src/qmmp/effect.h index 134c9eea7..477bc631d 100644 --- a/src/qmmp/effect.h +++ b/src/qmmp/effect.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007 by Ilya Kotov * + * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -24,58 +24,74 @@ #include <QList> #include <QStringList> - - - class EffectFactory; -/*! - * @author Ilya Kotov <forkotov02@hotmail.ru> + +/*! @brief The Effect class provides the base interface class of audio effects. + * @author Ilya Kotov <forkotov02@hotmail.ru> */ class Effect : public QObject { Q_OBJECT public: + /*! + * Object contsructor. + * @param parent Parent object. + */ Effect(QObject *parent = 0); - + /*! + * Destructor. + */ virtual ~Effect(); - - /*/*! + /*! * Adds effect to the input data pointer \b in_data with the size \b size. * Result is stored in the output data \b out_data. - * Return value is the size of the output data. Output data size should not be more then \b size. + * Return value is the size of the output data. * Subclass should implement this function. */ virtual ulong process(char *in_data, const ulong size, char **out_data) = 0; - - //virtual const ulong process(char *in_data, const ulong size, char *out_data) = 0; - //virtual bool process(char *in_data, char *out_data, const ulong maxsize, ulong &rbytes, ulong &wbytes) = 0; - - + /*! + * Prepares Effect object for usage. + * Subclasses that reimplement this function must call the base implementation. + * @param freq Sample rate. + * @param chan Number of channels. + * @param res Bits per sample. + */ virtual void configure(quint32 freq, int chan, int res); - /*! * Returns samplerate. - * This function should be reimplemented if subclass changes default samplerate. */ - virtual quint32 sampleRate(); - + quint32 sampleRate(); /*! * Returns channel number. - * This function should be reimplemented if subclass changes default channel number. */ - virtual int channels(); - + int channels(); /*! * Returns bit depth. - * This function should be reimplemented if subclass changes default resolution. */ - virtual int bitsPerSample(); - - + int bitsPerSample(); + /*! + * Creates list of enabled effects. + * @param parent Parent object of all created Effect objects. + */ static QList<Effect*> create(QObject *parent); + /*! + * Returns a list of effect factories. + */ static QList<EffectFactory*> *effectFactories(); + /*! + * Returns a list of effect plugin file names. + */ static QStringList effectFiles(); + /*! + * Sets whether the effect plugin is enabled. + * @param factory Effect plugin factory. + * @param enabled Plugin enable state (\b true - enable, \b false - disable) + */ static void setEnabled(EffectFactory* factory, bool enable = TRUE); + /*! + * Returns \b true if input plugin is enabled, otherwise \b false + * @param factory Effect plugin factory. + */ static bool isEnabled(EffectFactory* factory); private: diff --git a/src/qmmp/effectfactory.h b/src/qmmp/effectfactory.h index 208990cb4..883815c02 100644 --- a/src/qmmp/effectfactory.h +++ b/src/qmmp/effectfactory.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007 by Ilya Kotov * + * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -22,40 +22,59 @@ #include <QObject> -/** - @author Ilya Kotov <forkotov02@hotmail.ru> -*/ class QObject; class QWidget; class QTranslator; - class Effect; -/*! - * @author Ilya Kotov <forkotov02@hotmail.ru> + +/*! @brief Helper class to store effect plugin properies. + * @author Ilya Kotov <forkotov02@hotmail.ru> */ class EffectProperties { public: + /*! + * Constructor + */ EffectProperties() { hasAbout = FALSE; hasSettings = FALSE; } - QString name; - QString shortName; - bool hasAbout; - bool hasSettings; + QString name; /*!< Effect plugin full name */ + QString shortName; /*!< Effect plugin short name for internal usage */ + bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise \b false */ + bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise \b false */ }; -/*! - * @author Ilya Kotov <forkotov02@hotmail.ru> +/*! @brief Effect plugin interface (effect factory). + * @author Ilya Kotov <forkotov02@hotmail.ru> */ class EffectFactory { public: + /*! + * Returns general plugin properties. + */ virtual const EffectProperties properties() const = 0; + /*! + * Creates Effect object. + * @param parent Parent object. + */ virtual Effect *create(QObject *parent) = 0; + /*! + * Shows about dialog. + * @param parent Parent widget. + */ virtual void showSettings(QWidget *parent) = 0; + /*! + * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. + * @param parent Parent object. + */ virtual void showAbout(QWidget *parent) = 0; + /*! + * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. + * @param parent Parent object. + */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; |
