author | llornkcor <llornkcor> | 2002-11-04 00:41:07 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-04 00:41:07 (UTC) |
commit | 08fdebd78a4266642a7bdb2b1ead6e306bda64ad (patch) (unidiff) | |
tree | 8266160d575107b710457c3dfcd84e415268a92d /core | |
parent | dc44b0babe9ffa7b29cc6269596703bab8edf6ab (diff) | |
download | opie-08fdebd78a4266642a7bdb2b1ead6e306bda64ad.zip opie-08fdebd78a4266642a7bdb2b1ead6e306bda64ad.tar.gz opie-08fdebd78a4266642a7bdb2b1ead6e306bda64ad.tar.bz2 |
various
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 76 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 35 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 13 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 59 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.h | 2 |
5 files changed, 92 insertions, 93 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 020f6be..136e06c 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -36,9 +36,4 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | // #ifdef Q_WS_WIN | ||
39 | // #include <windows.h> | ||
40 | // #include <mmsystem.h> | ||
41 | // #include <mmreg.h> | ||
42 | // #endif | ||
43 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) | 38 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) |
44 | #include <fcntl.h> | 39 | #include <fcntl.h> |
@@ -51,9 +46,4 @@ | |||
51 | #endif | 46 | #endif |
52 | 47 | ||
53 | // #if defined(Q_OS_WIN32) | ||
54 | // static const int expectedBytesPerMilliSecond = 2 * 2 * 44000 / 1000; | ||
55 | // static const int timerResolutionMilliSeconds = 30; | ||
56 | // static const int sound_fragment_bytes = timerResolutionMilliSeconds * expectedBytesPerMilliSecond; | ||
57 | // #else | ||
58 | # if defined(QT_QWS_IPAQ) | 48 | # if defined(QT_QWS_IPAQ) |
59 | static const int sound_fragment_shift = 14; | 49 | static const int sound_fragment_shift = 14; |
@@ -102,21 +92,4 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
102 | muted = AudioDevicePrivate::muted; | 92 | muted = AudioDevicePrivate::muted; |
103 | unsigned int volume; | 93 | unsigned int volume; |
104 | // #ifdef Q_OS_WIN32 | ||
105 | // HWAVEOUT handle; | ||
106 | // WAVEFORMATEX formatData; | ||
107 | // formatData.cbSize = sizeof(WAVEFORMATEX); | ||
108 | // formatData.wFormatTag = WAVE_FORMAT_PCM; | ||
109 | // formatData.nAvgBytesPerSec = 4 * 44000; | ||
110 | // formatData.nBlockAlign = 4; | ||
111 | // formatData.nChannels = 2; | ||
112 | // formatData.nSamplesPerSec = 44000; | ||
113 | // formatData.wBitsPerSample = 16; | ||
114 | // waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); | ||
115 | // if ( waveOutGetVolume( handle, (LPDWORD)&volume ) ) | ||
116 | // // qDebug( "get volume of audio device failed" ); | ||
117 | // waveOutClose( handle ); | ||
118 | // leftVolume = volume & 0xFFFF; | ||
119 | // rightVolume = volume >> 16; | ||
120 | // #else | ||
121 | int mixerHandle = open( "/dev/mixer", O_RDWR ); | 94 | int mixerHandle = open( "/dev/mixer", O_RDWR ); |
122 | if ( mixerHandle >= 0 ) { | 95 | if ( mixerHandle >= 0 ) { |
@@ -128,5 +101,4 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
128 | leftVolume = ((volume & 0x00FF) << 16) / 101; | 101 | leftVolume = ((volume & 0x00FF) << 16) / 101; |
129 | rightVolume = ((volume & 0xFF00) << 8) / 101; | 102 | rightVolume = ((volume & 0xFF00) << 8) / 101; |
130 | //#endif | ||
131 | } | 103 | } |
132 | 104 | ||
@@ -143,20 +115,4 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
143 | rightVolume = ( (int)rightVolume < 0 ) ? 0 : (( rightVolume > 0xFFFF ) ? 0xFFFF : rightVolume ); | 115 | rightVolume = ( (int)rightVolume < 0 ) ? 0 : (( rightVolume > 0xFFFF ) ? 0xFFFF : rightVolume ); |
144 | } | 116 | } |
145 | // #ifdef Q_OS_WIN32 | ||
146 | // HWAVEOUT handle; | ||
147 | // WAVEFORMATEX formatData; | ||
148 | // formatData.cbSize = sizeof(WAVEFORMATEX); | ||
149 | // formatData.wFormatTag = WAVE_FORMAT_PCM; | ||
150 | // formatData.nAvgBytesPerSec = 4 * 44000; | ||
151 | // formatData.nBlockAlign = 4; | ||
152 | // formatData.nChannels = 2; | ||
153 | // formatData.nSamplesPerSec = 44000; | ||
154 | // formatData.wBitsPerSample = 16; | ||
155 | // waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); | ||
156 | // unsigned int volume = (rightVolume << 16) | leftVolume; | ||
157 | // if ( waveOutSetVolume( handle, volume ) ) | ||
158 | // // qDebug( "set volume of audio device failed" ); | ||
159 | // waveOutClose( handle ); | ||
160 | // #else | ||
161 | // Volume can be from 0 to 100 which is 101 distinct values | 117 | // Volume can be from 0 to 100 which is 101 distinct values |
162 | unsigned int rV = (rightVolume * 101) >> 16; | 118 | unsigned int rV = (rightVolume * 101) >> 16; |
@@ -191,5 +147,4 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
191 | 147 | ||
192 | 148 | ||
193 | |||
194 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 149 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
195 | qDebug("creating new audio device"); | 150 | qDebug("creating new audio device"); |
@@ -267,7 +222,4 @@ AudioDevice::~AudioDevice() { | |||
267 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; | 222 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; |
268 | 223 | ||
269 | // #ifdef Q_OS_WIN32 | ||
270 | // waveOutClose( (HWAVEOUT)d->handle ); | ||
271 | // #else | ||
272 | # ifndef KEEP_DEVICE_OPEN | 224 | # ifndef KEEP_DEVICE_OPEN |
273 | close( d->handle ); // Now it should be safe to shut the handle | 225 | close( d->handle ); // Now it should be safe to shut the handle |
@@ -275,5 +227,4 @@ AudioDevice::~AudioDevice() { | |||
275 | delete d->unwrittenBuffer; | 227 | delete d->unwrittenBuffer; |
276 | delete d; | 228 | delete d; |
277 | //#endif | ||
278 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | 229 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; |
279 | 230 | ||
@@ -289,18 +240,4 @@ void AudioDevice::volumeChanged( bool muted ) | |||
289 | void AudioDevice::write( char *buffer, unsigned int length ) | 240 | void AudioDevice::write( char *buffer, unsigned int length ) |
290 | { | 241 | { |
291 | // #ifdef Q_OS_WIN32 | ||
292 | // // returns immediately and (to be implemented) emits completedIO() when finished writing | ||
293 | // WAVEHDR *lpWaveHdr = (WAVEHDR *)malloc( sizeof(WAVEHDR) ); | ||
294 | // // maybe the buffer should be copied so that this fool proof, but its a performance hit | ||
295 | // lpWaveHdr->lpData = buffer; | ||
296 | // lpWaveHdr->dwBufferLength = length; | ||
297 | // lpWaveHdr->dwFlags = 0L; | ||
298 | // lpWaveHdr->dwLoops = 0L; | ||
299 | // waveOutPrepareHeader( (HWAVEOUT)d->handle, lpWaveHdr, sizeof(WAVEHDR) ); | ||
300 | // // waveOutWrite returns immediately. the data is sent in the background. | ||
301 | // if ( waveOutWrite( (HWAVEOUT)d->handle, lpWaveHdr, sizeof(WAVEHDR) ) ) | ||
302 | // qDebug( "failed to write block to audio device" ); | ||
303 | // // emit completedIO(); | ||
304 | // #else | ||
305 | int t = ::write( d->handle, buffer, length ); | 242 | int t = ::write( d->handle, buffer, length ); |
306 | if ( t<0 ) t = 0; | 243 | if ( t<0 ) t = 0; |
@@ -339,7 +276,4 @@ unsigned int AudioDevice::bufferSize() const | |||
339 | unsigned int AudioDevice::canWrite() const | 276 | unsigned int AudioDevice::canWrite() const |
340 | { | 277 | { |
341 | // #ifdef Q_OS_WIN32 | ||
342 | // return bufferSize(); // Any better? | ||
343 | // #else | ||
344 | audio_buf_info info; | 278 | audio_buf_info info; |
345 | if ( d->can_GETOSPACE && ioctl(d->handle,SNDCTL_DSP_GETOSPACE,&info) ) { | 279 | if ( d->can_GETOSPACE && ioctl(d->handle,SNDCTL_DSP_GETOSPACE,&info) ) { |
@@ -366,17 +300,8 @@ unsigned int AudioDevice::canWrite() const | |||
366 | return d->bufferSize; | 300 | return d->bufferSize; |
367 | } | 301 | } |
368 | //#endif | ||
369 | } | 302 | } |
370 | 303 | ||
371 | 304 | ||
372 | int AudioDevice::bytesWritten() { | 305 | int AudioDevice::bytesWritten() { |
373 | // #ifdef Q_OS_WIN32 | ||
374 | // MMTIME pmmt = { TIME_BYTES, 0 }; | ||
375 | // if ( ( waveOutGetPosition( (HWAVEOUT)d->handle, &pmmt, sizeof(MMTIME) ) != MMSYSERR_NOERROR ) || ( pmmt.wType != TIME_BYTES ) ) { | ||
376 | // qDebug( "failed to get audio device position" ); | ||
377 | // return -1; | ||
378 | // } | ||
379 | // return pmmt.u.cb; | ||
380 | // #else | ||
381 | int buffered = 0; | 306 | int buffered = 0; |
382 | if ( ioctl( d->handle, SNDCTL_DSP_GETODELAY, &buffered ) ) { | 307 | if ( ioctl( d->handle, SNDCTL_DSP_GETODELAY, &buffered ) ) { |
@@ -385,5 +310,4 @@ int AudioDevice::bytesWritten() { | |||
385 | } | 310 | } |
386 | return buffered; | 311 | return buffered; |
387 | //#endif | ||
388 | } | 312 | } |
389 | 313 | ||
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index d20d560..ef7c8dc 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -147,5 +147,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
147 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 147 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
148 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 148 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
149 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 149 | // connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
150 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 150 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
151 | 151 | ||
@@ -154,5 +154,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
154 | setPosition( mediaPlayerState->position() ); | 154 | setPosition( mediaPlayerState->position() ); |
155 | setLooping( mediaPlayerState->fullscreen() ); | 155 | setLooping( mediaPlayerState->fullscreen() ); |
156 | setPaused( mediaPlayerState->paused() ); | 156 | // setPaused( mediaPlayerState->paused() ); |
157 | setPlaying( mediaPlayerState->playing() ); | 157 | setPlaying( mediaPlayerState->playing() ); |
158 | 158 | ||
@@ -364,5 +364,14 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
364 | emit moreClicked(); | 364 | emit moreClicked(); |
365 | return; | 365 | return; |
366 | case AudioVolumeDown: emit lessClicked(); return; | 366 | case AudioVolumeDown: |
367 | qDebug("less clicked"); | ||
368 | emit lessClicked(); | ||
369 | return; | ||
370 | case AudioForward: | ||
371 | emit forwardClicked(); | ||
372 | return; | ||
373 | case AudioBack: | ||
374 | emit backClicked(); | ||
375 | return; | ||
367 | } | 376 | } |
368 | } else if ( !isOnButton && audioButtons[i].isHeld ) { | 377 | } else if ( !isOnButton && audioButtons[i].isHeld ) { |
@@ -376,7 +385,15 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
376 | setToggleButton( i, FALSE ); | 385 | setToggleButton( i, FALSE ); |
377 | switch (i) { | 386 | switch (i) { |
378 | case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; | 387 | case AudioPlay: |
388 | if( mediaPlayerState->isPaused ) { | ||
389 | mediaPlayerState->setPaused( FALSE ); | ||
390 | return; | ||
391 | } else if( !mediaPlayerState->isPaused ) { | ||
392 | mediaPlayerState->setPaused( TRUE ); | ||
393 | return; | ||
394 | } | ||
395 | // case AudioPlay: mediaPlayerState->setPlaying(audioButtons[i].isDown); return; | ||
379 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; | 396 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; |
380 | case AudioPause: mediaPlayerState->setPaused(audioButtons[i].isDown); return; | 397 | // case AudioPause: mediaPlayerState->setPaused(audioButtons[i].isDown); return; |
381 | case AudioNext: mediaPlayerState->setNext(); return; | 398 | case AudioNext: mediaPlayerState->setNext(); return; |
382 | case AudioPrevious: mediaPlayerState->setPrev(); return; | 399 | case AudioPrevious: mediaPlayerState->setPrev(); return; |
@@ -464,14 +481,14 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) | |||
464 | break; | 481 | break; |
465 | case Key_Down: //volume | 482 | case Key_Down: //volume |
466 | toggleButton(6); | 483 | // toggleButton(6); |
467 | emit lessClicked(); | 484 | emit lessClicked(); |
468 | emit lessReleased(); | 485 | emit lessReleased(); |
469 | toggleButton(6); | 486 | // toggleButton(6); |
470 | break; | 487 | break; |
471 | case Key_Up: //volume | 488 | case Key_Up: //volume |
472 | toggleButton(5); | 489 | // toggleButton(5); |
473 | emit moreClicked(); | 490 | emit moreClicked(); |
474 | emit moreReleased(); | 491 | emit moreReleased(); |
475 | toggleButton(5); | 492 | // toggleButton(5); |
476 | break; | 493 | break; |
477 | case Key_Right: //next in playlist | 494 | case Key_Right: //next in playlist |
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index c686741..96bc55c 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h | |||
@@ -37,7 +37,6 @@ class QPixmap; | |||
37 | 37 | ||
38 | enum AudioButtons { | 38 | enum AudioButtons { |
39 | AudioPlay, | 39 | AudioPlay=0, |
40 | AudioStop, | 40 | AudioStop, |
41 | AudioPause, | ||
42 | AudioNext, | 41 | AudioNext, |
43 | AudioPrevious, | 42 | AudioPrevious, |
@@ -45,5 +44,7 @@ enum AudioButtons { | |||
45 | AudioVolumeDown, | 44 | AudioVolumeDown, |
46 | AudioLoop, | 45 | AudioLoop, |
47 | AudioPlayList | 46 | AudioPlayList, |
47 | AudioForward, | ||
48 | AudioBack | ||
48 | }; | 49 | }; |
49 | 50 | ||
@@ -62,5 +63,5 @@ public slots: | |||
62 | void sliderPressed( ); | 63 | void sliderPressed( ); |
63 | void sliderReleased( ); | 64 | void sliderReleased( ); |
64 | void setPaused( bool b) { setToggleButton( AudioPause, b ); } | 65 | // void setPaused( bool b) { setToggleButton( AudioPause, b ); } |
65 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } | 66 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } |
66 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } | 67 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } |
@@ -75,4 +76,8 @@ signals: | |||
75 | void lessReleased(); | 76 | void lessReleased(); |
76 | void sliderMoved(long); | 77 | void sliderMoved(long); |
78 | void forwardClicked(); | ||
79 | void backClicked(); | ||
80 | void forwardReleased(); | ||
81 | void backReleased(); | ||
77 | 82 | ||
78 | protected: | 83 | protected: |
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index b0963cf..4f3823a 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp | |||
@@ -107,5 +107,6 @@ void MediaPlayer::setPlaying( bool play ) { | |||
107 | if ( ((currentFile->file()).left(4) != "http") && !QFile::exists( currentFile->file() ) ) { | 107 | if ( ((currentFile->file()).left(4) != "http") && !QFile::exists( currentFile->file() ) ) { |
108 | QMessageBox::critical( 0, tr( "File not found"), | 108 | QMessageBox::critical( 0, tr( "File not found"), |
109 | tr( "The following file was not found: <i>" ) + currentFile->file() + "</i>" ); | 109 | tr( "The following file was not found: <i>" ) |
110 | + currentFile->file() + "</i>" ); | ||
110 | mediaPlayerState->setPlaying( FALSE ); | 111 | mediaPlayerState->setPlaying( FALSE ); |
111 | return; | 112 | return; |
@@ -114,5 +115,6 @@ void MediaPlayer::setPlaying( bool play ) { | |||
114 | if ( !mediaPlayerState->newDecoder( currentFile->file() ) ) { | 115 | if ( !mediaPlayerState->newDecoder( currentFile->file() ) ) { |
115 | QMessageBox::critical( 0, tr( "No decoder found"), | 116 | QMessageBox::critical( 0, tr( "No decoder found"), |
116 | tr( "Sorry, no appropriate decoders found for this file: <i>" ) + currentFile->file() + "</i>" ); | 117 | tr( "Sorry, no appropriate decoders found for this file: <i>" ) |
118 | + currentFile->file() + "</i>" ); | ||
117 | mediaPlayerState->setPlaying( FALSE ); | 119 | mediaPlayerState->setPlaying( FALSE ); |
118 | return; | 120 | return; |
@@ -177,17 +179,68 @@ void MediaPlayer::startIncreasingVolume() { | |||
177 | startTimer( 100 ); | 179 | startTimer( 100 ); |
178 | AudioDevice::increaseVolume(); | 180 | AudioDevice::increaseVolume(); |
181 | |||
179 | } | 182 | } |
180 | 183 | ||
184 | bool drawnOnScreenDisplay = FALSE; | ||
185 | unsigned int onScreenDisplayVolume = 0; | ||
186 | const int yoff = 110; | ||
181 | 187 | ||
182 | void MediaPlayer::stopChangingVolume() { | 188 | void MediaPlayer::stopChangingVolume() { |
183 | killTimers(); | 189 | killTimers(); |
190 | |||
191 | // Get rid of the on-screen display stuff | ||
192 | drawnOnScreenDisplay = FALSE; | ||
193 | onScreenDisplayVolume = 0; | ||
194 | int w = audioUI->width(); | ||
195 | int h = audioUI->height(); | ||
196 | audioUI->repaint( (w - 200) / 2, h - yoff, 200 + 9, 70, FALSE ); | ||
184 | } | 197 | } |
185 | 198 | ||
186 | 199 | ||
187 | void MediaPlayer::timerEvent( QTimerEvent * ) { | 200 | void MediaPlayer::timerEvent( QTimerEvent * ) { |
201 | // qDebug("timer"); | ||
188 | if ( volumeDirection == +1 ) | 202 | if ( volumeDirection == +1 ) |
189 | AudioDevice::increaseVolume(); | 203 | AudioDevice::increaseVolume(); |
190 | else if ( volumeDirection == -1 ) | 204 | else if ( volumeDirection == -1 ) |
191 | AudioDevice::decreaseVolume(); | 205 | AudioDevice::decreaseVolume(); |
206 | |||
207 | // Display an on-screen display volume | ||
208 | unsigned int l, r, v; bool m; | ||
209 | AudioDevice::getVolume( l, r, m ); | ||
210 | v = ((l + r) * 11) / (2*0xFFFF); | ||
211 | |||
212 | if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { | ||
213 | // qDebug("returning %d, %d, %d, %d", v, l, r, m); | ||
214 | return; | ||
215 | } | ||
216 | |||
217 | int w = audioUI->width(); | ||
218 | int h = audioUI->height(); | ||
219 | |||
220 | if ( drawnOnScreenDisplay ) { | ||
221 | if ( onScreenDisplayVolume > v ) | ||
222 | audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, | ||
223 | (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); | ||
224 | } | ||
225 | |||
226 | drawnOnScreenDisplay = TRUE; | ||
227 | onScreenDisplayVolume = v; | ||
228 | |||
229 | QPainter p( audioUI ); | ||
230 | p.setPen( QColor( 0x10, 0xD0, 0x10 ) ); | ||
231 | p.setBrush( QColor( 0x10, 0xD0, 0x10 ) ); | ||
232 | |||
233 | QFont f; | ||
234 | f.setPixelSize( 20 ); | ||
235 | f.setBold( TRUE ); | ||
236 | p.setFont( f ); | ||
237 | p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") ); | ||
238 | |||
239 | for ( unsigned int i = 0; i < 10; i++ ) { | ||
240 | if ( v > i ) | ||
241 | p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); | ||
242 | else | ||
243 | p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); | ||
244 | } | ||
192 | } | 245 | } |
193 | 246 | ||
diff --git a/core/multimedia/opieplayer/mediaplayerstate.h b/core/multimedia/opieplayer/mediaplayerstate.h index 26185c5..1c65599 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.h +++ b/core/multimedia/opieplayer/mediaplayerstate.h | |||
@@ -34,4 +34,5 @@ public: | |||
34 | MediaPlayerState( QObject *parent, const char *name ); | 34 | MediaPlayerState( QObject *parent, const char *name ); |
35 | ~MediaPlayerState(); | 35 | ~MediaPlayerState(); |
36 | bool isPaused; | ||
36 | 37 | ||
37 | bool isStreaming; | 38 | bool isStreaming; |
@@ -102,5 +103,4 @@ private: | |||
102 | bool isShuffled; | 103 | bool isShuffled; |
103 | bool usePlaylist; | 104 | bool usePlaylist; |
104 | bool isPaused; | ||
105 | bool isPlaying; | 105 | bool isPlaying; |
106 | long curPosition; | 106 | long curPosition; |