summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-21 22:23:53 (UTC)
committer llornkcor <llornkcor>2002-04-21 22:23:53 (UTC)
commit27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6 (patch) (side-by-side diff)
tree05f6e301fd80c5551301ad88c19c3bcb061834ac
parent53a4a3f6398640d182a067a8ffef9b402cd35d7a (diff)
downloadopie-27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6.zip
opie-27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6.tar.gz
opie-27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6.tar.bz2
comment out grabKeyboard stuff till that function works properly
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
@@ -40,33 +40,33 @@
extern AudioWidget *audioUI;
extern PlayListWidget *playList;
extern LoopControl *loopControl;
extern MediaPlayerState *mediaPlayerState;
MediaPlayer::MediaPlayer( QObject *parent, const char *name )
: QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
- QPEApplication::grabKeyboard();
+
+// QPEApplication::grabKeyboard();
+ connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
}
MediaPlayer::~MediaPlayer() {
- QPEApplication::grabKeyboard();
- QPEApplication::ungrabKeyboard();
}
void MediaPlayer::pauseCheck( bool b ) {
// Only pause if playing
if ( b && !mediaPlayerState->playing() )
mediaPlayerState->setPaused( FALSE );
}
@@ -180,8 +180,40 @@ void MediaPlayer::stopChangingVolume() {
void MediaPlayer::timerEvent( QTimerEvent * ) {
if ( volumeDirection == +1 )
AudioDevice::increaseVolume();
else if ( volumeDirection == -1 )
AudioDevice::decreaseVolume();
}
+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
@@ -42,18 +42,20 @@ private slots:
void next();
void prev();
void startIncreasingVolume();
void startDecreasingVolume();
void stopChangingVolume();
protected:
void timerEvent( QTimerEvent *e );
-// void keyReleaseEvent( QKeyEvent *e);
-
+ void keyReleaseEvent( QKeyEvent *e);
+ void doBlank();
+ void doUnblank();
+ void cleanUp();
private:
int volumeDirection;
const DocLnk *currentFile;
};
#endif // MEDIA_PLAYER_H
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
@@ -14,16 +14,17 @@
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
// code added by L. J. Potter Sat 03-02-2002 06:17:54
#define QTOPIA_INTERNAL_FSLP
+#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/fileselector.h>
#include <qpe/qpeapplication.h>
#include <qpe/lnkproperties.h>
#include <qpe/storage.h>
@@ -57,16 +58,27 @@
#include "mediaplayerstate.h"
#include "inputDialog.h"
#include <stdlib.h>
#include "audiowidget.h"
#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
#define CAN_SAVE_LOAD_PLAYLISTS
extern AudioWidget *audioUI;
extern VideoWidget *videoUI;
extern MediaPlayerState *mediaPlayerState;
@@ -1048,19 +1060,48 @@ void PlayListWidget::openFile() {
delete fileDlg;
}
void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
{
switch ( e->key() ) {
////////////////////////////// Zaurus keys
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;
}
}
+
+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
@@ -52,28 +52,32 @@ public:
bool insanityBool;
QString setDocFileRef;
// retrieve the current playlist entry (media file link)
const DocLnk *current();
void useSelectedDocument();
/* QTimer * menuTimer; */
FileSelector* playLists;
QPushButton *tbDeletePlaylist;
+ int fd;
public slots:
bool first();
bool last();
bool next();
bool prev();
/* void setFullScreen(); */
/* void setScaled(); */
protected:
/* void contentsMousePressEvent( QMouseEvent * e ); */
/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
void keyReleaseEvent( QKeyEvent *e);
private:
+ void doBlank();
+ void doUnblank();
+
void initializeStates();
void readConfig( Config& cfg );
void writeConfig( Config& cfg ) const;
PlayListWidgetPrivate *d; // Private implementation data
void populateAudioView();
void populateVideoView();
private slots:
void openFile();
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
@@ -427,17 +427,17 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e)
{
switch ( e->key() ) {
////////////////////////////// Zaurus keys
case Key_Home:
break;
case Key_F9: //activity
break;
case Key_F10: //contacts
- hide();
+// hide();
break;
case Key_F11: //menu
break;
case Key_F12: //home
break;
case Key_F13: //mail
break;
case Key_Space: {