-rw-r--r-- | library/custom-ipaq.h | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/library/custom-ipaq.h b/library/custom-ipaq.h index 2886940..553b571 100644 --- a/library/custom-ipaq.h +++ b/library/custom-ipaq.h | |||
@@ -17,64 +17,4 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <unistd.h> | ||
21 | #include <stdio.h> | ||
22 | #include <signal.h> | ||
23 | #include <fcntl.h> | ||
24 | #include <sys/ioctl.h> | ||
25 | #include <linux/soundcard.h> | ||
26 | #include <qpe/resource.h> | ||
27 | #include <qsound.h> | ||
28 | #include <qpe/sound.h> | ||
29 | |||
30 | |||
31 | #ifndef QT_NO_SOUND | ||
32 | |||
33 | #define CUSTOM_SOUND_ALARM \ | ||
34 | { \ | ||
35 | int fd; \ | ||
36 | int vol; \ | ||
37 | bool vol_reset = false; \ | ||
38 | \ | ||
39 | if ((( fd = open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) || \ | ||
40 | (( fd = open ( "/dev/mixer", O_RDWR )) >= 0 )) { \ | ||
41 | \ | ||
42 | if ( ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { \ | ||
43 | Config cfg ( "qpe" ); \ | ||
44 | cfg. setGroup ( "Volume" ); \ | ||
45 | \ | ||
46 | int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); \ | ||
47 | if ( volalarm < 0 ) \ | ||
48 | volalarm = 0; \ | ||
49 | else if ( volalarm > 100 ) \ | ||
50 | volalarm = 100; \ | ||
51 | volalarm |= ( volalarm << 8 ); \ | ||
52 | if ( ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) \ | ||
53 | vol_reset = true; \ | ||
54 | } \ | ||
55 | } \ | ||
56 | \ | ||
57 | Sound snd ( "alarm" ); \ | ||
58 | snd. play ( ); \ | ||
59 | while ( !snd. isFinished ( )) \ | ||
60 | qApp-> processEvents ( ); \ | ||
61 | \ | ||
62 | if ( fd >= 0 ) { \ | ||
63 | if ( vol_reset ) \ | ||
64 | ::ioctl ( fd, MIXER_WRITE( 0 ), &vol ); \ | ||
65 | ::close ( fd ); \ | ||
66 | } \ | ||
67 | } | ||
68 | |||
69 | #define CUSTOM_SOUND_KEYCLICK { QSound::play ( Resource::findSound ( "keysound" )); } | ||
70 | #define CUSTOM_SOUND_TOUCH { QSound::play ( Resource::findSound ( "screensound" )); } | ||
71 | |||
72 | #else | ||
73 | |||
74 | #define CUSTOM_SOUND_ALARM { ; } | ||
75 | #define CUSTOM_SOUND_KEYCLICK { ; } | ||
76 | #define CUSTOM_SOUND_TOUCH { ; } | ||
77 | |||
78 | |||
79 | #endif | ||
80 | 20 | ||