1
// Author: Max Howell <max.howell@methylblue.com>, (C) 2004
2
// Maintainer: Martin Sandsmark <sandsmark@samfundet.no>, (C) 2009
3
// Copyright: See the COPYING file shipped with this distribution
12
#include "fht.h" //stack allocated and convenience
13
#include <qpixmap.h> //stack allocated and convenience
14
#include <qtimer.h> //stack allocated
15
#include <qwidget.h> //baseclass
16
#include <vector> //included for convenience
18
#include <phonon/audiodataoutput.h>
27
typedef std::vector<float> Scope;
29
class Base : public QWidget
34
void drawFrame(const QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> > &thescope);
37
Base(QWidget*, uint = 7);
38
~Base() { delete m_fht; }
40
int resizeExponent(int);
41
int resizeForBands(int);
42
virtual void transform(QVector<float>&);
43
virtual void analyze(const QVector<float>&) = 0;
44
virtual void paused();
51
class Base2D : public Base
55
const QPixmap *canvas() const { return &m_canvas; }
58
// void draw() { drawFrame(); bitBlt( this, 0, 0, canvas() ); }
61
Base2D( QWidget*, uint scopeSize = 7);
64
QPixmap *canvas() { return &m_canvas; }
65
void eraseCanvas() { m_canvas.fill(Qt::transparent); }
67
void paintEvent( QPaintEvent* );
68
void resizeEvent( QResizeEvent* );
71
virtual void init() {}
79
//Currently this is a rather small class, its only purpose
80
//to ensure that making changes to analyzers will not require
81
//rebuilding the world!
83
//eventually it would be better to make analyzers pluggable
84
//but I can't be arsed, nor can I see much reason to do so
87
static QWidget* createAnalyzer(QWidget*);
88
static QWidget* createPlaylistAnalyzer(QWidget *);
92
void interpolate(const QVector<float>&, QVector<float>&);
93
void initSin(QVector<float>&, const uint = 6000);
95
} //END namespace Analyzer
97
using Analyzer::Scope;