1
/******************************************************************************
2
 * Setup dialog for the equalizer                                             *    
3
 *                                                                            *
4
 * Copyright (C) 2004 Mark Kretschmann <kretschmann@kde.org>                  *
5
 *           (C) 2005 Seb Ruiz <ruiz@kde.org>                                 *
6
 *           (C) 2005 Markus Brueffer <markus@brueffer.de>                    *
7
 *                                                                            *
8
 * This program is free software; you can redistribute it and/or              *
9
 * modify it under the terms of the GNU General Public License as             *
10
 * published by the Free Software Foundation; either version 2 of             *
11
 * the License, or (at your option) any later version.                        *
12
 *                                                                            *
13
 * This program is distributed in the hope that it will be useful,            *
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
16
 * GNU General Public License for more details.                               *
17
 *                                                                            *
18
 * You should have received a copy of the GNU General Public License          *
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
20
 ******************************************************************************/
21
22
#ifndef AMAROK_EQUALIZERSETUP_H
23
#define AMAROK_EQUALIZERSETUP_H
24
25
#include <kdialog.h>
26
27
#include <QList>           //stack alloc
28
29
30
class EqualizerGraph;
31
class KComboBox;
32
class QGroupBox;
33
34
namespace Amarok { class Slider; }
35
36
37
class EqualizerSetup : public KDialog
38
{
39
    Q_OBJECT
40
41
    public:
42
        static EqualizerSetup* instance() { return s_instance ? s_instance : new EqualizerSetup(); }
43
        static bool isInstantiated() { return s_instance ? true : false; }
44
45
        EqualizerSetup();
46
       ~EqualizerSetup();
47
48
        // for use by DCOP
49
        void setActive( bool active );
50
        void setBands( int preamp, QList<int> gains );
51
        void setPreset( QString name );
52
53
    private slots:
54
        void presetChanged( int id );
55
        void presetChanged( QString title );
56
        void sliderChanged();
57
        void setEqualizerEnabled( bool );
58
        void setEqualizerParameters();
59
        void editPresets();
60
        void addPreset();
61
62
    private:
63
        static EqualizerSetup* s_instance;
64
65
        void    loadPresets();
66
        void    savePresets();
67
        void    updatePresets(QString selectTitle = QString());
68
        QString presetsCache() const;
69
70
        Amarok::Slider* m_slider_preamp;
71
        EqualizerGraph* m_equalizerGraph;
72
        QList<Amarok::Slider*> m_bandSliders;
73
74
        QGroupBox*      m_groupBoxSliders;
75
        KComboBox*      m_presetCombo;
76
        uint            m_manualPos;
77
78
        QMap< QString, QList<int> > m_presets;
79
};
80
81
#endif /*AMAROK_EQUALIZERSETUP_H*/