summaryrefslogtreecommitdiffstats
path: root/ksayit/src/ksayit_fxplugin.h
blob: 211ca36cdae589d99719513af80464b21f642b6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// C++ Interface: fxplugin
//
// Description: 
//
//
// Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef FXPLUGIN_H
#define FXPLUGIN_H

// QT includes
#include <tqobject.h>
#include <tqstring.h>

// KDE includes
#include <kapplication.h>
#include <arts/kartsserver.h>
#include <arts/artsflow.h>

using namespace Arts;

// App specific includes

/** FXPlugin is an abstract class to create effect plugins for KSayIt.
 *  If you would like to implement a plugin, simply make a class
 *  derived from FXPlugin, include 'ksayit_fxplugin.h' and reimplement all the
 *  pure virtual functions provided herein.
 *  *Appl is a pointer to the main application as delivered by \p KApplication::kApplication().
 *  It can be used for any reason i.e. to install a TQt translator.\n
 \author Robert Vogl
 */
class FXPlugin : public TQObject
{
// Q_OBJECT
  TQ_OBJECT
public:
    FXPlugin(TQObject *tqparent=0, const char* name=0){};
       
    /** Sets the Main application object. Useful for config objects etc.
     */
    virtual void setApplication(KApplication *Appl) = 0;
    
    /** Returns the name of the plugin. This name is the unique identifier
     *  for the plugin. A expressive name is recommended because this name
     *  may be shown to the user, i.e. in a configuration dialog.
     *  The PluginHandler internally references to each effect plugin by this name.\n
     *  Has to be reimplemented by the plugin implementation.
     */
    virtual TQString getName_KS() const = 0;
    
    /** Returns the description of the plugin.\n
     *  Has to be reimplemented by the plugin implementation.
     */
    virtual TQString getDescription_KS() const = 0;
    
    /** Shows the GUI to configure the plugin. The configuration can to be
     *  stored in the global configuration file of KSayIt.\n
     *  Has to be reimplemented by the plugin implementation.
     */
    virtual bool showGUI_KS() = 0;
    
    /** Activates the effect i.e. puts it on the soundservers stack.\n
     *  Returns the ID of the activated effect.
     *  Has to be reimplemented by the plugin implementation.
    \param server A pointer to the aRts soundserver instance.
    \param fx_stack A pointer to the effect stack of the soundserver.
     */ 
    virtual long activate_KS(KArtsServer *server,
                             StereoEffectStack *fx_stack) const = 0;

    /** Deactivates the effect i.e. removes it from the effect stack.\n
     *  Has to be reimplemented by the plugin implementation.
    \param fx_stack A pointer to the effect stack of the soundserver.
    \param EffectID The ID of the effect as returned by \p activate_KS().
     */
    virtual bool deactivate_KS(StereoEffectStack *fx_stack,
                               long EffectID) const = 0;

};



#endif