summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp49
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.h5
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h5
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp35
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h10
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
@@ -537,4 +537,5 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
break;
case Key_F13: //mail
+ mediaPlayerState->toggleBlank();
break;
case Key_Space: {
@@ -580,5 +581,5 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
setToggleButton( i, TRUE );
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
@@ -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();
-
}
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
@@ -29,11 +29,12 @@ private slots:
void stopChangingVolume();
void cleanUp();
+ void blank( bool );
protected:
void timerEvent( QTimerEvent *e );
void keyReleaseEvent( QKeyEvent *e);
- void doBlank();
- void doUnblank();
private:
+ bool isBlanked;
+ int fd;
int volumeDirection;
const DocLnk *currentFile;
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
@@ -116,5 +116,5 @@ void MediaPlayerState::setIsStreaming( bool b ) {
-void MediaPlayerState::setFullscreen( bool b ) {
+void MediaPlayerState::setBlank( bool b ) {
if ( isFullscreen == b ) {
return;
@@ -125,4 +125,13 @@ void MediaPlayerState::setFullscreen( bool b ) {
+void MediaPlayerState::setFullscreen( bool b ) {
+ if ( isBlanked == b ) {
+ return;
+ }
+ isBlanked = b;
+ emit blankToggled(b);
+}
+
+
void MediaPlayerState::setScaled( bool b ) {
if ( isScaled == b ) {
@@ -258,5 +267,5 @@ void MediaPlayerState::togglePlaylist() {
void MediaPlayerState::togglePaused() {
- setPaused( !isPaused);
+ setPaused( !isPaused);
}
@@ -265,4 +274,7 @@ 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
@@ -79,4 +79,5 @@ public slots:
void setLength( long l );
void setView( char v );
+ void setBlank( bool b );
void setPrev();
@@ -93,4 +94,5 @@ public slots:
void togglePaused();
void togglePlaying();
+ void toggleBlank();
signals:
@@ -107,5 +109,5 @@ signals:
void lengthChanged( long );
void viewChanged( char );
-
+ void blankToggled( bool );
void prev();
void next();
@@ -115,4 +117,5 @@ private:
bool isFullscreen;
bool isScaled;
+ bool isBlanked;
bool isLooping;
bool isShuffled;
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
@@ -1,6 +1,4 @@
#define QTOPIA_INTERNAL_FSLP
-#include <qpe/qcopenvelope_qws.h>
-
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
@@ -46,15 +44,4 @@
#include "videowidget.h"
-#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
#define SIDE_BUTTONS
@@ -1011,5 +998,5 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
break;
case Key_F12: //home
-// doBlank();
+// doBlank();
break;
case Key_F13: //mail
@@ -1080,25 +1067,5 @@ 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
-}
void PlayListWidget::readm3u(const QString &filename) {
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
@@ -43,5 +43,5 @@ public:
FileSelector* playLists;
QPushButton *tbDeletePlaylist;
- int fd, selected;
+ int selected;
public slots:
bool first();
@@ -57,9 +57,7 @@ void keyReleaseEvent( QKeyEvent *e);
void keyPressEvent( QKeyEvent *e);
private:
- int defaultSkinIndex;
- QPopupMenu *skinsMenu;
+ int defaultSkinIndex;
+ QPopupMenu *skinsMenu;
bool audioScan, videoScan;
- void doBlank();
- void doUnblank();
void readm3u(const QString &);
void readPls(const QString &);
@@ -73,5 +71,5 @@ private:
private slots:
void populateSkinsMenu();
- void skinsMenuActivated(int);
+ void skinsMenuActivated(int);
void pmViewActivated(int);
void writem3u();