author | llornkcor <llornkcor> | 2002-04-21 22:23:53 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-21 22:23:53 (UTC) |
commit | 27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6 (patch) (unidiff) | |
tree | 05f6e301fd80c5551301ad88c19c3bcb061834ac | |
parent | 53a4a3f6398640d182a067a8ffef9b402cd35d7a (diff) | |
download | opie-27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6.zip opie-27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6.tar.gz opie-27522ce8deaa0bdc23a6b88002bc1d2e5f918ce6.tar.bz2 |
comment out grabKeyboard stuff till that function works properly
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 38 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.h | 6 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 51 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 2 |
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 | |||
@@ -16,81 +16,81 @@ | |||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | #include <qpe/qlibrary.h> | 22 | #include <qpe/qlibrary.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | 25 | ||
26 | #include <qmainwindow.h> | 26 | #include <qmainwindow.h> |
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qwidgetstack.h> | 28 | #include <qwidgetstack.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | 30 | ||
31 | #include "mediaplayer.h" | 31 | #include "mediaplayer.h" |
32 | #include "playlistwidget.h" | 32 | #include "playlistwidget.h" |
33 | #include "audiowidget.h" | 33 | #include "audiowidget.h" |
34 | #include "loopcontrol.h" | 34 | #include "loopcontrol.h" |
35 | #include "audiodevice.h" | 35 | #include "audiodevice.h" |
36 | 36 | ||
37 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
38 | 38 | ||
39 | 39 | ||
40 | extern AudioWidget *audioUI; | 40 | extern AudioWidget *audioUI; |
41 | extern PlayListWidget *playList; | 41 | extern PlayListWidget *playList; |
42 | extern LoopControl *loopControl; | 42 | extern LoopControl *loopControl; |
43 | extern MediaPlayerState *mediaPlayerState; | 43 | extern MediaPlayerState *mediaPlayerState; |
44 | 44 | ||
45 | 45 | ||
46 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | 46 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) |
47 | : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { | 47 | : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { |
48 | QPEApplication::grabKeyboard(); | 48 | |
49 | // QPEApplication::grabKeyboard(); | ||
50 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | ||
49 | 51 | ||
50 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); | 52 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); |
51 | connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); | 53 | connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); |
52 | connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); | 54 | connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); |
53 | connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); | 55 | connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); |
54 | 56 | ||
55 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 57 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
56 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 58 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
57 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 59 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
58 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 60 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
59 | } | 61 | } |
60 | 62 | ||
61 | 63 | ||
62 | MediaPlayer::~MediaPlayer() { | 64 | MediaPlayer::~MediaPlayer() { |
63 | QPEApplication::grabKeyboard(); | ||
64 | QPEApplication::ungrabKeyboard(); | ||
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | void MediaPlayer::pauseCheck( bool b ) { | 68 | void MediaPlayer::pauseCheck( bool b ) { |
69 | // Only pause if playing | 69 | // Only pause if playing |
70 | if ( b && !mediaPlayerState->playing() ) | 70 | if ( b && !mediaPlayerState->playing() ) |
71 | mediaPlayerState->setPaused( FALSE ); | 71 | mediaPlayerState->setPaused( FALSE ); |
72 | } | 72 | } |
73 | 73 | ||
74 | 74 | ||
75 | void MediaPlayer::play() { | 75 | void MediaPlayer::play() { |
76 | mediaPlayerState->setPlaying( FALSE ); | 76 | mediaPlayerState->setPlaying( FALSE ); |
77 | mediaPlayerState->setPlaying( TRUE ); | 77 | mediaPlayerState->setPlaying( TRUE ); |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | void MediaPlayer::setPlaying( bool play ) { | 81 | void MediaPlayer::setPlaying( bool play ) { |
82 | if ( !play ) { | 82 | if ( !play ) { |
83 | mediaPlayerState->setPaused( FALSE ); | 83 | mediaPlayerState->setPaused( FALSE ); |
84 | loopControl->stop( FALSE ); | 84 | loopControl->stop( FALSE ); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | 87 | ||
88 | if ( mediaPlayerState->paused() ) { | 88 | if ( mediaPlayerState->paused() ) { |
89 | mediaPlayerState->setPaused( FALSE ); | 89 | mediaPlayerState->setPaused( FALSE ); |
90 | return; | 90 | return; |
91 | } | 91 | } |
92 | 92 | ||
93 | const DocLnk *playListCurrent = playList->current(); | 93 | const DocLnk *playListCurrent = playList->current(); |
94 | if ( playListCurrent != NULL ) { | 94 | if ( playListCurrent != NULL ) { |
95 | loopControl->stop( TRUE ); | 95 | loopControl->stop( TRUE ); |
96 | currentFile = playListCurrent; | 96 | currentFile = playListCurrent; |
@@ -156,32 +156,64 @@ void MediaPlayer::next() { | |||
156 | play(); | 156 | play(); |
157 | } else | 157 | } else |
158 | mediaPlayerState->setList(); | 158 | mediaPlayerState->setList(); |
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | void MediaPlayer::startDecreasingVolume() { | 162 | void MediaPlayer::startDecreasingVolume() { |
163 | volumeDirection = -1; | 163 | volumeDirection = -1; |
164 | startTimer( 100 ); | 164 | startTimer( 100 ); |
165 | AudioDevice::decreaseVolume(); | 165 | AudioDevice::decreaseVolume(); |
166 | } | 166 | } |
167 | 167 | ||
168 | 168 | ||
169 | void MediaPlayer::startIncreasingVolume() { | 169 | void MediaPlayer::startIncreasingVolume() { |
170 | volumeDirection = +1; | 170 | volumeDirection = +1; |
171 | startTimer( 100 ); | 171 | startTimer( 100 ); |
172 | AudioDevice::increaseVolume(); | 172 | AudioDevice::increaseVolume(); |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | void MediaPlayer::stopChangingVolume() { | 176 | void MediaPlayer::stopChangingVolume() { |
177 | killTimers(); | 177 | killTimers(); |
178 | } | 178 | } |
179 | 179 | ||
180 | 180 | ||
181 | void MediaPlayer::timerEvent( QTimerEvent * ) { | 181 | void MediaPlayer::timerEvent( QTimerEvent * ) { |
182 | if ( volumeDirection == +1 ) | 182 | if ( volumeDirection == +1 ) |
183 | AudioDevice::increaseVolume(); | 183 | AudioDevice::increaseVolume(); |
184 | else if ( volumeDirection == -1 ) | 184 | else if ( volumeDirection == -1 ) |
185 | AudioDevice::decreaseVolume(); | 185 | AudioDevice::decreaseVolume(); |
186 | } | 186 | } |
187 | 187 | ||
188 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | ||
189 | switch ( e->key() ) { | ||
190 | ////////////////////////////// Zaurus keys | ||
191 | case Key_Home: | ||
192 | break; | ||
193 | case Key_F9: //activity | ||
194 | break; | ||
195 | case Key_F10: //contacts | ||
196 | break; | ||
197 | case Key_F11: //menu | ||
198 | break; | ||
199 | case Key_F12: //home | ||
200 | qDebug("Blank here"); | ||
201 | break; | ||
202 | case Key_F13: //mail | ||
203 | break; | ||
204 | } | ||
205 | } | ||
206 | |||
207 | void MediaPlayer::doBlank() { | ||
208 | |||
209 | } | ||
210 | |||
211 | void MediaPlayer::doUnblank() { | ||
212 | |||
213 | } | ||
214 | |||
215 | void MediaPlayer::cleanUp() { | ||
216 | // QPEApplication::grabKeyboard(); | ||
217 | // QPEApplication::ungrabKeyboard(); | ||
218 | |||
219 | } | ||
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 | |||
@@ -18,42 +18,44 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef MEDIA_PLAYER_H | 20 | #ifndef MEDIA_PLAYER_H |
21 | #define MEDIA_PLAYER_H | 21 | #define MEDIA_PLAYER_H |
22 | 22 | ||
23 | #include <qmainwindow.h> | 23 | #include <qmainwindow.h> |
24 | #include <qframe.h> | 24 | #include <qframe.h> |
25 | #include <qpe/qlibrary.h> | 25 | #include <qpe/qlibrary.h> |
26 | #include <qpe/mediaplayerplugininterface.h> | 26 | #include <qpe/mediaplayerplugininterface.h> |
27 | 27 | ||
28 | 28 | ||
29 | class DocLnk; | 29 | class DocLnk; |
30 | 30 | ||
31 | 31 | ||
32 | class MediaPlayer : public QObject { | 32 | class MediaPlayer : public QObject { |
33 | Q_OBJECT | 33 | Q_OBJECT |
34 | public: | 34 | public: |
35 | MediaPlayer( QObject *parent, const char *name ); | 35 | MediaPlayer( QObject *parent, const char *name ); |
36 | ~MediaPlayer(); | 36 | ~MediaPlayer(); |
37 | 37 | ||
38 | private slots: | 38 | private slots: |
39 | void setPlaying( bool ); | 39 | void setPlaying( bool ); |
40 | void pauseCheck( bool ); | 40 | void pauseCheck( bool ); |
41 | void play(); | 41 | void play(); |
42 | void next(); | 42 | void next(); |
43 | void prev(); | 43 | void prev(); |
44 | void startIncreasingVolume(); | 44 | void startIncreasingVolume(); |
45 | void startDecreasingVolume(); | 45 | void startDecreasingVolume(); |
46 | void stopChangingVolume(); | 46 | void stopChangingVolume(); |
47 | 47 | ||
48 | protected: | 48 | protected: |
49 | void timerEvent( QTimerEvent *e ); | 49 | void timerEvent( QTimerEvent *e ); |
50 | // void keyReleaseEvent( QKeyEvent *e); | 50 | void keyReleaseEvent( QKeyEvent *e); |
51 | 51 | void doBlank(); | |
52 | void doUnblank(); | ||
53 | void cleanUp(); | ||
52 | private: | 54 | private: |
53 | int volumeDirection; | 55 | int volumeDirection; |
54 | const DocLnk *currentFile; | 56 | const DocLnk *currentFile; |
55 | }; | 57 | }; |
56 | 58 | ||
57 | 59 | ||
58 | #endif // MEDIA_PLAYER_H | 60 | #endif // MEDIA_PLAYER_H |
59 | 61 | ||
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 | |||
@@ -1,96 +1,108 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // code added by L. J. Potter Sat 03-02-2002 06:17:54 | 20 | // code added by L. J. Potter Sat 03-02-2002 06:17:54 |
21 | #define QTOPIA_INTERNAL_FSLP | 21 | #define QTOPIA_INTERNAL_FSLP |
22 | #include <qpe/qcopenvelope_qws.h> | ||
22 | 23 | ||
23 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
24 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
25 | #include <qpe/fileselector.h> | 26 | #include <qpe/fileselector.h> |
26 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
27 | #include <qpe/lnkproperties.h> | 28 | #include <qpe/lnkproperties.h> |
28 | #include <qpe/storage.h> | 29 | #include <qpe/storage.h> |
29 | 30 | ||
30 | #include <qpe/applnk.h> | 31 | #include <qpe/applnk.h> |
31 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
32 | #include <qpe/global.h> | 33 | #include <qpe/global.h> |
33 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
34 | 35 | ||
35 | #include <qaction.h> | 36 | #include <qaction.h> |
36 | #include <qimage.h> | 37 | #include <qimage.h> |
37 | #include <qfile.h> | 38 | #include <qfile.h> |
38 | #include <qdir.h> | 39 | #include <qdir.h> |
39 | #include <qlayout.h> | 40 | #include <qlayout.h> |
40 | #include <qlabel.h> | 41 | #include <qlabel.h> |
41 | #include <qlist.h> | 42 | #include <qlist.h> |
42 | #include <qlistbox.h> | 43 | #include <qlistbox.h> |
43 | #include <qmainwindow.h> | 44 | #include <qmainwindow.h> |
44 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
45 | #include <qtoolbutton.h> | 46 | #include <qtoolbutton.h> |
46 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
47 | #include <qlistview.h> | 48 | #include <qlistview.h> |
48 | #include <qpoint.h> | 49 | #include <qpoint.h> |
49 | #include <qlineedit.h> | 50 | #include <qlineedit.h> |
50 | #include <qpushbutton.h> | 51 | #include <qpushbutton.h> |
51 | #include <qregexp.h> | 52 | #include <qregexp.h> |
52 | 53 | ||
53 | //#include <qtimer.h> | 54 | //#include <qtimer.h> |
54 | 55 | ||
55 | #include "playlistselection.h" | 56 | #include "playlistselection.h" |
56 | #include "playlistwidget.h" | 57 | #include "playlistwidget.h" |
57 | #include "mediaplayerstate.h" | 58 | #include "mediaplayerstate.h" |
58 | 59 | ||
59 | #include "inputDialog.h" | 60 | #include "inputDialog.h" |
60 | 61 | ||
61 | #include <stdlib.h> | 62 | #include <stdlib.h> |
62 | #include "audiowidget.h" | 63 | #include "audiowidget.h" |
63 | #include "videowidget.h" | 64 | #include "videowidget.h" |
64 | 65 | ||
66 | #include <unistd.h> | ||
67 | #include <sys/file.h> | ||
68 | #include <sys/ioctl.h> | ||
69 | #include <sys/soundcard.h> | ||
70 | |||
71 | // for setBacklight() | ||
72 | #include <linux/fb.h> | ||
73 | #include <sys/types.h> | ||
74 | #include <sys/stat.h> | ||
75 | #include <stdlib.h> | ||
76 | |||
65 | #define BUTTONS_ON_TOOLBAR | 77 | #define BUTTONS_ON_TOOLBAR |
66 | #define SIDE_BUTTONS | 78 | #define SIDE_BUTTONS |
67 | #define CAN_SAVE_LOAD_PLAYLISTS | 79 | #define CAN_SAVE_LOAD_PLAYLISTS |
68 | 80 | ||
69 | extern AudioWidget *audioUI; | 81 | extern AudioWidget *audioUI; |
70 | extern VideoWidget *videoUI; | 82 | extern VideoWidget *videoUI; |
71 | extern MediaPlayerState *mediaPlayerState; | 83 | extern MediaPlayerState *mediaPlayerState; |
72 | 84 | ||
73 | // class myFileSelector { | 85 | // class myFileSelector { |
74 | 86 | ||
75 | // }; | 87 | // }; |
76 | class PlayListWidgetPrivate { | 88 | class PlayListWidgetPrivate { |
77 | public: | 89 | public: |
78 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; | 90 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; |
79 | QFrame *playListFrame; | 91 | QFrame *playListFrame; |
80 | FileSelector *files; | 92 | FileSelector *files; |
81 | PlayListSelection *selectedFiles; | 93 | PlayListSelection *selectedFiles; |
82 | bool setDocumentUsed; | 94 | bool setDocumentUsed; |
83 | DocLnk *current; | 95 | DocLnk *current; |
84 | }; | 96 | }; |
85 | 97 | ||
86 | 98 | ||
87 | class ToolButton : public QToolButton { | 99 | class ToolButton : public QToolButton { |
88 | public: | 100 | public: |
89 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 101 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
90 | : QToolButton( parent, name ) { | 102 | : QToolButton( parent, name ) { |
91 | setTextLabel( name ); | 103 | setTextLabel( name ); |
92 | setPixmap( Resource::loadPixmap( icon ) ); | 104 | setPixmap( Resource::loadPixmap( icon ) ); |
93 | setAutoRaise( TRUE ); | 105 | setAutoRaise( TRUE ); |
94 | setFocusPolicy( QWidget::NoFocus ); | 106 | setFocusPolicy( QWidget::NoFocus ); |
95 | setToggleButton( t ); | 107 | setToggleButton( t ); |
96 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 108 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
@@ -1024,43 +1036,72 @@ void PlayListWidget::openFile() { | |||
1024 | qDebug(filename); | 1036 | qDebug(filename); |
1025 | DocLnk lnk; | 1037 | DocLnk lnk; |
1026 | // if(filename.left(7) == "http://") | 1038 | // if(filename.left(7) == "http://") |
1027 | // name= filename.right(filename.length()-filename.find("http://")-7); | 1039 | // name= filename.right(filename.length()-filename.find("http://")-7); |
1028 | // else name = filename; | 1040 | // else name = filename; |
1029 | // qDebug("name is "+name); | 1041 | // qDebug("name is "+name); |
1030 | // lnk.setComment(filename); | 1042 | // lnk.setComment(filename); |
1031 | lnk.setName(filename); //sets file name | 1043 | lnk.setName(filename); //sets file name |
1032 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") | 1044 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") |
1033 | filename += "/"; | 1045 | filename += "/"; |
1034 | lnk.setFile(filename); //sets File property | 1046 | lnk.setFile(filename); //sets File property |
1035 | 1047 | ||
1036 | lnk.setType("audio/x-mpegurl"); | 1048 | lnk.setType("audio/x-mpegurl"); |
1037 | lnk.setExec("opieplayer"); | 1049 | lnk.setExec("opieplayer"); |
1038 | lnk.setIcon("opieplayer/MPEGPlayer"); | 1050 | lnk.setIcon("opieplayer/MPEGPlayer"); |
1039 | 1051 | ||
1040 | if(!lnk.writeLink()) | 1052 | if(!lnk.writeLink()) |
1041 | qDebug("Writing doclink did not work"); | 1053 | qDebug("Writing doclink did not work"); |
1042 | d->selectedFiles->addToSelection( lnk); | 1054 | d->selectedFiles->addToSelection( lnk); |
1043 | // if(fileDlg2) | 1055 | // if(fileDlg2) |
1044 | // delete fileDlg2; | 1056 | // delete fileDlg2; |
1045 | } | 1057 | } |
1046 | 1058 | ||
1047 | if(fileDlg) | 1059 | if(fileDlg) |
1048 | delete fileDlg; | 1060 | delete fileDlg; |
1049 | } | 1061 | } |
1050 | 1062 | ||
1051 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 1063 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
1052 | { | 1064 | { |
1053 | switch ( e->key() ) { | 1065 | switch ( e->key() ) { |
1054 | ////////////////////////////// Zaurus keys | 1066 | ////////////////////////////// Zaurus keys |
1055 | case Key_F9: //activity | 1067 | case Key_F9: //activity |
1056 | if(audioUI->isHidden()) | 1068 | // if(audioUI->isHidden()) |
1057 | audioUI->showMaximized(); | 1069 | // audioUI->showMaximized(); |
1058 | break; | 1070 | break; |
1059 | case Key_F10: //contacts | 1071 | case Key_F10: //contacts |
1060 | if( videoUI->isHidden()) | 1072 | // if( videoUI->isHidden()) |
1061 | videoUI->showMaximized(); | 1073 | // videoUI->showMaximized(); |
1062 | 1074 | break; | |
1075 | case Key_F11: //menu | ||
1076 | break; | ||
1077 | case Key_F12: //home | ||
1078 | // doBlank(); | ||
1079 | break; | ||
1080 | case Key_F13: //mail | ||
1081 | // doUnblank(); | ||
1063 | break; | 1082 | break; |
1064 | 1083 | ||
1065 | } | 1084 | } |
1066 | } | 1085 | } |
1086 | |||
1087 | void PlayListWidget::doBlank() { | ||
1088 | qDebug("do blanking"); | ||
1089 | fd=open("/dev/fb0",O_RDWR); | ||
1090 | if (fd != -1) { | ||
1091 | ioctl(fd,FBIOBLANK,1); | ||
1092 | // close(fd); | ||
1093 | } | ||
1094 | } | ||
1095 | |||
1096 | void PlayListWidget::doUnblank() { | ||
1097 | // this crashes opieplayer with a segfault | ||
1098 | // int fd; | ||
1099 | // fd=open("/dev/fb0",O_RDWR); | ||
1100 | qDebug("do unblanking"); | ||
1101 | if (fd != -1) { | ||
1102 | ioctl(fd,FBIOBLANK,0); | ||
1103 | close(fd); | ||
1104 | } | ||
1105 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | ||
1106 | h <<-3;// v[1]; // -3 Force on | ||
1107 | } | ||
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 | |||
@@ -28,76 +28,80 @@ | |||
28 | 28 | ||
29 | /* #include <qtimer.h> */ | 29 | /* #include <qtimer.h> */ |
30 | 30 | ||
31 | 31 | ||
32 | class PlayListWidgetPrivate; | 32 | class PlayListWidgetPrivate; |
33 | class Config; | 33 | class Config; |
34 | class QListViewItem; | 34 | class QListViewItem; |
35 | class QListView; | 35 | class QListView; |
36 | class QPoint; | 36 | class QPoint; |
37 | class QAction; | 37 | class QAction; |
38 | class QLabel; | 38 | class QLabel; |
39 | 39 | ||
40 | class PlayListWidget : public QMainWindow { | 40 | class PlayListWidget : public QMainWindow { |
41 | Q_OBJECT | 41 | Q_OBJECT |
42 | public: | 42 | public: |
43 | PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); | 43 | PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); |
44 | ~PlayListWidget(); | 44 | ~PlayListWidget(); |
45 | QTabWidget * tabWidget; | 45 | QTabWidget * tabWidget; |
46 | QAction *fullScreenButton, *scaleButton; | 46 | QAction *fullScreenButton, *scaleButton; |
47 | DocLnkSet files; | 47 | DocLnkSet files; |
48 | DocLnkSet vFiles; | 48 | DocLnkSet vFiles; |
49 | QListView *audioView, *videoView, *playlistView; | 49 | QListView *audioView, *videoView, *playlistView; |
50 | QLabel *libString; | 50 | QLabel *libString; |
51 | bool fromSetDocument; | 51 | bool fromSetDocument; |
52 | bool insanityBool; | 52 | bool insanityBool; |
53 | QString setDocFileRef; | 53 | QString setDocFileRef; |
54 | // retrieve the current playlist entry (media file link) | 54 | // retrieve the current playlist entry (media file link) |
55 | const DocLnk *current(); | 55 | const DocLnk *current(); |
56 | void useSelectedDocument(); | 56 | void useSelectedDocument(); |
57 | /* QTimer * menuTimer; */ | 57 | /* QTimer * menuTimer; */ |
58 | FileSelector* playLists; | 58 | FileSelector* playLists; |
59 | QPushButton *tbDeletePlaylist; | 59 | QPushButton *tbDeletePlaylist; |
60 | int fd; | ||
60 | public slots: | 61 | public slots: |
61 | bool first(); | 62 | bool first(); |
62 | bool last(); | 63 | bool last(); |
63 | bool next(); | 64 | bool next(); |
64 | bool prev(); | 65 | bool prev(); |
65 | /* void setFullScreen(); */ | 66 | /* void setFullScreen(); */ |
66 | /* void setScaled(); */ | 67 | /* void setScaled(); */ |
67 | protected: | 68 | protected: |
68 | /* void contentsMousePressEvent( QMouseEvent * e ); */ | 69 | /* void contentsMousePressEvent( QMouseEvent * e ); */ |
69 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ | 70 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ |
70 | void keyReleaseEvent( QKeyEvent *e); | 71 | void keyReleaseEvent( QKeyEvent *e); |
71 | private: | 72 | private: |
73 | void doBlank(); | ||
74 | void doUnblank(); | ||
75 | |||
72 | void initializeStates(); | 76 | void initializeStates(); |
73 | void readConfig( Config& cfg ); | 77 | void readConfig( Config& cfg ); |
74 | void writeConfig( Config& cfg ) const; | 78 | void writeConfig( Config& cfg ) const; |
75 | PlayListWidgetPrivate *d; // Private implementation data | 79 | PlayListWidgetPrivate *d; // Private implementation data |
76 | void populateAudioView(); | 80 | void populateAudioView(); |
77 | void populateVideoView(); | 81 | void populateVideoView(); |
78 | private slots: | 82 | private slots: |
79 | void openFile(); | 83 | void openFile(); |
80 | void setDocument( const QString& fileref ); | 84 | void setDocument( const QString& fileref ); |
81 | void addToSelection( const DocLnk& ); // Add a media file to the playlist | 85 | void addToSelection( const DocLnk& ); // Add a media file to the playlist |
82 | void addToSelection( QListViewItem* ); // Add a media file to the playlist | 86 | void addToSelection( QListViewItem* ); // Add a media file to the playlist |
83 | void setActiveWindow(); // need to handle this to show the right view | 87 | void setActiveWindow(); // need to handle this to show the right view |
84 | void setPlaylist( bool ); // Show/Hide the playlist | 88 | void setPlaylist( bool ); // Show/Hide the playlist |
85 | void setView( char ); | 89 | void setView( char ); |
86 | void clearList(); | 90 | void clearList(); |
87 | void addAllToList(); | 91 | void addAllToList(); |
88 | void addAllMusicToList(); | 92 | void addAllMusicToList(); |
89 | void addAllVideoToList(); | 93 | void addAllVideoToList(); |
90 | void saveList(); // Save the playlist | 94 | void saveList(); // Save the playlist |
91 | void loadList( const DocLnk &); // Load a playlist | 95 | void loadList( const DocLnk &); // Load a playlist |
92 | void playIt( QListViewItem *); | 96 | void playIt( QListViewItem *); |
93 | 97 | ||
94 | void btnPlay(bool); | 98 | void btnPlay(bool); |
95 | void deletePlaylist(); | 99 | void deletePlaylist(); |
96 | void addSelected(); | 100 | void addSelected(); |
97 | void removeSelected(); | 101 | void removeSelected(); |
98 | void tabChanged(QWidget*); | 102 | void tabChanged(QWidget*); |
99 | void viewPressed( int, QListViewItem *, const QPoint&, int); | 103 | void viewPressed( int, QListViewItem *, const QPoint&, int); |
100 | void playlistViewPressed( int, QListViewItem *, const QPoint&, int); | 104 | void playlistViewPressed( int, QListViewItem *, const QPoint&, int); |
101 | void playSelected(); | 105 | void playSelected(); |
102 | void listDelete(); | 106 | void listDelete(); |
103 | 107 | ||
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 | |||
@@ -403,65 +403,65 @@ bool VideoWidget::playVideo() { | |||
403 | 403 | ||
404 | QPainter p( this ); | 404 | QPainter p( this ); |
405 | 405 | ||
406 | // Image changed size, therefore need to blank the possibly unpainted regions first | 406 | // Image changed size, therefore need to blank the possibly unpainted regions first |
407 | if ( scaledWidth != w || scaledHeight != h ) { | 407 | if ( scaledWidth != w || scaledHeight != h ) { |
408 | p.setBrush( QBrush( Qt::black ) ); | 408 | p.setBrush( QBrush( Qt::black ) ); |
409 | p.drawRect( 9, 20, 220, 160 ); | 409 | p.drawRect( 9, 20, 220, 160 ); |
410 | } | 410 | } |
411 | 411 | ||
412 | scaledWidth = w; | 412 | scaledWidth = w; |
413 | scaledHeight = h; | 413 | scaledHeight = h; |
414 | 414 | ||
415 | if ( result ) { | 415 | if ( result ) { |
416 | p.drawImage( 9 + (220 - scaledWidth) / 2, 20 + (160 - scaledHeight) / 2, *currentFrame, 0, 0, scaledWidth, scaledHeight ); | 416 | p.drawImage( 9 + (220 - scaledWidth) / 2, 20 + (160 - scaledHeight) / 2, *currentFrame, 0, 0, scaledWidth, scaledHeight ); |
417 | } | 417 | } |
418 | 418 | ||
419 | } | 419 | } |
420 | 420 | ||
421 | return result; | 421 | return result; |
422 | } | 422 | } |
423 | 423 | ||
424 | 424 | ||
425 | 425 | ||
426 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) | 426 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) |
427 | { | 427 | { |
428 | switch ( e->key() ) { | 428 | switch ( e->key() ) { |
429 | ////////////////////////////// Zaurus keys | 429 | ////////////////////////////// Zaurus keys |
430 | case Key_Home: | 430 | case Key_Home: |
431 | break; | 431 | break; |
432 | case Key_F9: //activity | 432 | case Key_F9: //activity |
433 | break; | 433 | break; |
434 | case Key_F10: //contacts | 434 | case Key_F10: //contacts |
435 | hide(); | 435 | // hide(); |
436 | break; | 436 | break; |
437 | case Key_F11: //menu | 437 | case Key_F11: //menu |
438 | break; | 438 | break; |
439 | case Key_F12: //home | 439 | case Key_F12: //home |
440 | break; | 440 | break; |
441 | case Key_F13: //mail | 441 | case Key_F13: //mail |
442 | break; | 442 | break; |
443 | case Key_Space: { | 443 | case Key_Space: { |
444 | if(mediaPlayerState->playing()) { | 444 | if(mediaPlayerState->playing()) { |
445 | mediaPlayerState->setPlaying(FALSE); | 445 | mediaPlayerState->setPlaying(FALSE); |
446 | } else { | 446 | } else { |
447 | mediaPlayerState->setPlaying(TRUE); | 447 | mediaPlayerState->setPlaying(TRUE); |
448 | } | 448 | } |
449 | } | 449 | } |
450 | break; | 450 | break; |
451 | case Key_Down: | 451 | case Key_Down: |
452 | // toggleButton(6); | 452 | // toggleButton(6); |
453 | // emit lessClicked(); | 453 | // emit lessClicked(); |
454 | // emit lessReleased(); | 454 | // emit lessReleased(); |
455 | // toggleButton(6); | 455 | // toggleButton(6); |
456 | break; | 456 | break; |
457 | case Key_Up: | 457 | case Key_Up: |
458 | // toggleButton(5); | 458 | // toggleButton(5); |
459 | // emit moreClicked(); | 459 | // emit moreClicked(); |
460 | // emit moreReleased(); | 460 | // emit moreReleased(); |
461 | // toggleButton(5); | 461 | // toggleButton(5); |
462 | break; | 462 | break; |
463 | case Key_Right: | 463 | case Key_Right: |
464 | mediaPlayerState->setNext(); | 464 | mediaPlayerState->setNext(); |
465 | break; | 465 | break; |
466 | case Key_Left: | 466 | case Key_Left: |
467 | mediaPlayerState->setPrev(); | 467 | mediaPlayerState->setPrev(); |