-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 49 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 35 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 10 |
7 files changed, 58 insertions, 65 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 442864f..56203e0 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -538,2 +538,3 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) case Key_F13: //mail + mediaPlayerState->toggleBlank(); break; @@ -581,3 +582,3 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) mediaPlayerState->setPaused( TRUE ); - } + } #endif 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(); - } diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h index 16213b5..81fab88 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.h +++ b/noncore/multimedia/opieplayer2/mediaplayer.h @@ -30,2 +30,3 @@ private slots: void cleanUp(); + void blank( bool ); @@ -34,5 +35,5 @@ protected: void keyReleaseEvent( QKeyEvent *e); - void doBlank(); - void doUnblank(); private: + bool isBlanked; + int fd; int volumeDirection; diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index bb8d905..6aafb88 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -117,3 +117,3 @@ void MediaPlayerState::setIsStreaming( bool b ) { -void MediaPlayerState::setFullscreen( bool b ) { +void MediaPlayerState::setBlank( bool b ) { if ( isFullscreen == b ) { @@ -126,2 +126,11 @@ void MediaPlayerState::setFullscreen( bool b ) { +void MediaPlayerState::setFullscreen( bool b ) { + if ( isBlanked == b ) { + return; + } + isBlanked = b; + emit blankToggled(b); +} + + void MediaPlayerState::setScaled( bool b ) { @@ -259,3 +268,3 @@ void MediaPlayerState::togglePlaylist() { void MediaPlayerState::togglePaused() { - setPaused( !isPaused); + setPaused( !isPaused); } @@ -266,2 +275,5 @@ void MediaPlayerState::togglePlaying() { +void MediaPlayerState::toggleBlank() { + setBlank( !isBlanked); +} diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 887c527..3baffd3 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -80,2 +80,3 @@ public slots: void setView( char v ); + void setBlank( bool b ); @@ -94,2 +95,3 @@ public slots: void togglePlaying(); + void toggleBlank(); @@ -108,3 +110,3 @@ signals: void viewChanged( char ); - + void blankToggled( bool ); void prev(); @@ -116,2 +118,3 @@ private: bool isScaled; + bool isBlanked; bool isLooping; diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 6dcc842..0cfd720 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -2,4 +2,2 @@ #define QTOPIA_INTERNAL_FSLP -#include <qpe/qcopenvelope_qws.h> - #include <qpe/qpemenubar.h> @@ -47,13 +45,2 @@ -#include <unistd.h> -#include <sys/file.h> -#include <sys/ioctl.h> -#include <sys/soundcard.h> - -// for setBacklight() -#include <linux/fb.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <stdlib.h> - #define BUTTONS_ON_TOOLBAR @@ -1012,3 +999,3 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) case Key_F12: //home -// doBlank(); +// doBlank(); break; @@ -1081,23 +1068,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) -void PlayListWidget::doBlank() { - qDebug("do blanking"); - fd=open("/dev/fb0",O_RDWR); - if (fd != -1) { - ioctl(fd,FBIOBLANK,1); -// close(fd); - } -} -void PlayListWidget::doUnblank() { - // this crashes opieplayer with a segfault - // int fd; - // fd=open("/dev/fb0",O_RDWR); - qDebug("do unblanking"); - if (fd != -1) { - ioctl(fd,FBIOBLANK,0); - close(fd); - } - QCopEnvelope h("QPE/System", "setBacklight(int)"); - h <<-3;// v[1]; // -3 Force on -} diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 67a85a8..dd4bee0 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -44,3 +44,3 @@ public: QPushButton *tbDeletePlaylist; - int fd, selected; + int selected; public slots: @@ -58,7 +58,5 @@ void keyPressEvent( QKeyEvent *e); private: - int defaultSkinIndex; - QPopupMenu *skinsMenu; + int defaultSkinIndex; + QPopupMenu *skinsMenu; bool audioScan, videoScan; - void doBlank(); - void doUnblank(); void readm3u(const QString &); @@ -74,3 +72,3 @@ private slots: void populateSkinsMenu(); - void skinsMenuActivated(int); + void skinsMenuActivated(int); void pmViewActivated(int); |