Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index 4b82a91..95f5322 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h | |||
@@ -1,71 +1,70 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef AUDIO_WIDGET_H | 20 | #ifndef AUDIO_WIDGET_H |
21 | #define AUDIO_WIDGET_H | 21 | #define AUDIO_WIDGET_H |
22 | 22 | ||
23 | |||
24 | #include <qwidget.h> | 23 | #include <qwidget.h> |
25 | #include <qpainter.h> | 24 | #include <qpainter.h> |
26 | #include <qdrawutil.h> | 25 | #include <qdrawutil.h> |
27 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
28 | #include <qstring.h> | 27 | #include <qstring.h> |
29 | #include <qslider.h> | 28 | #include <qslider.h> |
30 | #include <qframe.h> | 29 | #include <qframe.h> |
31 | 30 | ||
32 | 31 | ||
33 | class QPixmap; | 32 | class QPixmap; |
34 | 33 | ||
35 | 34 | ||
36 | enum AudioButtons { | 35 | enum AudioButtons { |
37 | AudioPlay, | 36 | AudioPlay, |
38 | AudioStop, | 37 | AudioStop, |
39 | AudioPause, | 38 | AudioPause, |
40 | AudioNext, | 39 | AudioNext, |
41 | AudioPrevious, | 40 | AudioPrevious, |
42 | AudioVolumeUp, | 41 | AudioVolumeUp, |
43 | AudioVolumeDown, | 42 | AudioVolumeDown, |
44 | AudioLoop, | 43 | AudioLoop, |
45 | AudioPlayList | 44 | AudioPlayList |
46 | }; | 45 | }; |
47 | 46 | ||
48 | 47 | ||
49 | #define USE_DBLBUF | 48 | #define USE_DBLBUF |
50 | 49 | ||
51 | 50 | ||
52 | class Ticker : public QFrame { | 51 | class Ticker : public QFrame { |
53 | Q_OBJECT | 52 | Q_OBJECT |
54 | public: | 53 | public: |
55 | Ticker( QWidget* parent=0 ) : QFrame( parent ) { | 54 | Ticker( QWidget* parent=0 ) : QFrame( parent ) { |
56 | setFrameStyle( WinPanel | Sunken ); | 55 | setFrameStyle( WinPanel | Sunken ); |
57 | setText( "No Song" ); | 56 | setText( "No Song" ); |
58 | } | 57 | } |
59 | ~Ticker() { } | 58 | ~Ticker() { } |
60 | void setText( const QString& text ) { | 59 | void setText( const QString& text ) { |
61 | pos = 0; // reset it everytime the text is changed | 60 | pos = 0; // reset it everytime the text is changed |
62 | scrollText = text; | 61 | scrollText = text; |
63 | pixelLen = fontMetrics().width( scrollText ); | 62 | pixelLen = fontMetrics().width( scrollText ); |
64 | killTimers(); | 63 | killTimers(); |
65 | if ( pixelLen > width() ) | 64 | if ( pixelLen > width() ) |
66 | startTimer( 50 ); | 65 | startTimer( 50 ); |
67 | update(); | 66 | update(); |
68 | } | 67 | } |
69 | protected: | 68 | protected: |
70 | void timerEvent( QTimerEvent * ) { | 69 | void timerEvent( QTimerEvent * ) { |
71 | pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; | 70 | pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; |