Diffstat (limited to 'libopie2/opiecore/device/odevice_htc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_htc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_htc.cpp b/libopie2/opiecore/device/odevice_htc.cpp index 44b33c0..7f82369 100644 --- a/libopie2/opiecore/device/odevice_htc.cpp +++ b/libopie2/opiecore/device/odevice_htc.cpp | |||
@@ -285,49 +285,51 @@ void HTC::buzzer( int sound ) | |||
285 | case SHARP_BUZ_KEYSOUND: { | 285 | case SHARP_BUZ_KEYSOUND: { |
286 | static Sound key_sound( "keysound" ); | 286 | static Sound key_sound( "keysound" ); |
287 | snd = &key_sound; | 287 | snd = &key_sound; |
288 | } | 288 | } |
289 | break; | 289 | break; |
290 | case SHARP_BUZ_SCHEDULE_ALARM: | 290 | case SHARP_BUZ_SCHEDULE_ALARM: |
291 | default: { | 291 | default: { |
292 | static Sound alarm_sound("alarm"); | 292 | static Sound alarm_sound("alarm"); |
293 | snd = &alarm_sound; | 293 | snd = &alarm_sound; |
294 | } | 294 | } |
295 | break; | 295 | break; |
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
299 | // If a soundname is defined, we expect that this device has | 299 | // If a soundname is defined, we expect that this device has |
300 | // sound capabilities.. Otherwise we expect to have the buzzer | 300 | // sound capabilities.. Otherwise we expect to have the buzzer |
301 | // device.. | 301 | // device.. |
302 | if ( snd && snd->isFinished() ){ | 302 | if ( snd && snd->isFinished() ){ |
303 | changeMixerForAlarm( 0, "/dev/mixer", snd ); | 303 | changeMixerForAlarm( 0, "/dev/mixer", snd ); |
304 | snd->play(); | 304 | snd->play(); |
305 | } else if( !snd ) { | 305 | } else if( !snd ) { |
306 | int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); | 306 | int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); |
307 | 307 | ||
308 | if ( fd >= 0 ) { | 308 | if ( fd >= 0 ) { |
309 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); | 309 | if (::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ) == -1) |
310 | qWarning( "HTC::buzzer() - Couldn't make the buzzer buzz (%s)", | ||
311 | strerror( errno ) ); | ||
310 | ::close ( fd ); | 312 | ::close ( fd ); |
311 | } | 313 | } |
312 | 314 | ||
313 | } | 315 | } |
314 | #endif | 316 | #endif |
315 | } | 317 | } |
316 | 318 | ||
317 | 319 | ||
318 | void HTC::playAlarmSound() | 320 | void HTC::playAlarmSound() |
319 | { | 321 | { |
320 | buzzer( SHARP_BUZ_SCHEDULE_ALARM ); | 322 | buzzer( SHARP_BUZ_SCHEDULE_ALARM ); |
321 | } | 323 | } |
322 | 324 | ||
323 | void HTC::playTouchSound() | 325 | void HTC::playTouchSound() |
324 | { | 326 | { |
325 | buzzer( SHARP_BUZ_TOUCHSOUND ); | 327 | buzzer( SHARP_BUZ_TOUCHSOUND ); |
326 | } | 328 | } |
327 | 329 | ||
328 | void HTC::playKeySound() | 330 | void HTC::playKeySound() |
329 | { | 331 | { |
330 | buzzer( SHARP_BUZ_KEYSOUND ); | 332 | buzzer( SHARP_BUZ_KEYSOUND ); |
331 | } | 333 | } |
332 | 334 | ||
333 | 335 | ||