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
@@ -536,6 +536,7 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
536 case Key_F12: //home 536 case Key_F12: //home
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: {
541 if(mediaPlayerState->playing()) { 542 if(mediaPlayerState->playing()) {
@@ -579,7 +580,7 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
579 } else if( !mediaPlayerState->isPaused ) { 580 } else if( !mediaPlayerState->isPaused ) {
580 setToggleButton( i, TRUE ); 581 setToggleButton( i, TRUE );
581 mediaPlayerState->setPaused( TRUE ); 582 mediaPlayerState->setPaused( TRUE );
582 } 583 }
583#endif 584#endif
584 } 585 }
585 break; 586 break;
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
@@ -2,6 +2,7 @@
2#include <qpe/qlibrary.h> 2#include <qpe/qlibrary.h>
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>
7#include <qmessagebox.h> 8#include <qmessagebox.h>
@@ -16,6 +17,10 @@
16 17
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
21extern AudioWidget *audioUI; 26extern AudioWidget *audioUI;
@@ -28,7 +33,7 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
28 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 33 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
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()) );
34 39
@@ -38,6 +43,7 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
38 43
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() ) );
43 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 49 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
@@ -50,7 +56,7 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
50 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 56 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
51 57
52 volControl = new VolumeControl; 58 volControl = new VolumeControl;
53 59 xineControl = new XineControl();
54} 60}
55 61
56MediaPlayer::~MediaPlayer() { 62MediaPlayer::~MediaPlayer() {
@@ -71,7 +77,6 @@ void MediaPlayer::play() {
71 77
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 }
77 82
@@ -98,12 +103,6 @@ void MediaPlayer::setPlaying( bool play ) {
98 else 103 else
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
109} 108}
@@ -249,6 +248,24 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
249 } 248 }
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() ) {
254////////////////////////////// Zaurus keys 271////////////////////////////// Zaurus keys
@@ -262,22 +279,16 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
262 break; 279 break;
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
@@ -28,13 +28,14 @@ private slots:
28 void startDecreasingVolume(); 28 void startDecreasingVolume();
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;
40 XineControl *xineControl; 41 XineControl *xineControl;
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
@@ -115,7 +115,7 @@ void MediaPlayerState::setIsStreaming( bool b ) {
115} 115}
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;
121 } 121 }
@@ -124,6 +124,15 @@ void MediaPlayerState::setFullscreen( bool b ) {
124} 124}
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 ) {
129 return; 138 return;
@@ -257,13 +266,16 @@ void MediaPlayerState::togglePlaylist() {
257} 266}
258 267
259void MediaPlayerState::togglePaused() { 268void MediaPlayerState::togglePaused() {
260 setPaused( !isPaused); 269 setPaused( !isPaused);
261} 270}
262 271
263void MediaPlayerState::togglePlaying() { 272void MediaPlayerState::togglePlaying() {
264 setPlaying( !isPlaying); 273 setPlaying( !isPlaying);
265} 274}
266 275
276void MediaPlayerState::toggleBlank() {
277 setBlank( !isBlanked);
278}
267 279
268 280
269 281
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
@@ -78,6 +78,7 @@ public slots:
78 void updatePosition( long p ); 78 void updatePosition( long p );
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();
83 void setNext(); 84 void setNext();
@@ -92,6 +93,7 @@ public slots:
92 void togglePlaylist(); 93 void togglePlaylist();
93 void togglePaused(); 94 void togglePaused();
94 void togglePlaying(); 95 void togglePlaying();
96 void toggleBlank();
95 97
96signals: 98signals:
97 void fullscreenToggled( bool ); 99 void fullscreenToggled( bool );
@@ -106,7 +108,7 @@ signals:
106 void positionUpdated( long ); // When the media file progresses 108 void positionUpdated( long ); // When the media file progresses
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();
112 114
@@ -114,6 +116,7 @@ private:
114 bool isStreaming; 116 bool isStreaming;
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;
119 bool usePlaylist; 122 bool usePlaylist;
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,7 +1,5 @@
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>
7#include <qpe/fileselector.h> 5#include <qpe/fileselector.h>
@@ -45,17 +43,6 @@
45#include "audiowidget.h" 43#include "audiowidget.h"
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
61#define CAN_SAVE_LOAD_PLAYLISTS 48#define CAN_SAVE_LOAD_PLAYLISTS
@@ -1010,7 +997,7 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
1010 case Key_F11: //menu 997 case Key_F11: //menu
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
1016// doUnblank(); 1003// doUnblank();
@@ -1079,27 +1066,7 @@ void PlayListWidget::keyPressEvent( QKeyEvent *)
1079// } 1066// }
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) {
1105 1072
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
@@ -42,7 +42,7 @@ public:
42/* QTimer * menuTimer; */ 42/* QTimer * menuTimer; */
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();
48 bool last(); 48 bool last();
@@ -56,11 +56,9 @@ protected:
56void keyReleaseEvent( QKeyEvent *e); 56void 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 &);
66 64
@@ -72,7 +70,7 @@ private:
72 void populateVideoView(); 70 void populateVideoView();
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();
78 void scanForAudio(); 76 void scanForAudio();