Diffstat (limited to 'core/multimedia/opieplayer/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index 6c743ec..15f6928 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp | |||
@@ -18,18 +18,20 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | 21 | ||
22 | #include <qmessagebox.h> | ||
23 | |||
24 | #include "mediaplayer.h" | 22 | #include "mediaplayer.h" |
25 | #include "playlistwidget.h" | 23 | #include "playlistwidget.h" |
26 | #include "audiowidget.h" | 24 | #include "audiowidget.h" |
27 | #include "loopcontrol.h" | 25 | #include "loopcontrol.h" |
28 | #include "audiodevice.h" | 26 | #include "audiodevice.h" |
29 | |||
30 | #include "mediaplayerstate.h" | 27 | #include "mediaplayerstate.h" |
31 | 28 | ||
29 | /* OPIE */ | ||
30 | #include <opie2/odebug.h> | ||
31 | |||
32 | /* QT */ | ||
33 | #include <qmessagebox.h> | ||
32 | 34 | ||
33 | extern AudioWidget *audioUI; | 35 | extern AudioWidget *audioUI; |
34 | extern PlayListWidget *playList; | 36 | extern PlayListWidget *playList; |
35 | extern LoopControl *loopControl; | 37 | extern LoopControl *loopControl; |
@@ -72,9 +74,9 @@ void MediaPlayer::play() { | |||
72 | } | 74 | } |
73 | 75 | ||
74 | 76 | ||
75 | void MediaPlayer::setPlaying( bool play ) { | 77 | void MediaPlayer::setPlaying( bool play ) { |
76 | // qDebug("MediaPlayer setPlaying %d", play); | 78 | // odebug << "MediaPlayer setPlaying " << play << "" << oendl; |
77 | if ( !play ) { | 79 | if ( !play ) { |
78 | mediaPlayerState->setPaused( FALSE ); | 80 | mediaPlayerState->setPaused( FALSE ); |
79 | loopControl->stop( FALSE ); | 81 | loopControl->stop( FALSE ); |
80 | return; | 82 | return; |
@@ -83,11 +85,11 @@ void MediaPlayer::setPlaying( bool play ) { | |||
83 | if ( mediaPlayerState->paused() ) { | 85 | if ( mediaPlayerState->paused() ) { |
84 | mediaPlayerState->setPaused( FALSE ); | 86 | mediaPlayerState->setPaused( FALSE ); |
85 | return; | 87 | return; |
86 | } | 88 | } |
87 | // qDebug("about to ctrash"); | 89 | // odebug << "about to ctrash" << oendl; |
88 | const DocLnk *playListCurrent = playList->current(); | 90 | const DocLnk *playListCurrent = playList->current(); |
89 | 91 | ||
90 | if ( playListCurrent != NULL ) { | 92 | if ( playListCurrent != NULL ) { |
91 | loopControl->stop( TRUE ); | 93 | loopControl->stop( TRUE ); |
92 | currentFile = playListCurrent; | 94 | currentFile = playListCurrent; |
93 | } | 95 | } |
@@ -170,9 +172,9 @@ void MediaPlayer::startDecreasingVolume() { | |||
170 | void MediaPlayer::startIncreasingVolume() { | 172 | void MediaPlayer::startIncreasingVolume() { |
171 | volumeDirection = +1; | 173 | volumeDirection = +1; |
172 | startTimer( 100 ); | 174 | startTimer( 100 ); |
173 | AudioDevice::increaseVolume(); | 175 | AudioDevice::increaseVolume(); |
174 | 176 | ||
175 | } | 177 | } |
176 | 178 | ||
177 | bool drawnOnScreenDisplay = FALSE; | 179 | bool drawnOnScreenDisplay = FALSE; |
178 | unsigned int onScreenDisplayVolume = 0; | 180 | unsigned int onScreenDisplayVolume = 0; |
@@ -190,9 +192,9 @@ void MediaPlayer::stopChangingVolume() { | |||
190 | } | 192 | } |
191 | 193 | ||
192 | 194 | ||
193 | void MediaPlayer::timerEvent( QTimerEvent * ) { | 195 | void MediaPlayer::timerEvent( QTimerEvent * ) { |
194 | // qDebug("timer"); | 196 | // odebug << "timer" << oendl; |
195 | if ( volumeDirection == +1 ) | 197 | if ( volumeDirection == +1 ) |
196 | AudioDevice::increaseVolume(); | 198 | AudioDevice::increaseVolume(); |
197 | else if ( volumeDirection == -1 ) | 199 | else if ( volumeDirection == -1 ) |
198 | AudioDevice::decreaseVolume(); | 200 | AudioDevice::decreaseVolume(); |
@@ -202,9 +204,9 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
202 | AudioDevice::getVolume( l, r, m ); | 204 | AudioDevice::getVolume( l, r, m ); |
203 | v = ((l + r) * 11) / (2*0xFFFF); | 205 | v = ((l + r) * 11) / (2*0xFFFF); |
204 | 206 | ||
205 | if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { | 207 | if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { |
206 | // qDebug("returning %d, %d, %d, %d", v, l, r, m); | 208 | // odebug << "returning " << v << ", " << l << ", " << r << ", " << m << "" << oendl; |
207 | return; | 209 | return; |
208 | } | 210 | } |
209 | 211 | ||
210 | int w = audioUI->width(); | 212 | int w = audioUI->width(); |
@@ -229,11 +231,11 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
229 | p.setFont( f ); | 231 | p.setFont( f ); |
230 | p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); | 232 | p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); |
231 | 233 | ||
232 | for ( unsigned int i = 0; i < 10; i++ ) { | 234 | for ( unsigned int i = 0; i < 10; i++ ) { |
233 | if ( v > i ) | 235 | if ( v > i ) |
234 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); | 236 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); |
235 | else | 237 | else |
236 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); | 238 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); |
237 | } | 239 | } |
238 | } | 240 | } |
239 | 241 | ||
@@ -248,9 +250,9 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | |||
248 | break; | 250 | break; |
249 | case Key_F11: //menu | 251 | case Key_F11: //menu |
250 | break; | 252 | break; |
251 | case Key_F12: //home | 253 | case Key_F12: //home |
252 | // qDebug("Blank here"); | 254 | // odebug << "Blank here" << oendl; |
253 | break; | 255 | break; |
254 | case Key_F13: //mail | 256 | case Key_F13: //mail |
255 | break; | 257 | break; |
256 | } | 258 | } |