Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 50 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 42 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
5 files changed, 48 insertions, 50 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 7fb3781..a9d5a88 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -82,13 +82,13 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye - audioButtons.reserve( 10 ); - audioButtons.push_back( toggleButton ); // play - audioButtons.push_back( defaultButton ); // stop - audioButtons.push_back( defaultButton ); // next - audioButtons.push_back( defaultButton ); // previous - audioButtons.push_back( defaultButton ); // volume up - audioButtons.push_back( defaultButton ); // volume down - audioButtons.push_back( toggleButton ); // repeat/loop - audioButtons.push_back( defaultButton ); // playlist - audioButtons.push_back( defaultButton ); // forward - audioButtons.push_back( defaultButton ); // back + buttons.reserve( 10 ); + buttons.push_back( toggleButton ); // play + buttons.push_back( defaultButton ); // stop + buttons.push_back( defaultButton ); // next + buttons.push_back( defaultButton ); // previous + buttons.push_back( defaultButton ); // volume up + buttons.push_back( defaultButton ); // volume down + buttons.push_back( toggleButton ); // repeat/loop + buttons.push_back( defaultButton ); // playlist + buttons.push_back( defaultButton ); // forward + buttons.push_back( defaultButton ); // back @@ -329,3 +329,3 @@ void AudioWidget::setToggleButton( int i, bool down ) { qDebug("setToggleButton %d", i); - if ( down != audioButtons[i].isDown ) { + if ( down != buttons[i].isDown ) { toggleButton( i ); @@ -336,3 +336,3 @@ void AudioWidget::setToggleButton( int i, bool down ) { void AudioWidget::toggleButton( int i ) { - audioButtons[i].isDown = !audioButtons[i].isDown; + buttons[i].isDown = !buttons[i].isDown; QPainter p(this); @@ -343,3 +343,3 @@ void AudioWidget::toggleButton( int i ) { void AudioWidget::paintButton( QPainter *p, int i ) { - if ( audioButtons[i].isDown ) { + if ( buttons[i].isDown ) { p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); @@ -380,3 +380,3 @@ void AudioWidget::timerEvent( QTimerEvent * ) { void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { - for ( unsigned int i = 0; i < audioButtons.size(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { if ( event->state() == QMouseEvent::LeftButton ) { @@ -390,4 +390,4 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { - if ( isOnButton && !audioButtons[i].isHeld ) { - audioButtons[i].isHeld = TRUE; + if ( isOnButton && !buttons[i].isHeld ) { + buttons[i].isHeld = TRUE; toggleButton(i); @@ -407,4 +407,4 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { } - } else if ( !isOnButton && audioButtons[i].isHeld ) { - audioButtons[i].isHeld = FALSE; + } else if ( !isOnButton && buttons[i].isHeld ) { + buttons[i].isHeld = FALSE; toggleButton(i); @@ -412,5 +412,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { } else { - if ( audioButtons[i].isHeld ) { - audioButtons[i].isHeld = FALSE; - if ( !audioButtons[i].isToggle ) { + if ( buttons[i].isHeld ) { + buttons[i].isHeld = FALSE; + if ( !buttons[i].isToggle ) { setToggleButton( i, FALSE ); @@ -418,3 +418,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { qDebug("mouseEvent %d", i); - handleCommand( static_cast<Command>( i ), audioButtons[ i ].isDown ); + handleCommand( static_cast<Command>( i ), buttons[ i ].isDown ); } @@ -448,3 +448,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); - for ( unsigned int i = 0; i < audioButtons.size(); i++ ) + for ( unsigned int i = 0; i < buttons.size(); i++ ) paintButton( &p, i ); @@ -454,3 +454,3 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) { QPainter p( this ); - for ( unsigned int i = 0; i < audioButtons.size(); i++ ) + for ( unsigned int i = 0; i < buttons.size(); i++ ) paintButton( &p, i ); diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index e09c5f8..52a358c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -112,4 +112,2 @@ private: bool isStreaming : 1; - - ButtonVector audioButtons; }; diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index c81768c..b88d7e2 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -69,2 +69,4 @@ protected: PlayListWidget &playList; + + ButtonVector buttons; }; diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 6e2e03e..7838229 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -78,10 +78,10 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye - videoButtons.reserve( 7 ); - videoButtons.push_back( defaultButton ); // stop - videoButtons.push_back( toggleButton ); // play - videoButtons.push_back( defaultButton ); // previous - videoButtons.push_back( defaultButton ); // next - videoButtons.push_back( defaultButton ); // volUp - videoButtons.push_back( defaultButton ); // volDown - videoButtons.push_back( toggleButton ); //fullscreen + buttons.reserve( 7 ); + buttons.push_back( defaultButton ); // stop + buttons.push_back( toggleButton ); // play + buttons.push_back( defaultButton ); // previous + buttons.push_back( defaultButton ); // next + buttons.push_back( defaultButton ); // volUp + buttons.push_back( defaultButton ); // volDown + buttons.push_back( toggleButton ); //fullscreen @@ -260,3 +260,3 @@ void VideoWidget::updateSlider( long i, long max ) { void VideoWidget::setToggleButton( int i, bool down ) { - if ( down != videoButtons[i].isDown ) { + if ( down != buttons[i].isDown ) { toggleButton( i ); @@ -266,3 +266,3 @@ void VideoWidget::setToggleButton( int i, bool down ) { void VideoWidget::toggleButton( int i ) { - videoButtons[i].isDown = !videoButtons[i].isDown; + buttons[i].isDown = !buttons[i].isDown; QPainter p(this); @@ -273,3 +273,3 @@ void VideoWidget::paintButton( QPainter *p, int i ) { - if ( videoButtons[i].isDown ) { + if ( buttons[i].isDown ) { p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); @@ -281,3 +281,3 @@ void VideoWidget::paintButton( QPainter *p, int i ) { void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - for ( unsigned int i = 0; i < videoButtons.size(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { if ( event->state() == QMouseEvent::LeftButton ) { @@ -291,4 +291,4 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - if ( isOnButton && !videoButtons[i].isHeld ) { - videoButtons[i].isHeld = TRUE; + if ( isOnButton && !buttons[i].isHeld ) { + buttons[i].isHeld = TRUE; toggleButton(i); @@ -303,4 +303,4 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { } - } else if ( !isOnButton && videoButtons[i].isHeld ) { - videoButtons[i].isHeld = FALSE; + } else if ( !isOnButton && buttons[i].isHeld ) { + buttons[i].isHeld = FALSE; toggleButton(i); @@ -309,5 +309,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - if ( videoButtons[i].isHeld ) { - videoButtons[i].isHeld = FALSE; - if ( !videoButtons[i].isToggle ) { + if ( buttons[i].isHeld ) { + buttons[i].isHeld = FALSE; + if ( !buttons[i].isToggle ) { setToggleButton( i, FALSE ); @@ -428,3 +428,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); - for ( unsigned int i = 0; i < videoButtons.size(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { paintButton( &p, i ); @@ -435,3 +435,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { QPainter p( this ); - for ( unsigned int i = 0; i < videoButtons.size(); i++ ) + for ( unsigned int i = 0; i < buttons.size(); i++ ) paintButton( &p, i ); diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 34558f8..f996803 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -122,4 +122,2 @@ private: XineVideoWidget* videoFrame; - - ButtonVector videoButtons; }; |