Diffstat (limited to 'noncore/multimedia/opierec/waveform.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opierec/waveform.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/noncore/multimedia/opierec/waveform.h b/noncore/multimedia/opierec/waveform.h new file mode 100644 index 0000000..b9a4c70 --- a/dev/null +++ b/noncore/multimedia/opierec/waveform.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef WAVEFORM_H | ||
21 | #define WAVEFORM_H | ||
22 | |||
23 | #include <qwidget.h> | ||
24 | #include <qpixmap.h> | ||
25 | |||
26 | |||
27 | class QLabel; | ||
28 | |||
29 | |||
30 | class Waveform : public QWidget | ||
31 | { | ||
32 | public: | ||
33 | Waveform( QWidget *parent=0, const char *name=0, WFlags fl=0 ); | ||
34 | ~Waveform(); | ||
35 | |||
36 | public: | ||
37 | void changeSettings( int frequency, int channels ); | ||
38 | void reset(); | ||
39 | void newSamples( const short *buf, int len ); | ||
40 | |||
41 | private: | ||
42 | |||
43 | void makePixmap(); | ||
44 | void draw(); | ||
45 | |||
46 | protected: | ||
47 | |||
48 | void paintEvent( QPaintEvent *event ); | ||
49 | |||
50 | private: | ||
51 | int samplesPerPixel; | ||
52 | int currentValue; | ||
53 | int numSamples; | ||
54 | short *window; | ||
55 | int windowPosn; | ||
56 | int windowSize; | ||
57 | QPixmap *pixmap; | ||
58 | |||
59 | }; | ||
60 | |||
61 | |||
62 | #endif | ||
63 | |||