1
/***************************************************************************
2
 *   Copyright (c) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas           *
3
 *                 Thomas Nilsson and 4Front Technologies                  *
4
 *             (c) 2004 Mark Kretschmann <markey@web.de>                   *
5
 *                                                                         *
6
 *   This program is free software; you can redistribute it and/or modify  *
7
 *   it under the terms of the GNU General Public License as published by  *
8
 *   the Free Software Foundation; either version 2 of the License, or     *
9
 *   (at your option) any later version.                                   *
10
 *                                                                         *
11
 *   This program is distributed in the hope that it will be useful,       *
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
 *   GNU General Public License for more details.                          *
15
 *                                                                         *
16
 *   You should have received a copy of the GNU General Public License     *
17
 *   along with this program; if not, write to the                         *
18
 *   Free Software Foundation, Inc.,                                       *
19
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
20
 ***************************************************************************/
21
22
#ifndef AMAROK_EQUALIZERGRAPH_H
23
#define AMAROK_EQUALIZERGRAPH_H
24
25
#include <QtGui/QWidget>     //baseclass
26
27
class QPaintEvent;
28
class QPixmap;
29
class QResizeEvent;
30
31
32
class EqualizerGraph : public QWidget
33
{
34
    public:
35
        EqualizerGraph( QWidget* parent );
36
        ~EqualizerGraph();
37
        QSize sizeHint() const;
38
39
    protected:
40
        void resizeEvent( QResizeEvent* );
41
        void paintEvent( QPaintEvent* );
42
43
    private:
44
        static const int NUM_BANDS = 10;
45
46
        void drawBackground();
47
48
        void init_spline( float* x, float* y, int n, float* y2 );
49
        float eval_spline( float xa[], float ya[], float y2a[], int n, float x );
50
51
        QPixmap* m_backgroundPixmap;
52
};
53
54
55
#endif /*AMAROK_EQUALIZERGRAPH_H*/