summaryrefslogtreecommitdiffstats
path: root/noatun/modules/kjofol-skin/kjvis.h
blob: 9f8bec4dcaf7a5f6e51f5c026f1bc4514c6babb4 (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 *tqparent) : KJWidget(tqparent) {};
	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 TQStringList &, KJLoader *tqparent);
	virtual void paint(TQPainter *p, const TQRect &);
	virtual bool mousePress(const TQPoint&);
	virtual void mouseRelease(const TQPoint &, bool in);
	virtual void readConfig(void);

private:
	KPixmap *mBack;

};


// analyzer-like scope
class KJFFT : public KJVisScope, public MonoFFTScope
{
public:
	KJFFT(const TQStringList &, KJLoader *tqparent);
	virtual void paint(TQPainter *p, const TQRect &);
	virtual void scopeEvent(float *d, int size);

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

private:
	TQColor 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 TQStringList &, KJLoader *tqparent);
	virtual void paint(TQPainter *p, const TQRect &);
	virtual void scopeEvent(float *left, float *right, int len);

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

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


// oscilloscope showing waveform
class KJScope : public KJVisScope, public MonoScope
{
public:
	KJScope ( const TQStringList &, KJLoader *tqparent);
	virtual void paint(TQPainter *p, const TQRect &);
	virtual void scopeEvent(float *d, int size);

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

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

#endif