author | llornkcor <llornkcor> | 2002-11-03 21:45:32 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-03 21:45:32 (UTC) |
commit | bf62b8f48d08f5a5e92681e1487a5f43d5c7a231 (patch) (side-by-side diff) | |
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) (ignore 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 @@ -26,12 +26,14 @@ #include <qdrawutil.h> #include <qpixmap.h> +#include <qbitmap.h> #include <qstring.h> #include <qslider.h> +#include <qlineedit.h> #include <qframe.h> +#include <opie/oticker.h> class QPixmap; - enum AudioButtons { AudioPlay, @@ -47,53 +49,5 @@ enum AudioButtons { -#define USE_DBLBUF - - -class Ticker : public QFrame { - Q_OBJECT -public: - Ticker( QWidget* parent=0 ) : QFrame( parent ) { - setFrameStyle( WinPanel | Sunken ); - setText( "No Song" ); - } - ~Ticker() { } - void setText( const QString& text ) { - pos = 0; // reset it everytime the text is changed - scrollText = text; - pixelLen = fontMetrics().width( scrollText ); - killTimers(); - if ( pixelLen > width() ) - startTimer( 50 ); - update(); - } -protected: - void timerEvent( QTimerEvent * ) { - pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; -#ifndef USE_DBLBUF - scroll( -1, 0, contentsRect() ); -#else - repaint( FALSE ); -#endif - } - void drawContents( QPainter *p ) { -#ifndef USE_DBLBUF - for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) - p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); -#else - // Double buffering code. - // Looks like qvfb makes it look like it flickers but I don't think it really is - QPixmap pm( width(), height() ); - pm.fill( colorGroup().base() ); - QPainter pmp( &pm ); - for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) - pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); - p->drawPixmap( 0, 0, pm ); -#endif - } -private: - QString scrollText; - int pos, pixelLen; -}; - +//#define USE_DBLBUF class AudioWidget : public QWidget { @@ -102,5 +56,5 @@ public: AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); ~AudioWidget(); - void setTickerText( const QString &text ) { songInfo->setText( text ); } + void setTickerText( const QString &text ) { songInfo.setText( text ); } bool isStreaming; public slots: @@ -127,4 +81,5 @@ protected: void paintEvent( QPaintEvent *pe ); void showEvent( QShowEvent *se ); + void resizeEvent( QResizeEvent *re ); void mouseMoveEvent( QMouseEvent *event ); void mousePressEvent( QMouseEvent *event ); @@ -137,7 +92,19 @@ private: void setToggleButton( int, bool ); void paintButton( QPainter *p, int i ); + QString skin; + QPixmap *pixBg; + QImage *imgUp; + QImage *imgDn; + QImage *imgButtonMask; + QBitmap *masks[11]; + QPixmap *buttonPixUp[11]; + QPixmap *buttonPixDown[11]; + QPixmap *pixmaps[4]; - Ticker *songInfo; - QSlider *slider; + OTicker songInfo; + QSlider slider; + QLineEdit time; + int xoff, yoff; + }; |