This repository was archived by the owner on May 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspectrograph.h.ok
More file actions
70 lines (57 loc) · 1.46 KB
/
spectrograph.h.ok
File metadata and controls
70 lines (57 loc) · 1.46 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef SPECTROGRAPH_H
#define SPECTROGRAPH_H
#include "abstractspectrograph.h"
#include <QWidget>
#include <QPainter>
#include <QBrush>
#include <QColor>
#include <QMouseEvent>
#include <QVector>
#include <QDebug>
#include <QTimer>
#include <QAction>
using namespace std;
#define NUM_BANDS 60
class Spectrograph : public AbstractSpectrograph
{
Q_OBJECT
public:
// see description in spectrograph.cpp
explicit Spectrograph(QWidget *parent = 0);
~Spectrograph();
signals:
protected:
void paintEvent(QPaintEvent *e);
void resizeEvent(QResizeEvent *e);
void contextMenuEvent(QContextMenuEvent *e);
void timerEvent(QTimerEvent *e);
protected slots:
void selectBarColor(void);
void selectBackColor(void);
void selectRandColor(void);
void selectStyleBar(void);
void selectSuavity(void);
//void forma (void);
public slots:
void loadSamples(QVector<double> &_spectrum);
void loadLevels(double left, double right);
private:
// stores the fft spectrum to be displayed
QVector<double> spectrum;
// left and right mean audio levels
double leftLevel, rightLevel;
// brushes for background and bars
QBrush backgroundBrush, barBrush,barStyleBrush;
// bar color
QColor barColor;
QColor backColor;
// color action to activate context menu
QAction *colorAction;
QAction *colorBack;
QAction *colorRandom;
QAction *styleBar;
QAction *suavity_onoff;
// some variables
float barSpacing, barWidth, myHeight;
};
#endif // SPECTROGRAM_H