summaryrefslogtreecommitdiffstats
path: root/amarok/src/equalizersetup.h
blob: 03ed492e37d9fd45e6190b421fc3891f54230169 (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
/***************************************************************************
 Setup dialog for the equalizer

 (c) 2004 Mark Kretschmann <markey@web.de>
 (c) 2005 Seb Ruiz <me@sebruiz.net>
 (c) 2005 Markus Brueffer <markus@brueffer.de>
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef AMAROK_EQUALIZERSETUP_H
#define AMAROK_EQUALIZERSETUP_H

#include <tqptrlist.h>           //stack alloc
#include <kdialogbase.h>

class EqualizerGraph;
class TQGroupBox;
class TQCheckBox;
class KComboBox;
class TDEPopupMenu;

namespace Amarok { class Slider; }


class EqualizerSetup : public KDialogBase
{
    Q_OBJECT
  

    public:
        static EqualizerSetup* instance() { return s_instance ? s_instance : new EqualizerSetup(); }
        static bool isInstantiated() { return s_instance ? true : false; }

        EqualizerSetup();
       ~EqualizerSetup();

        // for use by DCOP
        void setActive( bool active );
        void setBands( int preamp, TQValueList<int> gains );
        void setPreset( TQString name );

    private slots:
        void presetChanged( int id );
        void presetChanged( TQString title );
        void sliderChanged();
        void setEqualizerEnabled( bool );
        void setEqualizerParameters();
        void editPresets();
        void addPreset();

    private:
        static EqualizerSetup* s_instance;

        void    loadPresets();
        void    savePresets();
        void    updatePresets(TQString selectTitle = TQString());
        TQString presetsCache() const;

        Amarok::Slider* m_slider_preamp;
        EqualizerGraph* m_equalizerGraph;
        TQPtrList<Amarok::Slider> m_bandSliders;

        TQGroupBox*      m_groupBoxSliders;
        KComboBox*      m_presetCombo;
        uint            m_manualPos;

        TQMap< TQString, TQValueList<int> > m_presets;
};

#endif /*AMAROK_EQUALIZERSETUP_H*/