Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 47 |
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 @@ -239,8 +239,9 @@ bool SIMpad::setLedState ( OLed l, OLedState st ) m_leds [0] = st; return true; - } - } - } - + // } +// } +#else + Q_UNUSED( l ) + Q_UNUSED( st ) #endif return false; @@ -248,5 +249,5 @@ 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*/ ) { //TODO @@ -267,34 +268,8 @@ void SIMpad::playAlarmSound() #ifndef QT_NO_SOUND 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 } @@ -336,12 +311,8 @@ bool SIMpad::setDisplayStatus ( bool on ) qDebug( "ODevice for SIMpad: setDisplayStatus(%s)", on? "on" : "off" ); - bool res = false; - int fd; QString cmdline = QString().sprintf( "echo %s > /proc/cs3", on ? "0xd41a" : "0xd40a" ); //TODO make better :) - res = ( ::system( (const char*) cmdline ) == 0 ); - - return res; + return ( ::system( (const char*) cmdline ) == 0 ); } |