Diffstat (limited to 'core/multimedia/opieplayer/mediaplayer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 3 |
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 | ||
40 | extern AudioWidget *audioUI; | 40 | extern AudioWidget *audioUI; |
41 | extern PlayListWidget *playList; | 41 | extern PlayListWidget *playList; |
42 | extern LoopControl *loopControl; | 42 | extern LoopControl *loopControl; |
43 | extern MediaPlayerState *mediaPlayerState; | 43 | extern MediaPlayerState *mediaPlayerState; |
44 | 44 | ||
45 | 45 | ||
46 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | 46 | MediaPlayer::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 | ||
61 | MediaPlayer::~MediaPlayer() { | 62 | MediaPlayer::~MediaPlayer() { |
63 | QPEApplication::grabKeyboard(); | ||
64 | QPEApplication::ungrabKeyboard(); | ||
62 | } | 65 | } |
63 | 66 | ||
64 | 67 | ||
65 | void MediaPlayer::pauseCheck( bool b ) { | 68 | void 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 | ||
72 | void MediaPlayer::play() { | 75 | void MediaPlayer::play() { |
73 | mediaPlayerState->setPlaying( FALSE ); | 76 | mediaPlayerState->setPlaying( FALSE ); |