2 // C++ Interface: fxplugin
7 // Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2004
9 // Copyright: See COPYING file that comes with this distribution
17 #include <QtCore/QObject>
20 #include <arts/kartsserver.h>
21 #include <arts/artsflow.h>
25 // App specific includes
27 /** FXPlugin is an abstract class to create effect plugins for KSayIt.
28 * If you would like to implement a plugin, simply make a class
29 * derived from FXPlugin, include 'fxplugin.h' and reimplement all the
30 * pure virtual functions provided herein.
31 * In addition you must implement two class factories.\n
32 * \p createPlugin(KApplication *Appl) returns a pointer to an instance of your plugin.
33 * *Appl is a pointer to the main application as delivered by \p KApplication::kApplication().
34 * It can be used for any reason i.e. to install a Qt translator.\n
35 * \p destroyPlugin() takes this pointer to destroy an instance of your plugin.\n
40 FXPlugin* createPlugin(KApplication *Appl)
42 return new MyNewPlugin(Appl);
45 void destroyPlugin(FXPlugin* p)
57 virtual ~FXPlugin(){};
58 /** Returns the name of the plugin. This name is the unique identifier
59 * for the plugin. A expressive name is recommended because this name
60 * may be shown to the user, i.e. in a configuration dialog.
61 * The PluginHandler internally references to each effect plugin by this name.\n
62 * Has to be reimplemented by the plugin implementation.
64 virtual QString
getName_KS() const = 0;
66 /** Returns the description of the plugin.\n
67 * Has to be reimplemented by the plugin implementation.
69 virtual QString
getDescription_KS() const = 0;
71 /** Shows the GUI to configure the plugin. The configuration can to be
72 * stored in the global configuration file of KSayIt.\n
73 * Has to be reimplemented by the plugin implementation.
75 virtual bool showGUI_KS() = 0;
77 /** Activates the effect i.e. puts it on the soundservers stack.\n
78 * Returns the ID of the activated effect.
79 * Has to be reimplemented by the plugin implementation.
80 \param server A pointer to the aRts soundserver instance.
81 \param fx_stack A pointer to the effect stack of the soundserver.
83 virtual long activate_KS(KArtsServer
*server
,
84 StereoEffectStack
*fx_stack
) const = 0;
86 /** Deactivates the effect i.e. removes it from the effect stack.\n
87 * Has to be reimplemented by the plugin implementation.
88 \param fx_stack A pointer to the effect stack of the soundserver.
89 \param EffectID The ID of the effect as returned by \p activate_KS().
91 virtual bool deactivate_KS(StereoEffectStack
*fx_stack
,
92 long EffectID
) const = 0;
97 // The types of the class factories
98 typedef FXPlugin
* (*create_fxpi
)(KApplication
*);
99 typedef void (*destroy_fxpi
)(FXPlugin
*);