Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 8dadf96..858b51f 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -4,2 +4,3 @@ #include <qpe/config.h> +#include <qpe/qcopenvelope_qws.h> @@ -18,2 +19,6 @@ +// for setBacklight() +#include <linux/fb.h> +#include <sys/file.h> +#include <sys/ioctl.h> @@ -30,3 +35,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) - xineControl = new XineControl(); + // xineControl = new XineControl(); // QPEApplication::grabKeyboard(); // EVIL @@ -40,2 +45,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); + connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); @@ -52,3 +58,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) volControl = new VolumeControl; - + xineControl = new XineControl(); } @@ -73,3 +79,2 @@ void MediaPlayer::setPlaying( bool play ) { if ( !play ) { - // mediaPlayerState->setPaused( FALSE ); return; @@ -100,8 +105,2 @@ void MediaPlayer::setPlaying( bool play ) { -// QString fileInfo = mediaPlayerState->curDecoder()->fileInfo(); - -// if ( !fileInfo.isEmpty() ) -// tickerText += ", " + fileInfo; -// audioUI->setTickerText( tickerText + "." ); - audioUI->setTickerText( currentFile->file( ) ); @@ -251,2 +250,20 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { + +void MediaPlayer::blank( bool b ) { + fd=open("/dev/fb0",O_RDWR); + if (fd != -1) { + + if ( !b ) { + qDebug("do blanking"); + ioctl( fd, FBIOBLANK, 3 ); + isBlanked = TRUE; + } else { + qDebug("do unblanking"); + ioctl( fd, FBIOBLANK, 0); + isBlanked = FALSE; + } + close( fd ); + } +} + void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { @@ -264,5 +281,8 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { qDebug("Blank here"); +// mediaPlayerState->toggleBlank(); break; case Key_F13: //mail - break; + qDebug("Blank here"); +// mediaPlayerState->toggleBlank(); + break; } @@ -270,10 +290,2 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { -void MediaPlayer::doBlank() { - -} - -void MediaPlayer::doUnblank() { - -} - void MediaPlayer::cleanUp() { @@ -281,3 +293,2 @@ void MediaPlayer::cleanUp() { // QPEApplication::ungrabKeyboard(); - } |