summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/audiowidget.h
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.h45
1 files changed, 23 insertions, 22 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h
index 53e84b3..a2850aa 100644
--- a/core/multimedia/opieplayer/audiowidget.h
+++ b/core/multimedia/opieplayer/audiowidget.h
@@ -54,4 +54,4 @@ public:
54 Ticker( QWidget* parent=0 ) : QFrame( parent ) { 54 Ticker( QWidget* parent=0 ) : QFrame( parent ) {
55 setFrameStyle( WinPanel | Sunken ); 55 setFrameStyle( WinPanel | Sunken );
56 setText( "No Song" ); 56 setText( "No Song" );
57 } 57 }
@@ -59,9 +59,9 @@ public:
59 void setText( const QString& text ) { 59 void setText( const QString& text ) {
60 pos = 0; // reset it everytime the text is changed 60 pos = 0; // reset it everytime the text is changed
61 scrollText = text; 61 scrollText = text;
62 pixelLen = fontMetrics().width( scrollText ); 62 pixelLen = fontMetrics().width( scrollText );
63 killTimers(); 63 killTimers();
64 if ( pixelLen > width() ) 64 if ( pixelLen > width() )
65 startTimer( 50 ); 65 startTimer( 50 );
66 update(); 66 update();
67 } 67 }
@@ -69,7 +69,7 @@ protected:
69 void timerEvent( QTimerEvent * ) { 69 void timerEvent( QTimerEvent * ) {
70 pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; 70 pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1;
71#ifndef USE_DBLBUF 71#ifndef USE_DBLBUF
72 scroll( -1, 0, contentsRect() ); 72 scroll( -1, 0, contentsRect() );
73#else 73#else
74 repaint( FALSE ); 74 repaint( FALSE );
75#endif 75#endif
@@ -78,13 +78,13 @@ protected:
78#ifndef USE_DBLBUF 78#ifndef USE_DBLBUF
79 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) 79 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen )
80 p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); 80 p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText );
81#else 81#else
82 // Double buffering code. 82 // Double buffering code.
83 // Looks like qvfb makes it look like it flickers but I don't think it really is 83 // Looks like qvfb makes it look like it flickers but I don't think it really is
84 QPixmap pm( width(), height() ); 84 QPixmap pm( width(), height() );
85 pm.fill( colorGroup().base() ); 85 pm.fill( colorGroup().base() );
86 QPainter pmp( &pm ); 86 QPainter pmp( &pm );
87 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) 87 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen )
88 pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); 88 pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText );
89 p->drawPixmap( 0, 0, pm ); 89 p->drawPixmap( 0, 0, pm );
90#endif 90#endif
@@ -130,2 +130,3 @@ protected:
130 void closeEvent( QCloseEvent *event ); 130 void closeEvent( QCloseEvent *event );
131 void keyReleaseEvent( QKeyEvent *e);
131 132