summaryrefslogtreecommitdiff
authorzecke <zecke>2004-09-21 00:40:38 (UTC)
committer zecke <zecke>2004-09-21 00:40:38 (UTC)
commit97e20b7cc746d5e2822385fc815739853a9c6e2f (patch) (side-by-side diff)
tree8c72e5148518cd7b11be4ccce3d9e9f9c4c541d5
parentee21a12cded5c53f196a5183f39e8069a22ef835 (diff)
downloadopie-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;
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp4
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
@@ -322,24 +322,26 @@ void iPAQ::timerEvent ( QTimerEvent * )
{
killTimer ( m_power_timer );
m_power_timer = 0;
QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
}
void iPAQ::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
+ if(!snd.isFinished())
+ return;
changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
snd. play();
#endif
}
bool iPAQ::setSoftSuspend ( bool soft )
{
bool res = false;
int fd;
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
@@ -90,24 +90,26 @@ void Ramses::init(const QString&)
d->m_cpu_frequencies->append("298600"); // mem= 99, run=199, turbo=298, PXbus= 99
OC(d->m_cpu_frequencies->append("354000"); ) // mem=118, run=236, turbo=354, PXbus=118 OC'd mem
d->m_cpu_frequencies->append("398099"); // mem= 99, run=199, turbo=398, PXbus= 99
d->m_cpu_frequencies->append("398100"); // mem= 99, run=398, turbo=398, PXbus=196
OC(d->m_cpu_frequencies->append("471000"); ) // mem=118, run=471, turbo=471, PXbus=236 OC'd mem/core/bus
}
void Ramses::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
+ if(!snd.isFinished())
+ return;
changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd);
snd.play();
#else
#error QT_NO_SOUND defined
#endif
}
bool Ramses::suspend()
{
if ( !isQWS( ) ) // only qwsserver is allowed to suspend
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
@@ -310,24 +310,26 @@ void SIMpad::timerEvent ( QTimerEvent * )
{
killTimer ( m_power_timer );
m_power_timer = 0;
QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
}
void SIMpad::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
+ if(!snd.isFinished())
+ return;
/* save as the Sound is static! */
changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd);
snd. play();
#endif
}
bool SIMpad::suspend() // Must override because SIMpad does NOT have apm
{
qDebug( "ODevice for SIMpad: suspend()" );
if ( !isQWS( ) ) // only qwsserver is allowed to suspend
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
@@ -336,28 +336,28 @@ void Zaurus::buzzer ( int sound )
case SHARP_BUZ_SCHEDULE_ALARM:
default: {
static Sound alarm_sound("alarm");
snd = &alarm_sound;
}
break;
}
}
// If a soundname is defined, we expect that this device has
// sound capabilities.. Otherwise we expect to have the buzzer
// device..
- if ( snd ){
+ if ( snd && snd->isFinished() ){
changeMixerForAlarm( 0, "/dev/sound/mixer", snd );
snd-> play();
- } else {
+ } else if( !snd ) {
int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK );
if ( fd >= 0 ) {
::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound );
::close ( fd );
}
}
#endif
}