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
@@ -537,4 +537,5 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
537 break; 537 break;
538 case Key_F13: //mail 538 case Key_F13: //mail
539 mediaPlayerState->toggleBlank();
539 break; 540 break;
540 case Key_Space: { 541 case Key_Space: {
@@ -580,5 +581,5 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
580 setToggleButton( i, TRUE ); 581 setToggleButton( i, TRUE );
581 mediaPlayerState->setPaused( TRUE ); 582 mediaPlayerState->setPaused( TRUE );
582 } 583 }
583#endif 584#endif
584 } 585 }
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 @@
3#include <qpe/resource.h> 3#include <qpe/resource.h>
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/qcopenvelope_qws.h>
5 6
6#include <qmainwindow.h> 7#include <qmainwindow.h>
@@ -17,4 +18,8 @@
17#include "mediaplayerstate.h" 18#include "mediaplayerstate.h"
18 19
20// for setBacklight()
21#include <linux/fb.h>
22#include <sys/file.h>
23#include <sys/ioctl.h>
19 24
20 25
@@ -29,5 +34,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
29 34
30 35
31 xineControl = new XineControl(); 36 // xineControl = new XineControl();
32// QPEApplication::grabKeyboard(); // EVIL 37// QPEApplication::grabKeyboard(); // EVIL
33 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 38 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
@@ -39,4 +44,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
39 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 44 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
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
42 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 48 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
@@ -51,5 +57,5 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
51 57
52 volControl = new VolumeControl; 58 volControl = new VolumeControl;
53 59 xineControl = new XineControl();
54} 60}
55 61
@@ -72,5 +78,4 @@ void MediaPlayer::play() {
72void MediaPlayer::setPlaying( bool play ) { 78void MediaPlayer::setPlaying( bool play ) {
73 if ( !play ) { 79 if ( !play ) {
74 // mediaPlayerState->setPaused( FALSE );
75 return; 80 return;
76 } 81 }
@@ -99,10 +104,4 @@ void MediaPlayer::setPlaying( bool play ) {
99 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; 104 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
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( ) );
108 107
@@ -250,4 +249,22 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
250} 249}
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) {
253 switch ( e->key() ) { 270 switch ( e->key() ) {
@@ -263,21 +280,15 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
263 case Key_F12: //home 280 case Key_F12: //home
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 }
269} 289}
270 290
271void MediaPlayer::doBlank() {
272
273}
274
275void MediaPlayer::doUnblank() {
276
277}
278
279void MediaPlayer::cleanUp() { 291void MediaPlayer::cleanUp() {
280// QPEApplication::grabKeyboard(); 292// QPEApplication::grabKeyboard();
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
@@ -29,11 +29,12 @@ private slots:
29 void stopChangingVolume(); 29 void stopChangingVolume();
30 void cleanUp(); 30 void cleanUp();
31 void blank( bool );
31 32
32protected: 33protected:
33 void timerEvent( QTimerEvent *e ); 34 void timerEvent( QTimerEvent *e );
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;
39 const DocLnk *currentFile; 40 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 ) {
116 116
117 117
118void MediaPlayerState::setFullscreen( bool b ) { 118void MediaPlayerState::setBlank( bool b ) {
119 if ( isFullscreen == b ) { 119 if ( isFullscreen == b ) {
120 return; 120 return;
@@ -125,4 +125,13 @@ void MediaPlayerState::setFullscreen( bool b ) {
125 125
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 ) {
128 if ( isScaled == b ) { 137 if ( isScaled == b ) {
@@ -258,5 +267,5 @@ void MediaPlayerState::togglePlaylist() {
258 267
259void MediaPlayerState::togglePaused() { 268void MediaPlayerState::togglePaused() {
260 setPaused( !isPaused); 269 setPaused( !isPaused);
261} 270}
262 271
@@ -265,4 +274,7 @@ void MediaPlayerState::togglePlaying() {
265} 274}
266 275
276void MediaPlayerState::toggleBlank() {
277 setBlank( !isBlanked);
278}
267 279
268 280
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:
79 void setLength( long l ); 79 void setLength( long l );
80 void setView( char v ); 80 void setView( char v );
81 void setBlank( bool b );
81 82
82 void setPrev(); 83 void setPrev();
@@ -93,4 +94,5 @@ public slots:
93 void togglePaused(); 94 void togglePaused();
94 void togglePlaying(); 95 void togglePlaying();
96 void toggleBlank();
95 97
96signals: 98signals:
@@ -107,5 +109,5 @@ signals:
107 void lengthChanged( long ); 109 void lengthChanged( long );
108 void viewChanged( char ); 110 void viewChanged( char );
109 111 void blankToggled( bool );
110 void prev(); 112 void prev();
111 void next(); 113 void next();
@@ -115,4 +117,5 @@ private:
115 bool isFullscreen; 117 bool isFullscreen;
116 bool isScaled; 118 bool isScaled;
119 bool isBlanked;
117 bool isLooping; 120 bool isLooping;
118 bool isShuffled; 121 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 @@
1 1
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>
6#include <qpe/qpetoolbar.h> 4#include <qpe/qpetoolbar.h>
@@ -46,15 +44,4 @@
46#include "videowidget.h" 44#include "videowidget.h"
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
60#define SIDE_BUTTONS 47#define SIDE_BUTTONS
@@ -1011,5 +998,5 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
1011 break; 998 break;
1012 case Key_F12: //home 999 case Key_F12: //home
1013// doBlank(); 1000// doBlank();
1014 break; 1001 break;
1015 case Key_F13: //mail 1002 case Key_F13: //mail
@@ -1080,25 +1067,5 @@ void PlayListWidget::keyPressEvent( QKeyEvent *)
1080} 1067}
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
1104void PlayListWidget::readm3u(const QString &filename) { 1071void 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:
43 FileSelector* playLists; 43 FileSelector* playLists;
44 QPushButton *tbDeletePlaylist; 44 QPushButton *tbDeletePlaylist;
45 int fd, selected; 45 int selected;
46public slots: 46public slots:
47 bool first(); 47 bool first();
@@ -57,9 +57,7 @@ void keyReleaseEvent( QKeyEvent *e);
57void keyPressEvent( QKeyEvent *e); 57void 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 &);
65 void readPls(const QString &); 63 void readPls(const QString &);
@@ -73,5 +71,5 @@ private:
73private slots: 71private slots:
74 void populateSkinsMenu(); 72 void populateSkinsMenu();
75 void skinsMenuActivated(int); 73 void skinsMenuActivated(int);
76 void pmViewActivated(int); 74 void pmViewActivated(int);
77 void writem3u(); 75 void writem3u();