summaryrefslogtreecommitdiffstats
path: root/noatun/modules/kjofol-skin/kjvis.h
blob: d2a43700477ae2d9c37a682f07dfd6f545dc28c7 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef KJVIS_H
#define KJVIS_H

#include "kjwidget.h"
class KJLoader;
class KPixmap;

class KJVisScope : public KJWidget
{
public:
	KJVisScope(KJLoader *parent) : KJWidget(parent) {};
	enum Visuals { Null=0, FFT, Mono, StereoFFT };
	void swapScope(Visuals newOne);
//	virtual void readConfig();
};


// dummy-scope displaying nothing
class KJNullScope : public KJVisScope
{
public:
	KJNullScope(const QStringList &, KJLoader *parent);
	virtual void paint(QPainter *p, const QRect &);
	virtual bool mousePress(const QPoint&);
	virtual void mouseRelease(const QPoint &, bool in);
	virtual void readConfig(void);

private:
	KPixmap *mBack;

};


// analyzer-like scope
class KJFFT : public KJVisScope, public MonoFFTScope
{
public:
	KJFFT(const QStringList &, KJLoader *parent);
	virtual void paint(QPainter *p, const QRect &);
	virtual void scopeEvent(float *d, int size);

	virtual bool mousePress(const QPoint&);
	virtual void mouseRelease(const QPoint &, bool in);
	virtual void readConfig(void);

private:
	QColor mColor;
	KPixmap *mGradient;
	KPixmap *mBack;
	KPixmap *mAnalyzer;
	int mMultiples;
	int mTimerValue;
};


// analyzer-like scope, stereo version
class KJStereoFFT : public KJVisScope, public StereoFFTScope
{
public:
	KJStereoFFT(const QStringList &, KJLoader *parent);
	virtual void paint(QPainter *p, const QRect &);
	virtual void scopeEvent(float *left, float *right, int len);

	virtual bool mousePress(const QPoint&);
	virtual void mouseRelease(const QPoint &, bool in);
	virtual void readConfig(void);

private:
	QColor mColor;
	KPixmap *mGradient;
	KPixmap *mBack;
	KPixmap *mAnalyzer;
	int mMultiples;
	int mTimerValue;
};


// oscilloscope showing waveform
class KJScope : public KJVisScope, public MonoScope
{
public:
	KJScope ( const QStringList &, KJLoader *parent);
	virtual void paint(QPainter *p, const QRect &);
	virtual void scopeEvent(float *d, int size);

	virtual bool mousePress(const QPoint&);
	virtual void mouseRelease(const QPoint &, bool in);
	virtual void readConfig(void);

private:
	QColor mColor;
	KPixmap *mGradient;
	KPixmap *mBack;
	KPixmap *mOsci;
	int mMultiples;
	int mWidth;
	int mHeight;
	unsigned int blurnum;
	int mTimerValue;
};

#endif