summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_simpad.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp47
1 files changed, 9 insertions, 38 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index c6de614..2d0160d 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -240,6 +240,7 @@ bool SIMpad::setLedState ( OLed l, OLedState st )
return true;
- }
- }
- }
-
+ // }
+// }
+#else
+ Q_UNUSED( l )
+ Q_UNUSED( st )
#endif
@@ -249,3 +250,3 @@ bool SIMpad::setLedState ( OLed l, OLedState st )
-bool SIMpad::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat )
+bool SIMpad::filter ( int /*unicode*/, int /*keycode*/, int /*modifiers*/, bool /*isPress*/, bool /*autoRepeat*/ )
{
@@ -268,32 +269,6 @@ void SIMpad::playAlarmSound()
static Sound snd ( "alarm" );
- int fd;
- int vol;
- bool vol_reset = false;
-
- if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) {
- if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) {
- Config cfg ( "qpe" );
- cfg. setGroup ( "Volume" );
-
- int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
- if ( volalarm < 0 )
- volalarm = 0;
- else if ( volalarm > 100 )
- volalarm = 100;
- volalarm |= ( volalarm << 8 );
-
- if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 )
- vol_reset = true;
- }
- }
+ /* save as the Sound is static! */
+ changeMixerForAlarm( 0, "/dev/sound/mixer" , &snd);
snd. play();
- while ( !snd. isFinished())
- qApp->processEvents();
-
- if ( fd >= 0 ) {
- if ( vol_reset )
- ::ioctl ( fd, MIXER_WRITE( 0 ), &vol );
- ::close ( fd );
- }
#endif
@@ -337,4 +312,2 @@ bool SIMpad::setDisplayStatus ( bool on )
- bool res = false;
- int fd;
@@ -342,5 +315,3 @@ bool SIMpad::setDisplayStatus ( bool on )
- res = ( ::system( (const char*) cmdline ) == 0 );
-
- return res;
+ return ( ::system( (const char*) cmdline ) == 0 );
}