Clementine-audio-player-Mac.../src/analyzers/analyzerbase.h

59 lines
1.1 KiB
C
Raw Normal View History

2009-12-24 20:16:07 +01:00
// Maintainer: Max Howell <max.howell@methylblue.com>, (C) 2004
// Copyright: See COPYING file that comes with this distribution
#ifndef ANALYZERBASE_H
#define ANALYZERBASE_H
#ifdef __FreeBSD__
#include <sys/types.h>
#endif
#include "engines/engine_fwd.h"
2009-12-24 20:16:07 +01:00
#include <QPixmap> //stack allocated and convenience
#include <QBasicTimer> //stack allocated
2009-12-24 20:16:07 +01:00
#include <QWidget> //baseclass
class QEvent;
class QPaintEvent;
class QResizeEvent;
namespace Analyzer {
typedef QVector<float> Scope;
2009-12-24 20:16:07 +01:00
class Base : public QWidget
{
Q_OBJECT
public slots:
void set_engine(Engine::Base* engine);
void SpectrumAvailable(const QVector<float>& spectrum);
2009-12-24 20:16:07 +01:00
protected:
Base(QWidget* parent);
2009-12-24 20:16:07 +01:00
void paintEvent( QPaintEvent* );
void polishEvent();
virtual void init() {}
virtual void analyze(QPainter& p, const Scope&) = 0;
2009-12-24 20:16:07 +01:00
virtual void paused(QPainter& p);
virtual void demo(QPainter& p);
protected:
EngineBase* m_engine;
Scope m_lastScope;
};
void interpolate( const Scope&, Scope& );
void initSin( Scope&, const uint = 6000 );
} //END namespace Analyzer
using Analyzer::Scope;
#endif