summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayer.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp
index e0c4dba..ab46a7d 100644
--- a/core/multimedia/opieplayer/mediaplayer.cpp
+++ b/core/multimedia/opieplayer/mediaplayer.cpp
@@ -36,38 +36,41 @@
36 36
37#include "mediaplayerstate.h" 37#include "mediaplayerstate.h"
38 38
39 39
40extern AudioWidget *audioUI; 40extern AudioWidget *audioUI;
41extern PlayListWidget *playList; 41extern PlayListWidget *playList;
42extern LoopControl *loopControl; 42extern LoopControl *loopControl;
43extern MediaPlayerState *mediaPlayerState; 43extern MediaPlayerState *mediaPlayerState;
44 44
45 45
46MediaPlayer::MediaPlayer( QObject *parent, const char *name ) 46MediaPlayer::MediaPlayer( QObject *parent, const char *name )
47 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 47 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
48 QPEApplication::grabKeyboard();
48 49
49 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); 50 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
50 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); 51 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
51 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 52 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
52 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 53 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
53 54
54 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 55 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
55 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 56 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
56 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 57 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
57 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 58 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
58} 59}
59 60
60 61
61MediaPlayer::~MediaPlayer() { 62MediaPlayer::~MediaPlayer() {
63 QPEApplication::grabKeyboard();
64 QPEApplication::ungrabKeyboard();
62} 65}
63 66
64 67
65void MediaPlayer::pauseCheck( bool b ) { 68void MediaPlayer::pauseCheck( bool b ) {
66 // Only pause if playing 69 // Only pause if playing
67 if ( b && !mediaPlayerState->playing() ) 70 if ( b && !mediaPlayerState->playing() )
68 mediaPlayerState->setPaused( FALSE ); 71 mediaPlayerState->setPaused( FALSE );
69} 72}
70 73
71 74
72void MediaPlayer::play() { 75void MediaPlayer::play() {
73 mediaPlayerState->setPlaying( FALSE ); 76 mediaPlayerState->setPlaying( FALSE );