PlayerFlat
 Tudo Classes Funções
spectrograph.h
1 #ifndef SPECTROGRAPH_H
2 #define SPECTROGRAPH_H
3 #include "abstractspectrograph.h"
4 
5 #include <QWidget>
6 #include <QPainter>
7 #include <QPen>
8 #include <QBrush>
9 #include <QAudioBuffer>
10 #include <complex>
11 #include <QVector>
12 #include <QDebug>
13 #include <QTimer>
14 #include <QGradient>
15 
16 // the maximum number of bands
17 #define BAND_MAX 128
18 
19 // width of the bar to be displayed
20 #define MIN_BARWIDTH 30
21 
22 // spectrograph class is used to display fourier spectrum
23 // bars
25  Q_OBJECT
26 public:
27  explicit Spectrograph(QWidget *parent = 0);
28 
29 signals:
30 
31 public slots:
34  void paintEvent(QPaintEvent *e);
37  void loadSamples(QVector<double> &_spectrum);
41  void timerEvent(QTimerEvent *e);
45  void resizeEvent(QResizeEvent *e);
48  void loadLevels(double left, double right);
49 private:
56  QVector<int> spectrum, delay;
57 
58  int leftLevel, rightLevel;
59  int decayIncr;
60  int NUM_BANDS;
61  QLinearGradient gradient;
62  QBrush gradientBrush, backgroundBrush,
63  transparentBrush, decayBrush;
64  QPen pen;
65  float barSpacing, barWidth, widgetHeight;
66  double max;
67  double time;
68 };
69 
70 #endif // SPECTROGRAM_H
void paintEvent(QPaintEvent *e)
Definition: spectrograph.cpp:68
void loadLevels(double left, double right)
Definition: spectrograph.cpp:61
Definition: spectrograph.h:24
void resizeEvent(QResizeEvent *e)
Definition: spectrograph.cpp:39
Definition: abstractspectrograph.h:8
void loadSamples(QVector< double > &_spectrum)
Definition: spectrograph.cpp:113
void timerEvent(QTimerEvent *e)
Definition: spectrograph.cpp:97