summaryrefslogtreecommitdiffstats
path: root/amarok/src/equalizergraph.h
blob: 3a156f98d77476581f693c04f7c1be09e17e98cf (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
/***************************************************************************
 Graphical spline display for equalizer

 (c) 2004 Mark Kretschmann <markey@web.de>
 Based on code from XMMS
 (c) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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_EQUALIZERGRAPH_H
#define AMAROK_EQUALIZERGRAPH_H

#include <tqwidget.h>     //baseclass

class TQPixmap;


class EqualizerGraph : public TQWidget
{
    public:
        EqualizerGraph( TQWidget* parent );
        ~EqualizerGraph();
        TQSize sizeHint() const;

    protected:
        void resizeEvent( TQResizeEvent* );
        void paintEvent( TQPaintEvent* );

    private:
        static const int NUM_BANDS = 10;

        void drawBackground();

        void init_spline( float* x, float* y, int n, float* y2 );
        float eval_spline( float xa[], float ya[], float y2a[], int n, float x );

        TQPixmap* m_backgroundPixmap;
        TQPixmap* m_composePixmap;
};


#endif /*AMAROK_EQUALIZERGRAPH_H*/