~ubuntu-branches/ubuntu/breezy/kdemultimedia/breezy

« back to all changes in this revision

Viewing changes to noatun/noatun/library/effects.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-03-24 04:48:58 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050324044858-8ff88o9jxej6ii3d
Tags: 4:3.4.0-0ubuntu3
Add kubuntu_02_hide_arts_menu_entries.diff to hide artsbuilder and artscontrol k-menu entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef EFFECTS_H
2
 
#define EFFECTS_H
3
 
 
4
 
#include <qlist.h>
5
 
#include <qcstring.h>
6
 
#include <qstrlist.h>
7
 
#include <qobject.h>
8
 
 
9
 
namespace Arts { class StereoEffect; }
10
 
class Engine;
11
 
class EffectConfigWidget;
12
 
 
13
 
/**
14
 
 * new Effect("Arts::SomeEffect");
15
 
 * then you can add,insert,bleh it with class Effects
16
 
 **/
17
 
class Effect
18
 
{
19
 
friend class Effects;
20
 
friend class EffectConfigWidget;
21
 
public:
22
 
        Effect(const char *name);
23
 
        ~Effect();
24
 
 
25
 
        /**
26
 
         * return the effect processed
27
 
         * directly before this one
28
 
         **/
29
 
        Effect *before() const;
30
 
        /**
31
 
         * return the effect processed
32
 
         * directly after this one
33
 
         **/
34
 
        Effect *after() const;
35
 
        long id() const;
36
 
 
37
 
        /**
38
 
         * get the Arts object.
39
 
         * @internal
40
 
         **/
41
 
        Arts::StereoEffect *effect() const;
42
 
 
43
 
        /**
44
 
         * Get the name of the object.
45
 
         **/
46
 
        QCString name() const;
47
 
        
48
 
        /**
49
 
         * get the "clean" title of effect
50
 
         **/
51
 
        QString title() const;
52
 
 
53
 
        /**
54
 
         * is this effect name invalid? e.g., will it segfault
55
 
         * if you StereoEffect::start() this?
56
 
         **/
57
 
        bool isNull() const;
58
 
 
59
 
        /**
60
 
         * show the configure dialog box for
61
 
         * this effect.  if friendly is true, 
62
 
         * then create a top-level window,
63
 
         * set an icon and make it purdy. Otherwise
64
 
         * create a plan widget that you can reparent.
65
 
         **/
66
 
        QWidget *configure(bool friendly=true);
67
 
 
68
 
        /**
69
 
         * Does this widget have a configurable
70
 
         * dialog box.  E.g., will configure
71
 
         * return null?
72
 
         **/
73
 
        bool configurable() const;
74
 
 
75
 
        /**
76
 
         * turn Arts::FREEVERB into just FREEVERB
77
 
         **/
78
 
        static QString clean(const QCString &name);
79
 
private:
80
 
        long mId;
81
 
        Arts::StereoEffect *mEffect;
82
 
        QCString mName;
83
 
        QWidget *mConfig;
84
 
};
85
 
 
86
 
class Effects : public QObject
87
 
{
88
 
Q_OBJECT
89
 
friend class Effect;
90
 
public:
91
 
        Effects();
92
 
 
93
 
        bool insert(const Effect *after, Effect *item);
94
 
 
95
 
        /**
96
 
         * create the Effect, by getting the proper item
97
 
         * from the list, then append it here.
98
 
         *
99
 
         * for example, append(new Effect(available()[0]));
100
 
         **/
101
 
        bool append(Effect *item);
102
 
 
103
 
        /**
104
 
         * reorder the effect stack.  if after is null,
105
 
         * it'l be first
106
 
         **/
107
 
        void move(const Effect *after, Effect *item);
108
 
        /**
109
 
         * remove @param item from the effect stack, but
110
 
         * don't deallocate it unless del is true (default true)
111
 
         **/
112
 
        void remove(Effect *item, bool del=true);
113
 
        /**
114
 
         * @r remove() all items from the effect stack
115
 
         * only delete them if del is true (default true)
116
 
         **/
117
 
        void removeAll(bool del=true);
118
 
 
119
 
        /**
120
 
         * a list of all available effects, by name
121
 
         * each of these can be given to the first
122
 
         * argument of the Effect constructor
123
 
         **/
124
 
        QStrList available() const;
125
 
 
126
 
        QList<Effect> effects() const;
127
 
 
128
 
        /**
129
 
         * Get the Effect that has the following id
130
 
         **/
131
 
        Effect *findId(long id) const;
132
 
 
133
 
private:
134
 
        QListIterator<Effect> stackPosition() const;
135
 
        
136
 
signals:
137
 
        /**
138
 
         * called when @param effect has been
139
 
         * added to the effect stack
140
 
         **/
141
 
        void added(Effect *effect);
142
 
        /**
143
 
         * called when @param effect has been
144
 
         * removed from the effect stack
145
 
         **/
146
 
        void removed(Effect *effect);
147
 
        /**
148
 
         * called when @param effect has been moved
149
 
         **/
150
 
        void moved(Effect *effect);
151
 
        /**
152
 
         * callsed when @p effect is about to be
153
 
         * deleted (from memory)
154
 
         **/
155
 
        void deleting(Effect *effect);
156
 
 
157
 
private:
158
 
        // stored in no specific order
159
 
        QList<Effect> mItems;
160
 
};
161
 
 
162
 
 
163
 
 
164
 
#endif
165