summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-16 13:39:04 (UTC)
committer harlekin <harlekin>2002-08-16 13:39:04 (UTC)
commit10006a500ed73c7640572b05d9b403e5739bfa0c (patch) (unidiff)
tree870535988a6f603e9087e770778503d94baabfd6
parent5144bf5607a246441f5b37dd0bbb9564017ce017 (diff)
downloadopie-10006a500ed73c7640572b05d9b403e5739bfa0c.zip
opie-10006a500ed73c7640572b05d9b403e5739bfa0c.tar.gz
opie-10006a500ed73c7640572b05d9b403e5739bfa0c.tar.bz2
playing arround with blank
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
@@ -538,2 +538,3 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
538 case Key_F13: //mail 538 case Key_F13: //mail
539 mediaPlayerState->toggleBlank();
539 break; 540 break;
@@ -581,3 +582,3 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
581 mediaPlayerState->setPaused( TRUE ); 582 mediaPlayerState->setPaused( TRUE );
582 } 583 }
583#endif 584#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 @@
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/qcopenvelope_qws.h>
5 6
@@ -18,2 +19,6 @@
18 19
20// for setBacklight()
21#include <linux/fb.h>
22#include <sys/file.h>
23#include <sys/ioctl.h>
19 24
@@ -30,3 +35,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
30 35
31 xineControl = new XineControl(); 36 // xineControl = new XineControl();
32// QPEApplication::grabKeyboard(); // EVIL 37// QPEApplication::grabKeyboard(); // EVIL
@@ -40,2 +45,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
40 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 45 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
46 connect( mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
41 47
@@ -52,3 +58,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
52 volControl = new VolumeControl; 58 volControl = new VolumeControl;
53 59 xineControl = new XineControl();
54} 60}
@@ -73,3 +79,2 @@ void MediaPlayer::setPlaying( bool play ) {
73 if ( !play ) { 79 if ( !play ) {
74 // mediaPlayerState->setPaused( FALSE );
75 return; 80 return;
@@ -100,8 +105,2 @@ void MediaPlayer::setPlaying( bool play ) {
100 105
101// QString fileInfo = mediaPlayerState->curDecoder()->fileInfo();
102
103// if ( !fileInfo.isEmpty() )
104// tickerText += ", " + fileInfo;
105// audioUI->setTickerText( tickerText + "." );
106
107 audioUI->setTickerText( currentFile->file( ) ); 106 audioUI->setTickerText( currentFile->file( ) );
@@ -251,2 +250,20 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
251 250
251
252void MediaPlayer::blank( bool b ) {
253 fd=open("/dev/fb0",O_RDWR);
254 if (fd != -1) {
255
256 if ( !b ) {
257 qDebug("do blanking");
258 ioctl( fd, FBIOBLANK, 3 );
259 isBlanked = TRUE;
260 } else {
261 qDebug("do unblanking");
262 ioctl( fd, FBIOBLANK, 0);
263 isBlanked = FALSE;
264 }
265 close( fd );
266 }
267}
268
252void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { 269void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
@@ -264,5 +281,8 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
264 qDebug("Blank here"); 281 qDebug("Blank here");
282// mediaPlayerState->toggleBlank();
265 break; 283 break;
266 case Key_F13: //mail 284 case Key_F13: //mail
267 break; 285 qDebug("Blank here");
286// mediaPlayerState->toggleBlank();
287 break;
268 } 288 }
@@ -270,10 +290,2 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
270 290
271void MediaPlayer::doBlank() {
272
273}
274
275void MediaPlayer::doUnblank() {
276
277}
278
279void MediaPlayer::cleanUp() { 291void MediaPlayer::cleanUp() {
@@ -281,3 +293,2 @@ void MediaPlayer::cleanUp() {
281// QPEApplication::ungrabKeyboard(); 293// QPEApplication::ungrabKeyboard();
282
283} 294}
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:
30 void cleanUp(); 30 void cleanUp();
31 void blank( bool );
31 32
@@ -34,5 +35,5 @@ protected:
34 void keyReleaseEvent( QKeyEvent *e); 35 void keyReleaseEvent( QKeyEvent *e);
35 void doBlank();
36 void doUnblank();
37private: 36private:
37 bool isBlanked;
38 int fd;
38 int volumeDirection; 39 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 ) {
117 117
118void MediaPlayerState::setFullscreen( bool b ) { 118void MediaPlayerState::setBlank( bool b ) {
119 if ( isFullscreen == b ) { 119 if ( isFullscreen == b ) {
@@ -126,2 +126,11 @@ void MediaPlayerState::setFullscreen( bool b ) {
126 126
127void MediaPlayerState::setFullscreen( bool b ) {
128 if ( isBlanked == b ) {
129 return;
130 }
131 isBlanked = b;
132 emit blankToggled(b);
133}
134
135
127void MediaPlayerState::setScaled( bool b ) { 136void MediaPlayerState::setScaled( bool b ) {
@@ -259,3 +268,3 @@ void MediaPlayerState::togglePlaylist() {
259void MediaPlayerState::togglePaused() { 268void MediaPlayerState::togglePaused() {
260 setPaused( !isPaused); 269 setPaused( !isPaused);
261} 270}
@@ -266,2 +275,5 @@ void MediaPlayerState::togglePlaying() {
266 275
276void MediaPlayerState::toggleBlank() {
277 setBlank( !isBlanked);
278}
267 279
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:
80 void setView( char v ); 80 void setView( char v );
81 void setBlank( bool b );
81 82
@@ -94,2 +95,3 @@ public slots:
94 void togglePlaying(); 95 void togglePlaying();
96 void toggleBlank();
95 97
@@ -108,3 +110,3 @@ signals:
108 void viewChanged( char ); 110 void viewChanged( char );
109 111 void blankToggled( bool );
110 void prev(); 112 void prev();
@@ -116,2 +118,3 @@ private:
116 bool isScaled; 118 bool isScaled;
119 bool isBlanked;
117 bool isLooping; 120 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 @@
2#define QTOPIA_INTERNAL_FSLP 2#define QTOPIA_INTERNAL_FSLP
3#include <qpe/qcopenvelope_qws.h>
4
5#include <qpe/qpemenubar.h> 3#include <qpe/qpemenubar.h>
@@ -47,13 +45,2 @@
47 45
48#include <unistd.h>
49#include <sys/file.h>
50#include <sys/ioctl.h>
51#include <sys/soundcard.h>
52
53// for setBacklight()
54#include <linux/fb.h>
55#include <sys/types.h>
56#include <sys/stat.h>
57#include <stdlib.h>
58
59#define BUTTONS_ON_TOOLBAR 46#define BUTTONS_ON_TOOLBAR
@@ -1012,3 +999,3 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
1012 case Key_F12: //home 999 case Key_F12: //home
1013// doBlank(); 1000// doBlank();
1014 break; 1001 break;
@@ -1081,23 +1068,3 @@ void PlayListWidget::keyPressEvent( QKeyEvent *)
1081 1068
1082void PlayListWidget::doBlank() {
1083 qDebug("do blanking");
1084 fd=open("/dev/fb0",O_RDWR);
1085 if (fd != -1) {
1086 ioctl(fd,FBIOBLANK,1);
1087// close(fd);
1088 }
1089}
1090 1069
1091void PlayListWidget::doUnblank() {
1092 // this crashes opieplayer with a segfault
1093 // int fd;
1094 // fd=open("/dev/fb0",O_RDWR);
1095 qDebug("do unblanking");
1096 if (fd != -1) {
1097 ioctl(fd,FBIOBLANK,0);
1098 close(fd);
1099 }
1100 QCopEnvelope h("QPE/System", "setBacklight(int)");
1101 h <<-3;// v[1]; // -3 Force on
1102}
1103 1070
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:
44 QPushButton *tbDeletePlaylist; 44 QPushButton *tbDeletePlaylist;
45 int fd, selected; 45 int selected;
46public slots: 46public slots:
@@ -58,7 +58,5 @@ void keyPressEvent( QKeyEvent *e);
58private: 58private:
59 int defaultSkinIndex; 59 int defaultSkinIndex;
60 QPopupMenu *skinsMenu; 60 QPopupMenu *skinsMenu;
61 bool audioScan, videoScan; 61 bool audioScan, videoScan;
62 void doBlank();
63 void doUnblank();
64 void readm3u(const QString &); 62 void readm3u(const QString &);
@@ -74,3 +72,3 @@ private slots:
74 void populateSkinsMenu(); 72 void populateSkinsMenu();
75 void skinsMenuActivated(int); 73 void skinsMenuActivated(int);
76 void pmViewActivated(int); 74 void pmViewActivated(int);