author | zecke <zecke> | 2004-08-25 21:51:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-25 21:51:13 (UTC) |
commit | df3e4c8b13c16aeb96e70dbaa2d409f83eed988e (patch) (side-by-side diff) | |
tree | 59b12028c6e8a53b99f1686278b6e9fdc57ab18e /libopie2/opiecore/device/odevice_ipaq.cpp | |
parent | e4811064703ad34f42f15c3044cd8f63c0e7583c (diff) | |
download | opie-df3e4c8b13c16aeb96e70dbaa2d409f83eed988e.zip opie-df3e4c8b13c16aeb96e70dbaa2d409f83eed988e.tar.gz opie-df3e4c8b13c16aeb96e70dbaa2d409f83eed988e.tar.bz2 |
-Have a common implementation for reading the config value
and setting the Mixer. The mixer, sound and path
is configurable
-Restore the Opie HEADER (who is guilty? probably me)
-Fix warnings
-Port Zaurus,Simpad,Ipaq to configure the mixer
Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 71 |
1 files changed, 22 insertions, 49 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 21fed99..7f5aa7b 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp @@ -1,32 +1,32 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team <opie-devel@handhelds.org> + This file is part of the Opie Project + Copyright (C) 2002,2003,2004 The Opie Team <opie-devel@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library General Public -.="- .-=="i, .._ License as published by the Free Software -- . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "odevice_ipaq.h" /* QT */ @@ -326,46 +326,19 @@ void iPAQ::timerEvent ( QTimerEvent * ) QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); } void iPAQ::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; - } - } + 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 } bool iPAQ::setSoftSuspend ( bool soft ) { bool res = false; int fd; |