summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 8d8e4e5..a3238f0 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -28,13 +28,15 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
xineControl = new XineControl();
// QPEApplication::grabKeyboard(); // EVIL
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
+
connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
+
connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
@@ -47,33 +49,32 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
MediaPlayer::~MediaPlayer() {
delete xineControl;
delete volControl;
}
void MediaPlayer::pauseCheck( bool b ) {
- // Only pause if playing
- if ( b && !mediaPlayerState->playing() ) {
- mediaPlayerState->setPaused( FALSE );
- }
+ if ( b && !mediaPlayerState->playing() ) {
+ mediaPlayerState->setPaused( FALSE );
+ }
}
void MediaPlayer::play() {
- mediaPlayerState->setPlaying( FALSE );
- mediaPlayerState->setPlaying( TRUE );
+ mediaPlayerState->setPlaying( FALSE );
+ mediaPlayerState->setPlaying( TRUE );
}
void MediaPlayer::setPlaying( bool play ) {
if ( !play ) {
mediaPlayerState->setPaused( FALSE );
return;
}
- if ( mediaPlayerState->paused() ) {
- mediaPlayerState->setPaused( FALSE );
- return;
- }
+ if ( mediaPlayerState->paused() ) {
+ mediaPlayerState->setPaused( FALSE );
+ return;
+ }
const DocLnk *playListCurrent = playList->current();
if ( playListCurrent != NULL ) {
currentFile = playListCurrent;
}