author | zecke <zecke> | 2004-09-21 00:40:38 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-21 00:40:38 (UTC) |
commit | 97e20b7cc746d5e2822385fc815739853a9c6e2f (patch) (unidiff) | |
tree | 8c72e5148518cd7b11be4ccce3d9e9f9c4c541d5 | |
parent | ee21a12cded5c53f196a5183f39e8069a22ef835 (diff) | |
download | opie-97e20b7cc746d5e2822385fc815739853a9c6e2f.zip opie-97e20b7cc746d5e2822385fc815739853a9c6e2f.tar.gz opie-97e20b7cc746d5e2822385fc815739853a9c6e2f.tar.bz2 |
If sound is not yet finished return and do not try to play
it again.
if(!snd.isFinished())
return;
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ramses.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 |
4 files changed, 8 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 7f5aa7b..6193ddc 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -326,16 +326,18 @@ void iPAQ::timerEvent ( QTimerEvent * ) | |||
326 | QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); | 326 | QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); |
327 | } | 327 | } |
328 | 328 | ||
329 | 329 | ||
330 | void iPAQ::playAlarmSound() | 330 | void iPAQ::playAlarmSound() |
331 | { | 331 | { |
332 | #ifndef QT_NO_SOUND | 332 | #ifndef QT_NO_SOUND |
333 | static Sound snd ( "alarm" ); | 333 | static Sound snd ( "alarm" ); |
334 | if(!snd.isFinished()) | ||
335 | return; | ||
334 | 336 | ||
335 | changeMixerForAlarm(0, "/dev/sound/mixer", &snd ); | 337 | changeMixerForAlarm(0, "/dev/sound/mixer", &snd ); |
336 | snd. play(); | 338 | snd. play(); |
337 | #endif | 339 | #endif |
338 | } | 340 | } |
339 | 341 | ||
340 | 342 | ||
341 | bool iPAQ::setSoftSuspend ( bool soft ) | 343 | bool iPAQ::setSoftSuspend ( bool soft ) |
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp index 0cddf85..c75ea3a 100644 --- a/libopie2/opiecore/device/odevice_ramses.cpp +++ b/libopie2/opiecore/device/odevice_ramses.cpp | |||
@@ -94,16 +94,18 @@ void Ramses::init(const QString&) | |||
94 | OC(d->m_cpu_frequencies->append("471000"); ) // mem=118, run=471, turbo=471, PXbus=236 OC'd mem/core/bus | 94 | OC(d->m_cpu_frequencies->append("471000"); ) // mem=118, run=471, turbo=471, PXbus=236 OC'd mem/core/bus |
95 | } | 95 | } |
96 | 96 | ||
97 | 97 | ||
98 | void Ramses::playAlarmSound() | 98 | void Ramses::playAlarmSound() |
99 | { | 99 | { |
100 | #ifndef QT_NO_SOUND | 100 | #ifndef QT_NO_SOUND |
101 | static Sound snd ( "alarm" ); | 101 | static Sound snd ( "alarm" ); |
102 | if(!snd.isFinished()) | ||
103 | return; | ||
102 | 104 | ||
103 | changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd); | 105 | changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd); |
104 | snd.play(); | 106 | snd.play(); |
105 | #else | 107 | #else |
106 | #error QT_NO_SOUND defined | 108 | #error QT_NO_SOUND defined |
107 | #endif | 109 | #endif |
108 | } | 110 | } |
109 | 111 | ||
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index fd46b95..34876da 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -314,16 +314,18 @@ void SIMpad::timerEvent ( QTimerEvent * ) | |||
314 | QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); | 314 | QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); |
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | void SIMpad::playAlarmSound() | 318 | void SIMpad::playAlarmSound() |
319 | { | 319 | { |
320 | #ifndef QT_NO_SOUND | 320 | #ifndef QT_NO_SOUND |
321 | static Sound snd ( "alarm" ); | 321 | static Sound snd ( "alarm" ); |
322 | if(!snd.isFinished()) | ||
323 | return; | ||
322 | 324 | ||
323 | /* save as the Sound is static! */ | 325 | /* save as the Sound is static! */ |
324 | changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd); | 326 | changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd); |
325 | snd. play(); | 327 | snd. play(); |
326 | #endif | 328 | #endif |
327 | } | 329 | } |
328 | 330 | ||
329 | 331 | ||
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 64fa199..733479e 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -340,20 +340,20 @@ void Zaurus::buzzer ( int sound ) | |||
340 | } | 340 | } |
341 | break; | 341 | break; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | 344 | ||
345 | // If a soundname is defined, we expect that this device has | 345 | // If a soundname is defined, we expect that this device has |
346 | // sound capabilities.. Otherwise we expect to have the buzzer | 346 | // sound capabilities.. Otherwise we expect to have the buzzer |
347 | // device.. | 347 | // device.. |
348 | if ( snd ){ | 348 | if ( snd && snd->isFinished() ){ |
349 | changeMixerForAlarm( 0, "/dev/sound/mixer", snd ); | 349 | changeMixerForAlarm( 0, "/dev/sound/mixer", snd ); |
350 | snd-> play(); | 350 | snd-> play(); |
351 | } else { | 351 | } else if( !snd ) { |
352 | int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); | 352 | int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); |
353 | 353 | ||
354 | if ( fd >= 0 ) { | 354 | if ( fd >= 0 ) { |
355 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); | 355 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); |
356 | ::close ( fd ); | 356 | ::close ( fd ); |
357 | } | 357 | } |
358 | 358 | ||
359 | } | 359 | } |