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 @@ -3,4 +3,5 @@ #include <qpe/resource.h> #include <qpe/config.h> +#include <qpe/qcopenvelope_qws.h> #include <qmainwindow.h> @@ -17,4 +18,8 @@ #include "mediaplayerstate.h" +// for setBacklight() +#include <linux/fb.h> +#include <sys/file.h> +#include <sys/ioctl.h> @@ -29,5 +34,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) - xineControl = new XineControl(); + // xineControl = new XineControl(); // QPEApplication::grabKeyboard(); // EVIL connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); @@ -39,4 +44,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); + connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); @@ -51,5 +57,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) volControl = new VolumeControl; - + xineControl = new XineControl(); } @@ -72,5 +78,4 @@ void MediaPlayer::play() { void MediaPlayer::setPlaying( bool play ) { if ( !play ) { - // mediaPlayerState->setPaused( FALSE ); return; } @@ -99,10 +104,4 @@ void MediaPlayer::setPlaying( bool play ) { tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; -// QString fileInfo = mediaPlayerState->curDecoder()->fileInfo(); - -// if ( !fileInfo.isEmpty() ) -// tickerText += ", " + fileInfo; -// audioUI->setTickerText( tickerText + "." ); - audioUI->setTickerText( currentFile->file( ) ); @@ -250,4 +249,22 @@ 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) { switch ( e->key() ) { @@ -263,21 +280,15 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { case Key_F12: //home qDebug("Blank here"); +// mediaPlayerState->toggleBlank(); break; case Key_F13: //mail - break; + qDebug("Blank here"); +// mediaPlayerState->toggleBlank(); + break; } } -void MediaPlayer::doBlank() { - -} - -void MediaPlayer::doUnblank() { - -} - void MediaPlayer::cleanUp() { // QPEApplication::grabKeyboard(); // QPEApplication::ungrabKeyboard(); - } |