summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayer.cpp38
-rw-r--r--core/multimedia/opieplayer/mediaplayer.h6
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp51
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h4
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp2
5 files changed, 90 insertions, 11 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp
index ab46a7d..b9e438b 100644
--- a/core/multimedia/opieplayer/mediaplayer.cpp
+++ b/core/multimedia/opieplayer/mediaplayer.cpp
@@ -47,3 +47,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
: QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
- QPEApplication::grabKeyboard();
+
+// QPEApplication::grabKeyboard();
+ connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
@@ -62,4 +64,2 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
MediaPlayer::~MediaPlayer() {
- QPEApplication::grabKeyboard();
- QPEApplication::ungrabKeyboard();
}
@@ -187 +187,33 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
+void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
+ switch ( e->key() ) {
+////////////////////////////// Zaurus keys
+ case Key_Home:
+ break;
+ case Key_F9: //activity
+ break;
+ case Key_F10: //contacts
+ break;
+ case Key_F11: //menu
+ break;
+ case Key_F12: //home
+ qDebug("Blank here");
+ break;
+ case Key_F13: //mail
+ break;
+ }
+}
+
+void MediaPlayer::doBlank() {
+
+}
+
+void MediaPlayer::doUnblank() {
+
+}
+
+void MediaPlayer::cleanUp() {
+// QPEApplication::grabKeyboard();
+// QPEApplication::ungrabKeyboard();
+
+}
diff --git a/core/multimedia/opieplayer/mediaplayer.h b/core/multimedia/opieplayer/mediaplayer.h
index 0354d21..cf9daea 100644
--- a/core/multimedia/opieplayer/mediaplayer.h
+++ b/core/multimedia/opieplayer/mediaplayer.h
@@ -49,4 +49,6 @@ protected:
void timerEvent( QTimerEvent *e );
-// void keyReleaseEvent( QKeyEvent *e);
-
+ void keyReleaseEvent( QKeyEvent *e);
+ void doBlank();
+ void doUnblank();
+ void cleanUp();
private:
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index faa6e3f..70b7cef 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -21,2 +21,3 @@
#define QTOPIA_INTERNAL_FSLP
+#include <qpe/qcopenvelope_qws.h>
@@ -64,2 +65,13 @@
+#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
@@ -1055,9 +1067,16 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
case Key_F9: //activity
- if(audioUI->isHidden())
- audioUI->showMaximized();
+// if(audioUI->isHidden())
+// audioUI->showMaximized();
break;
case Key_F10: //contacts
- if( videoUI->isHidden())
- videoUI->showMaximized();
-
+// if( videoUI->isHidden())
+// videoUI->showMaximized();
+ break;
+ case Key_F11: //menu
+ break;
+ case Key_F12: //home
+// doBlank();
+ break;
+ case Key_F13: //mail
+// doUnblank();
break;
@@ -1066 +1085,23 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
}
+
+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/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h
index 16b9905..f22770f 100644
--- a/core/multimedia/opieplayer/playlistwidget.h
+++ b/core/multimedia/opieplayer/playlistwidget.h
@@ -59,2 +59,3 @@ public:
QPushButton *tbDeletePlaylist;
+ int fd;
public slots:
@@ -71,2 +72,5 @@ void keyReleaseEvent( QKeyEvent *e);
private:
+ void doBlank();
+ void doUnblank();
+
void initializeStates();
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index d0cb764..3bce996 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -434,3 +434,3 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e)
case Key_F10: //contacts
- hide();
+// hide();
break;