summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-16 13:39:04 (UTC)
committer harlekin <harlekin>2002-08-16 13:39:04 (UTC)
commit10006a500ed73c7640572b05d9b403e5739bfa0c (patch) (side-by-side diff)
tree870535988a6f603e9087e770778503d94baabfd6
parent5144bf5607a246441f5b37dd0bbb9564017ce017 (diff)
downloadopie-10006a500ed73c7640572b05d9b403e5739bfa0c.zip
opie-10006a500ed73c7640572b05d9b403e5739bfa0c.tar.gz
opie-10006a500ed73c7640572b05d9b403e5739bfa0c.tar.bz2
playing arround with blank
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp47
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.h5
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h5
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp33
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h4
7 files changed, 51 insertions, 58 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: {
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
+ 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 ) {
@@ -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
@@ -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();
@@ -60,6 +60,4 @@ private:
QPopupMenu *skinsMenu;
bool audioScan, videoScan;
- void doBlank();
- void doUnblank();
void readm3u(const QString &);
void readPls(const QString &);