Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 50 |
1 files changed, 5 insertions, 45 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index e6afbd8..b8023ca 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | /* OPIE */ | 6 | /* OPIE */ |
7 | #include <opie2/odebug.h> | 7 | #include <opie2/odebug.h> |
8 | #include <opie2/odevice.h> | ||
8 | #include <qpe/qpeapplication.h> | 9 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
10 | 11 | ||
@@ -34,10 +35,6 @@ MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPla | |||
34 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 35 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
35 | 36 | ||
36 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 37 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
37 | |||
38 | // What is pauseCheck good for? (Simon) | ||
39 | // connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pauseCheck(bool) ) ); | ||
40 | |||
41 | connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); | 38 | connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); |
42 | connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); | 39 | connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); |
43 | connect( &mediaPlayerState, SIGNAL( blankToggled(bool) ), this, SLOT ( blank(bool) ) ); | 40 | connect( &mediaPlayerState, SIGNAL( blankToggled(bool) ), this, SLOT ( blank(bool) ) ); |
@@ -154,7 +151,7 @@ void MediaPlayer::next() { | |||
154 | mediaPlayerState.setList(); | 151 | mediaPlayerState.setList(); |
155 | } | 152 | } |
156 | } else { //if playing from file list, let's just stop | 153 | } else { //if playing from file list, let's just stop |
157 | odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl; | 154 | odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl; |
158 | mediaPlayerState.setPlaying(false); | 155 | mediaPlayerState.setPlaying(false); |
159 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); | 156 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); |
160 | if(l) mediaPlayerState.setLooping(l); | 157 | if(l) mediaPlayerState.setLooping(l); |
@@ -281,42 +278,7 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
281 | 278 | ||
282 | 279 | ||
283 | void MediaPlayer::blank( bool b ) { | 280 | void MediaPlayer::blank( bool b ) { |
284 | #ifdef QT_QWS_DEVFS | 281 | Opie::Core::ODevice::inst()->setDisplayStatus( b ); |
285 | fd=open("/dev/fb/0",O_RDWR); | ||
286 | #else | ||
287 | fd=open("/dev/fb0",O_RDWR); | ||
288 | #endif | ||
289 | #ifdef QT_QWS_SL5XXX | ||
290 | fl= open( "/dev/fl", O_RDWR ); | ||
291 | #endif | ||
292 | if (fd != -1) { | ||
293 | if ( b ) { | ||
294 | odebug << "do blanking" << oendl; | ||
295 | #ifdef QT_QWS_SL5XXX | ||
296 | ioctl( fd, FBIOBLANK, 1 ); | ||
297 | if(fl !=-1) { | ||
298 | ioctl( fl, 2 ); | ||
299 | ::close(fl); | ||
300 | } | ||
301 | #else | ||
302 | ioctl( fd, FBIOBLANK, 3 ); | ||
303 | #endif | ||
304 | isBlanked = TRUE; | ||
305 | } else { | ||
306 | odebug << "do unblanking" << oendl; | ||
307 | ioctl( fd, FBIOBLANK, 0); | ||
308 | #ifdef QT_QWS_SL5XXX | ||
309 | if(fl != -1) { | ||
310 | ioctl( fl, 1); | ||
311 | ::close(fl); | ||
312 | } | ||
313 | #endif | ||
314 | isBlanked = FALSE; | ||
315 | } | ||
316 | close( fd ); | ||
317 | } else { | ||
318 | odebug << "<< /dev/fb0 could not be opened >>" << oendl; | ||
319 | } | ||
320 | } | 282 | } |
321 | 283 | ||
322 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | 284 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { |
@@ -331,11 +293,11 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | |||
331 | case Key_F11: //menu | 293 | case Key_F11: //menu |
332 | break; | 294 | break; |
333 | case Key_F12: //home | 295 | case Key_F12: //home |
334 | odebug << "Blank here" << oendl; | 296 | odebug << "Blank here" << oendl; |
335 | // mediaPlayerState->toggleBlank(); | 297 | // mediaPlayerState->toggleBlank(); |
336 | break; | 298 | break; |
337 | case Key_F13: //mail | 299 | case Key_F13: //mail |
338 | odebug << "Blank here" << oendl; | 300 | odebug << "Blank here" << oendl; |
339 | // mediaPlayerState->toggleBlank(); | 301 | // mediaPlayerState->toggleBlank(); |
340 | break; | 302 | break; |
341 | } | 303 | } |
@@ -346,8 +308,6 @@ void MediaPlayer::cleanUp() {// this happens on closing | |||
346 | mediaPlayerState.writeConfig( cfg ); | 308 | mediaPlayerState.writeConfig( cfg ); |
347 | playList.writeDefaultPlaylist( ); | 309 | playList.writeDefaultPlaylist( ); |
348 | 310 | ||
349 | // QPEApplication::grabKeyboard(); | ||
350 | // QPEApplication::ungrabKeyboard(); | ||
351 | } | 311 | } |
352 | 312 | ||
353 | void MediaPlayer::recreateAudioAndVideoWidgets() const | 313 | void MediaPlayer::recreateAudioAndVideoWidgets() const |