Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index a236775..7e38fc7 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -131,49 +131,49 @@ void MediaPlayer::prev() { | |||
131 | } else if ( mediaPlayerState.isLooping() ) { | 131 | } else if ( mediaPlayerState.isLooping() ) { |
132 | if ( playList.last() ) { | 132 | if ( playList.last() ) { |
133 | play(); | 133 | play(); |
134 | } | 134 | } |
135 | } else { | 135 | } else { |
136 | mediaPlayerState.setList(); | 136 | mediaPlayerState.setList(); |
137 | } | 137 | } |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | ||
142 | void MediaPlayer::next() { | 142 | void MediaPlayer::next() { |
143 | 143 | ||
144 | if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist | 144 | if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist |
145 | if ( playList.next() ) { | 145 | if ( playList.next() ) { |
146 | play(); | 146 | play(); |
147 | } else if ( mediaPlayerState.isLooping() ) { | 147 | } else if ( mediaPlayerState.isLooping() ) { |
148 | if ( playList.first() ) { | 148 | if ( playList.first() ) { |
149 | play(); | 149 | play(); |
150 | } | 150 | } |
151 | } else { | 151 | } else { |
152 | mediaPlayerState.setList(); | 152 | mediaPlayerState.setList(); |
153 | } | 153 | } |
154 | } else { //if playing from file list, let's just stop | 154 | } else { //if playing from file list, let's just stop |
155 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); | 155 | odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl; |
156 | mediaPlayerState.setPlaying(false); | 156 | mediaPlayerState.setPlaying(false); |
157 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); | 157 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); |
158 | if(l) mediaPlayerState.setLooping(l); | 158 | if(l) mediaPlayerState.setLooping(l); |
159 | if(r) mediaPlayerState.setShuffled(r); | 159 | if(r) mediaPlayerState.setShuffled(r); |
160 | } | 160 | } |
161 | qApp->processEvents(); | 161 | qApp->processEvents(); |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
165 | void MediaPlayer::startDecreasingVolume() { | 165 | void MediaPlayer::startDecreasingVolume() { |
166 | volumeDirection = -1; | 166 | volumeDirection = -1; |
167 | startTimer( 100 ); | 167 | startTimer( 100 ); |
168 | volControl->decVol(2); | 168 | volControl->decVol(2); |
169 | } | 169 | } |
170 | 170 | ||
171 | 171 | ||
172 | void MediaPlayer::startIncreasingVolume() { | 172 | void MediaPlayer::startIncreasingVolume() { |
173 | volumeDirection = +1; | 173 | volumeDirection = +1; |
174 | startTimer( 100 ); | 174 | startTimer( 100 ); |
175 | volControl->incVol(2); | 175 | volControl->incVol(2); |
176 | } | 176 | } |
177 | 177 | ||
178 | 178 | ||
179 | bool drawnOnScreenDisplay = FALSE; | 179 | bool drawnOnScreenDisplay = FALSE; |
@@ -264,93 +264,93 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
264 | QFont f; | 264 | QFont f; |
265 | f.setPixelSize( 20 ); | 265 | f.setPixelSize( 20 ); |
266 | f.setBold( TRUE ); | 266 | f.setBold( TRUE ); |
267 | p.setFont( f ); | 267 | p.setFont( f ); |
268 | p.drawText( (w - 200) / 2, h - yoff + 20, tr( "Volume" ) ); | 268 | p.drawText( (w - 200) / 2, h - yoff + 20, tr( "Volume" ) ); |
269 | 269 | ||
270 | for ( unsigned int i = 0; i < 10; i++ ) { | 270 | for ( unsigned int i = 0; i < 10; i++ ) { |
271 | if ( v > i ) { | 271 | if ( v > i ) { |
272 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); | 272 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); |
273 | } else { | 273 | } else { |
274 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); | 274 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
281 | void MediaPlayer::blank( bool b ) { | 281 | void MediaPlayer::blank( bool b ) { |
282 | fd=open("/dev/fb0",O_RDWR); | 282 | fd=open("/dev/fb0",O_RDWR); |
283 | #ifdef QT_QWS_SL5XXX | 283 | #ifdef QT_QWS_SL5XXX |
284 | fl= open( "/dev/fl", O_RDWR ); | 284 | fl= open( "/dev/fl", O_RDWR ); |
285 | #endif | 285 | #endif |
286 | if (fd != -1) { | 286 | if (fd != -1) { |
287 | if ( b ) { | 287 | if ( b ) { |
288 | qDebug("do blanking"); | 288 | odebug << "do blanking" << oendl; |
289 | #ifdef QT_QWS_SL5XXX | 289 | #ifdef QT_QWS_SL5XXX |
290 | ioctl( fd, FBIOBLANK, 1 ); | 290 | ioctl( fd, FBIOBLANK, 1 ); |
291 | if(fl !=-1) { | 291 | if(fl !=-1) { |
292 | ioctl( fl, 2 ); | 292 | ioctl( fl, 2 ); |
293 | ::close(fl); | 293 | ::close(fl); |
294 | } | 294 | } |
295 | #else | 295 | #else |
296 | ioctl( fd, FBIOBLANK, 3 ); | 296 | ioctl( fd, FBIOBLANK, 3 ); |
297 | #endif | 297 | #endif |
298 | isBlanked = TRUE; | 298 | isBlanked = TRUE; |
299 | } else { | 299 | } else { |
300 | qDebug("do unblanking"); | 300 | odebug << "do unblanking" << oendl; |
301 | ioctl( fd, FBIOBLANK, 0); | 301 | ioctl( fd, FBIOBLANK, 0); |
302 | #ifdef QT_QWS_SL5XXX | 302 | #ifdef QT_QWS_SL5XXX |
303 | if(fl != -1) { | 303 | if(fl != -1) { |
304 | ioctl( fl, 1); | 304 | ioctl( fl, 1); |
305 | ::close(fl); | 305 | ::close(fl); |
306 | } | 306 | } |
307 | #endif | 307 | #endif |
308 | isBlanked = FALSE; | 308 | isBlanked = FALSE; |
309 | } | 309 | } |
310 | close( fd ); | 310 | close( fd ); |
311 | } else { | 311 | } else { |
312 | qDebug("<< /dev/fb0 could not be opened >>"); | 312 | odebug << "<< /dev/fb0 could not be opened >>" << oendl; |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | 316 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { |
317 | switch ( e->key() ) { | 317 | switch ( e->key() ) { |
318 | ////////////////////////////// Zaurus keys | 318 | ////////////////////////////// Zaurus keys |
319 | case Key_Home: | 319 | case Key_Home: |
320 | break; | 320 | break; |
321 | case Key_F9: //activity | 321 | case Key_F9: //activity |
322 | break; | 322 | break; |
323 | case Key_F10: //contacts | 323 | case Key_F10: //contacts |
324 | break; | 324 | break; |
325 | case Key_F11: //menu | 325 | case Key_F11: //menu |
326 | break; | 326 | break; |
327 | case Key_F12: //home | 327 | case Key_F12: //home |
328 | qDebug("Blank here"); | 328 | odebug << "Blank here" << oendl; |
329 | // mediaPlayerState->toggleBlank(); | 329 | // mediaPlayerState->toggleBlank(); |
330 | break; | 330 | break; |
331 | case Key_F13: //mail | 331 | case Key_F13: //mail |
332 | qDebug("Blank here"); | 332 | odebug << "Blank here" << oendl; |
333 | // mediaPlayerState->toggleBlank(); | 333 | // mediaPlayerState->toggleBlank(); |
334 | break; | 334 | break; |
335 | } | 335 | } |
336 | } | 336 | } |
337 | 337 | ||
338 | void MediaPlayer::cleanUp() {// this happens on closing | 338 | void MediaPlayer::cleanUp() {// this happens on closing |
339 | Config cfg( "OpiePlayer" ); | 339 | Config cfg( "OpiePlayer" ); |
340 | mediaPlayerState.writeConfig( cfg ); | 340 | mediaPlayerState.writeConfig( cfg ); |
341 | playList.writeDefaultPlaylist( ); | 341 | playList.writeDefaultPlaylist( ); |
342 | 342 | ||
343 | // QPEApplication::grabKeyboard(); | 343 | // QPEApplication::grabKeyboard(); |
344 | // QPEApplication::ungrabKeyboard(); | 344 | // QPEApplication::ungrabKeyboard(); |
345 | } | 345 | } |
346 | 346 | ||
347 | void MediaPlayer::recreateAudioAndVideoWidgets() const | 347 | void MediaPlayer::recreateAudioAndVideoWidgets() const |
348 | { | 348 | { |
349 | delete m_skinLoader; | 349 | delete m_skinLoader; |
350 | 350 | ||
351 | delete m_xineControl; | 351 | delete m_xineControl; |
352 | delete m_audioUI; | 352 | delete m_audioUI; |
353 | delete m_videoUI; | 353 | delete m_videoUI; |
354 | m_audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" ); | 354 | m_audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" ); |
355 | m_videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); | 355 | m_videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); |
356 | 356 | ||