author | llornkcor <llornkcor> | 2002-11-03 21:45:32 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-03 21:45:32 (UTC) |
commit | bf62b8f48d08f5a5e92681e1487a5f43d5c7a231 (patch) (unidiff) | |
tree | f2a02844f411d874e9afd703c18b6ebd70d97172 /core/multimedia/opieplayer/audiowidget.h | |
parent | 5ba841a12e67b326833751ea502cf054e423114d (diff) | |
download | opie-bf62b8f48d08f5a5e92681e1487a5f43d5c7a231.zip opie-bf62b8f48d08f5a5e92681e1487a5f43d5c7a231.tar.gz opie-bf62b8f48d08f5a5e92681e1487a5f43d5c7a231.tar.bz2 |
m3u stuff and op2 skins
Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 73 |
1 files changed, 20 insertions, 53 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index b3d39bf..c686741 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qbitmap.h> | ||
28 | #include <qstring.h> | 29 | #include <qstring.h> |
29 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qlineedit.h> | ||
30 | #include <qframe.h> | 32 | #include <qframe.h> |
31 | 33 | ||
34 | #include <opie/oticker.h> | ||
32 | 35 | ||
@@ -34,3 +37,2 @@ class QPixmap; | |||
34 | 37 | ||
35 | |||
36 | enum AudioButtons { | 38 | enum AudioButtons { |
@@ -48,51 +50,3 @@ enum AudioButtons { | |||
48 | 50 | ||
49 | #define USE_DBLBUF | 51 | //#define USE_DBLBUF |
50 | |||
51 | |||
52 | class Ticker : public QFrame { | ||
53 | Q_OBJECT | ||
54 | public: | ||
55 | Ticker( QWidget* parent=0 ) : QFrame( parent ) { | ||
56 | setFrameStyle( WinPanel | Sunken ); | ||
57 | setText( "No Song" ); | ||
58 | } | ||
59 | ~Ticker() { } | ||
60 | void setText( const QString& text ) { | ||
61 | pos = 0; // reset it everytime the text is changed | ||
62 | scrollText = text; | ||
63 | pixelLen = fontMetrics().width( scrollText ); | ||
64 | killTimers(); | ||
65 | if ( pixelLen > width() ) | ||
66 | startTimer( 50 ); | ||
67 | update(); | ||
68 | } | ||
69 | protected: | ||
70 | void timerEvent( QTimerEvent * ) { | ||
71 | pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; | ||
72 | #ifndef USE_DBLBUF | ||
73 | scroll( -1, 0, contentsRect() ); | ||
74 | #else | ||
75 | repaint( FALSE ); | ||
76 | #endif | ||
77 | } | ||
78 | void drawContents( QPainter *p ) { | ||
79 | #ifndef USE_DBLBUF | ||
80 | for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) | ||
81 | p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); | ||
82 | #else | ||
83 | // Double buffering code. | ||
84 | // Looks like qvfb makes it look like it flickers but I don't think it really is | ||
85 | QPixmap pm( width(), height() ); | ||
86 | pm.fill( colorGroup().base() ); | ||
87 | QPainter pmp( &pm ); | ||
88 | for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) | ||
89 | pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); | ||
90 | p->drawPixmap( 0, 0, pm ); | ||
91 | #endif | ||
92 | } | ||
93 | private: | ||
94 | QString scrollText; | ||
95 | int pos, pixelLen; | ||
96 | }; | ||
97 | |||
98 | 52 | ||
@@ -103,3 +57,3 @@ public: | |||
103 | ~AudioWidget(); | 57 | ~AudioWidget(); |
104 | void setTickerText( const QString &text ) { songInfo->setText( text ); } | 58 | void setTickerText( const QString &text ) { songInfo.setText( text ); } |
105 | bool isStreaming; | 59 | bool isStreaming; |
@@ -128,2 +82,3 @@ protected: | |||
128 | void showEvent( QShowEvent *se ); | 82 | void showEvent( QShowEvent *se ); |
83 | void resizeEvent( QResizeEvent *re ); | ||
129 | void mouseMoveEvent( QMouseEvent *event ); | 84 | void mouseMoveEvent( QMouseEvent *event ); |
@@ -138,5 +93,17 @@ private: | |||
138 | void paintButton( QPainter *p, int i ); | 93 | void paintButton( QPainter *p, int i ); |
94 | QString skin; | ||
95 | QPixmap *pixBg; | ||
96 | QImage *imgUp; | ||
97 | QImage *imgDn; | ||
98 | QImage *imgButtonMask; | ||
99 | QBitmap *masks[11]; | ||
100 | QPixmap *buttonPixUp[11]; | ||
101 | QPixmap *buttonPixDown[11]; | ||
102 | |||
139 | QPixmap *pixmaps[4]; | 103 | QPixmap *pixmaps[4]; |
140 | Ticker *songInfo; | 104 | OTicker songInfo; |
141 | QSlider *slider; | 105 | QSlider slider; |
106 | QLineEdit time; | ||
107 | int xoff, yoff; | ||
108 | |||
142 | }; | 109 | }; |