summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h4
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h4
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp14
5 files changed, 17 insertions, 23 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 8c7e614..ef606ab 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -342,5 +342,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
if ( isOnButton && !buttons[i].isHeld ) {
buttons[i].isHeld = TRUE;
- toggleButton(i);
+ toggleButton( buttons[ i ] );
switch (i) {
case VolumeUp:
@@ -359,5 +359,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
} else if ( !isOnButton && buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
- toggleButton(i);
+ toggleButton( buttons[ i ] );
}
} else {
@@ -365,5 +365,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
buttons[i].isHeld = FALSE;
if ( buttons[i].type != ToggleButton ) {
- setToggleButton( i, FALSE );
+ setToggleButton( buttons[ i ], FALSE );
}
qDebug("mouseEvent %d", i);
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 9b276b5..092e5ce 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -60,5 +60,5 @@ public slots:
void sliderPressed( );
void sliderReleased( );
- void setLooping( bool b) { setToggleButton( Loop, b ); }
+ void setLooping( bool b) { setToggleButton( buttons[ Loop ], b ); }
void setPosition( long );
void setSeekable( bool );
@@ -66,5 +66,5 @@ public slots:
public:
virtual void setLength( long );
- virtual void setPlaying( bool b) { setToggleButton( Play, b ); }
+ virtual void setPlaying( bool b) { setToggleButton( buttons[ Play ], b ); }
virtual void setDisplayType( MediaPlayerState::DisplayType displayType );
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index 9c5291b..66129c9 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -115,18 +115,12 @@ void MediaWidget::paintButton( QPainter &p, const Button &button )
}
-void MediaWidget::setToggleButton( int buttonId, bool down )
+void MediaWidget::setToggleButton( Button &button, bool down )
{
- qDebug("setToggleButton %d", buttonId );
-
- Button &button = buttons[ buttonId ];
-
if ( down != button.isDown )
- toggleButton( buttonId );
+ toggleButton( button );
}
-void MediaWidget::toggleButton( int buttonId )
+void MediaWidget::toggleButton( Button &button )
{
- Button &button = buttons[ buttonId ];
-
button.isDown = !button.isDown;
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index b7860dc..05b7b71 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -92,6 +92,6 @@ protected:
void paintButton( QPainter &p, const Button &button );
- void setToggleButton( int buttonId, bool down );
- void toggleButton( int buttonId );
+ void setToggleButton( Button &button, bool down );
+ void toggleButton( Button &button );
MediaPlayerState &mediaPlayerState;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index db4a396..673c9e8 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -251,5 +251,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
if ( isOnButton && !buttons[i].isHeld ) {
buttons[i].isHeld = TRUE;
- toggleButton(i);
+ toggleButton( buttons[ i ] );
switch (i) {
@@ -263,5 +263,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
} else if ( !isOnButton && buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
- toggleButton(i);
+ toggleButton( buttons[ i ] );
}
} else {
@@ -270,5 +270,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
buttons[i].isHeld = FALSE;
if ( buttons[i].type != ToggleButton ) {
- setToggleButton( i, FALSE );
+ setToggleButton( buttons[ i ], FALSE );
}
@@ -277,9 +277,9 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
case VideoPlay: {
if( mediaPlayerState.isPaused() ) {
- setToggleButton( i, FALSE );
+ setToggleButton( buttons[ i ], FALSE );
mediaPlayerState.setPaused( FALSE );
return;
} else if( !mediaPlayerState.isPaused() ) {
- setToggleButton( i, TRUE );
+ setToggleButton( buttons[ i ], TRUE );
mediaPlayerState.setPaused( TRUE );
return;
@@ -424,10 +424,10 @@ XineVideoWidget* VideoWidget::vidWidget() {
void VideoWidget::setFullscreen ( bool b ) {
- setToggleButton( VideoFullscreen, b );
+ setToggleButton( buttons[ VideoFullscreen ], b );
}
void VideoWidget::setPlaying( bool b) {
- setToggleButton( VideoPlay, b );
+ setToggleButton( buttons[ VideoPlay ], b );
}