Diffstat (limited to 'core/multimedia/opieplayer/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index 4f3823a..753b2e3 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp | |||
@@ -59,60 +59,60 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | |||
59 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 59 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
60 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 60 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | MediaPlayer::~MediaPlayer() { | 64 | MediaPlayer::~MediaPlayer() { |
65 | 65 | ||
66 | } | 66 | } |
67 | 67 | ||
68 | 68 | ||
69 | void MediaPlayer::pauseCheck( bool b ) { | 69 | void MediaPlayer::pauseCheck( bool b ) { |
70 | // Only pause if playing | 70 | // Only pause if playing |
71 | if ( b && !mediaPlayerState->playing() ) | 71 | if ( b && !mediaPlayerState->playing() ) |
72 | mediaPlayerState->setPaused( FALSE ); | 72 | mediaPlayerState->setPaused( FALSE ); |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | void MediaPlayer::play() { | 76 | void MediaPlayer::play() { |
77 | mediaPlayerState->setPlaying( FALSE ); | 77 | mediaPlayerState->setPlaying( FALSE ); |
78 | mediaPlayerState->setPlaying( TRUE ); | 78 | mediaPlayerState->setPlaying( TRUE ); |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | void MediaPlayer::setPlaying( bool play ) { | 82 | void MediaPlayer::setPlaying( bool play ) { |
83 | qDebug("MediaPlayer setPlaying"); | 83 | // qDebug("MediaPlayer setPlaying %d", play); |
84 | if ( !play ) { | 84 | if ( !play ) { |
85 | mediaPlayerState->setPaused( FALSE ); | 85 | mediaPlayerState->setPaused( FALSE ); |
86 | loopControl->stop( FALSE ); | 86 | loopControl->stop( FALSE ); |
87 | return; | 87 | return; |
88 | } | 88 | } |
89 | 89 | ||
90 | if ( mediaPlayerState->paused() ) { | 90 | if ( mediaPlayerState->paused() ) { |
91 | mediaPlayerState->setPaused( FALSE ); | 91 | mediaPlayerState->setPaused( FALSE ); |
92 | return; | 92 | return; |
93 | } | 93 | } |
94 | qDebug("about to ctrash"); | 94 | // qDebug("about to ctrash"); |
95 | const DocLnk *playListCurrent = playList->current(); | 95 | const DocLnk *playListCurrent = playList->current(); |
96 | 96 | ||
97 | if ( playListCurrent != NULL ) { | 97 | if ( playListCurrent != NULL ) { |
98 | loopControl->stop( TRUE ); | 98 | loopControl->stop( TRUE ); |
99 | currentFile = playListCurrent; | 99 | currentFile = playListCurrent; |
100 | } | 100 | } |
101 | if ( currentFile == NULL ) { | 101 | if ( currentFile == NULL ) { |
102 | QMessageBox::critical( 0, tr( "No file"), tr( "Error: There is no file selected" ) ); | 102 | QMessageBox::critical( 0, tr( "No file"), tr( "Error: There is no file selected" ) ); |
103 | mediaPlayerState->setPlaying( FALSE ); | 103 | mediaPlayerState->setPlaying( FALSE ); |
104 | return; | 104 | return; |
105 | } | 105 | } |
106 | 106 | ||
107 | if ( ((currentFile->file()).left(4) != "http") && !QFile::exists( currentFile->file() ) ) { | 107 | if ( ((currentFile->file()).left(4) != "http") && !QFile::exists( currentFile->file() ) ) { |
108 | QMessageBox::critical( 0, tr( "File not found"), | 108 | QMessageBox::critical( 0, tr( "File not found"), |
109 | tr( "The following file was not found: <i>" ) | 109 | tr( "The following file was not found: <i>" ) |
110 | + currentFile->file() + "</i>" ); | 110 | + currentFile->file() + "</i>" ); |
111 | mediaPlayerState->setPlaying( FALSE ); | 111 | mediaPlayerState->setPlaying( FALSE ); |
112 | return; | 112 | return; |
113 | } | 113 | } |
114 | 114 | ||
115 | if ( !mediaPlayerState->newDecoder( currentFile->file() ) ) { | 115 | if ( !mediaPlayerState->newDecoder( currentFile->file() ) ) { |
116 | QMessageBox::critical( 0, tr( "No decoder found"), | 116 | QMessageBox::critical( 0, tr( "No decoder found"), |
117 | tr( "Sorry, no appropriate decoders found for this file: <i>" ) | 117 | tr( "Sorry, no appropriate decoders found for this file: <i>" ) |
118 | + currentFile->file() + "</i>" ); | 118 | + currentFile->file() + "</i>" ); |
@@ -235,44 +235,44 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
235 | f.setBold( TRUE ); | 235 | f.setBold( TRUE ); |
236 | p.setFont( f ); | 236 | p.setFont( f ); |
237 | p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); | 237 | p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); |
238 | 238 | ||
239 | for ( unsigned int i = 0; i < 10; i++ ) { | 239 | for ( unsigned int i = 0; i < 10; i++ ) { |
240 | if ( v > i ) | 240 | if ( v > i ) |
241 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); | 241 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); |
242 | else | 242 | else |
243 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); | 243 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); |
244 | } | 244 | } |
245 | } | 245 | } |
246 | 246 | ||
247 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | 247 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { |
248 | switch ( e->key() ) { | 248 | switch ( e->key() ) { |
249 | ////////////////////////////// Zaurus keys | 249 | ////////////////////////////// Zaurus keys |
250 | case Key_Home: | 250 | case Key_Home: |
251 | break; | 251 | break; |
252 | case Key_F9: //activity | 252 | case Key_F9: //activity |
253 | break; | 253 | break; |
254 | case Key_F10: //contacts | 254 | case Key_F10: //contacts |
255 | break; | 255 | break; |
256 | case Key_F11: //menu | 256 | case Key_F11: //menu |
257 | break; | 257 | break; |
258 | case Key_F12: //home | 258 | case Key_F12: //home |
259 | qDebug("Blank here"); | 259 | // qDebug("Blank here"); |
260 | break; | 260 | break; |
261 | case Key_F13: //mail | 261 | case Key_F13: //mail |
262 | break; | 262 | break; |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | void MediaPlayer::doBlank() { | 266 | void MediaPlayer::doBlank() { |
267 | 267 | ||
268 | } | 268 | } |
269 | 269 | ||
270 | void MediaPlayer::doUnblank() { | 270 | void MediaPlayer::doUnblank() { |
271 | 271 | ||
272 | } | 272 | } |
273 | 273 | ||
274 | void MediaPlayer::cleanUp() { | 274 | void MediaPlayer::cleanUp() { |
275 | // QPEApplication::grabKeyboard(); | 275 | // QPEApplication::grabKeyboard(); |
276 | // QPEApplication::ungrabKeyboard(); | 276 | // QPEApplication::ungrabKeyboard(); |
277 | 277 | ||
278 | } | 278 | } |