summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp50
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp42
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h2
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
@@ -79,19 +79,19 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
Button toggleButton;
toggleButton.isToggle = true;
toggleButton.isHeld = toggleButton.isDown = false;
- 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
setCaption( tr("OpiePlayer") );
Config cfg("OpiePlayer");
@@ -326,23 +326,23 @@ void AudioWidget::updateSlider( long i, long max ) {
void AudioWidget::setToggleButton( int i, bool down ) {
qDebug("setToggleButton %d", i);
- if ( down != audioButtons[i].isDown ) {
+ if ( down != buttons[i].isDown ) {
toggleButton( i );
}
}
void AudioWidget::toggleButton( int i ) {
- audioButtons[i].isDown = !audioButtons[i].isDown;
+ buttons[i].isDown = !buttons[i].isDown;
QPainter p(this);
paintButton ( &p, i );
}
void AudioWidget::paintButton( QPainter *p, int i ) {
- if ( audioButtons[i].isDown ) {
+ if ( buttons[i].isDown ) {
p->drawPixmap( xoff, yoff, *buttonPixDown[i] );
} else {
p->drawPixmap( xoff, yoff, *buttonPixUp[i] );
}
@@ -377,9 +377,9 @@ 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 ) {
// The test to see if the mouse click is inside the button or not
int x = event->pos().x() - xoff;
int y = event->pos().y() - yoff;
@@ -387,10 +387,10 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width()
&& y < imgButtonMask.height()
&& imgButtonMask.pixelIndex( x, y ) == i + 1 );
- if ( isOnButton && !audioButtons[i].isHeld ) {
- audioButtons[i].isHeld = TRUE;
+ if ( isOnButton && !buttons[i].isHeld ) {
+ buttons[i].isHeld = TRUE;
toggleButton(i);
switch (i) {
case VolumeUp:
emit moreClicked();
@@ -404,20 +404,20 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
case Back:
emit backClicked();
return;
}
- } else if ( !isOnButton && audioButtons[i].isHeld ) {
- audioButtons[i].isHeld = FALSE;
+ } else if ( !isOnButton && buttons[i].isHeld ) {
+ buttons[i].isHeld = FALSE;
toggleButton(i);
}
} 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 );
}
qDebug("mouseEvent %d", i);
- handleCommand( static_cast<Command>( i ), audioButtons[ i ].isDown );
+ handleCommand( static_cast<Command>( i ), buttons[ i ].isDown );
}
}
}
}
@@ -445,15 +445,15 @@ void AudioWidget::paintEvent( QPaintEvent * pe ) {
QPixmap pix( pe->rect().size() );
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
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 );
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
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
@@ -109,10 +109,8 @@ private:
QSlider slider;
QLineEdit time;
int xoff, yoff;
bool isStreaming : 1;
-
- ButtonVector audioButtons;
};
#endif // AUDIO_WIDGET_H
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
@@ -66,8 +66,10 @@ protected:
void handleCommand( Command command, bool buttonDown );
MediaPlayerState &mediaPlayerState;
PlayListWidget &playList;
+
+ ButtonVector buttons;
};
#endif // MEDIAWIDGET_H
/* vim: et sw=4 ts=4
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
@@ -75,16 +75,16 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
Button toggleButton;
toggleButton.isToggle = true;
toggleButton.isHeld = toggleButton.isDown = false;
- 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
videoFrame = new XineVideoWidget ( this, "Video frame" );
connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
@@ -257,30 +257,30 @@ 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 );
}
}
void VideoWidget::toggleButton( int i ) {
- videoButtons[i].isDown = !videoButtons[i].isDown;
+ buttons[i].isDown = !buttons[i].isDown;
QPainter p(this);
paintButton ( &p, i );
}
void VideoWidget::paintButton( QPainter *p, int i ) {
- if ( videoButtons[i].isDown ) {
+ if ( buttons[i].isDown ) {
p->drawPixmap( xoff, yoff, *buttonPixDown[i] );
} else {
p->drawPixmap( xoff, yoff, *buttonPixUp[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 ) {
// The test to see if the mouse click is inside the button or not
int x = event->pos().x() - xoff;
int y = event->pos().y() - yoff;
@@ -288,10 +288,10 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width()
&& y < imgButtonMask.height()
&& imgButtonMask.pixelIndex( x, y ) == i + 1 );
- if ( isOnButton && !videoButtons[i].isHeld ) {
- videoButtons[i].isHeld = TRUE;
+ if ( isOnButton && !buttons[i].isHeld ) {
+ buttons[i].isHeld = TRUE;
toggleButton(i);
switch (i) {
case VideoVolUp:
@@ -300,17 +300,17 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
case VideoVolDown:
emit lessClicked();
return;
}
- } else if ( !isOnButton && videoButtons[i].isHeld ) {
- videoButtons[i].isHeld = FALSE;
+ } else if ( !isOnButton && buttons[i].isHeld ) {
+ buttons[i].isHeld = FALSE;
toggleButton(i);
}
} else {
- 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 );
}
switch(i) {
@@ -425,16 +425,16 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
QPixmap pix( pe->rect().size() );
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
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 );
}
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
QPainter p( this );
- for ( unsigned int i = 0; i < videoButtons.size(); i++ )
+ for ( unsigned int i = 0; i < buttons.size(); i++ )
paintButton( &p, i );
}
//slider->repaint( TRUE );
}
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
@@ -119,10 +119,8 @@ private:
QImage *currentFrame;
int scaledWidth;
int scaledHeight;
XineVideoWidget* videoFrame;
-
- ButtonVector videoButtons;
};
#endif // VIDEO_WIDGET_H