forked from Greedysky/QtSpek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspek-spectrogram.h
60 lines (48 loc) · 1.17 KB
/
spek-spectrogram.h
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
#ifndef SPEKSPECTROGRAM_H
#define SPEKSPECTROGRAM_H
#include <memory>
#include <QWidget>
#include "spek-palette.h"
#include "spek-pipeline.h"
class Audio;
class FFT;
class SpekHaveSampleEvent;
struct spek_pipeline;
class SpekSpectrogram : public QWidget
{
public:
SpekSpectrogram(QWidget *parent = 0);
~SpekSpectrogram();
void open(const QString& path);
void start();
void stop();
inline QImage *getPaintImage() { return ℑ }
inline int getURange() const { return urange; }
inline int getLRange() const { return lrange; }
Palette getPalette() const { return palette; }
private:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
void paint(QPainter *dc);
void create_palette();
std::unique_ptr<Audio> audio;
std::unique_ptr<FFT> fft;
spek_pipeline *pipeline;
int streams;
int stream;
int channels;
int channel;
enum window_function window_function;
QString path;
QString desc;
double duration;
int sample_rate;
Palette palette;
QImage palette_image;
QImage image;
int prev_width;
int fft_bits;
int urange;
int lrange;
};
#endif