-rw-r--r-- | library/opie-base.control | 2 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 29 | ||||
-rw-r--r-- | library/qpeapplication.h | 6 |
3 files changed, 36 insertions, 1 deletions
diff --git a/library/opie-base.control b/library/opie-base.control index f883268..e610b8b 100644 --- a/library/opie-base.control +++ b/library/opie-base.control | |||
@@ -2,9 +2,9 @@ Files: etc/qimpen etc/colors etc/init.d/qpe etc/rc2.d/S98qpe bin/qpe-reorgfiles | |||
2 | Priority: required | 2 | Priority: required |
3 | Section: opie/system | 3 | Section: opie/system |
4 | Maintainer: Warwick Allison <warwick@trolltech.com> | 4 | Maintainer: Warwick Allison <warwick@trolltech.com> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION.1 |
7 | Depends: qt-embedded (>=$QTE_VERSION), opie-qcop, opie-taskbar, opie-pics, opie-sounds, apmd | 7 | Depends: qt-embedded (>=$QTE_VERSION), opie-qcop, opie-taskbar, opie-pics, opie-sounds, apmd |
8 | Description: Base Qtopia environment | 8 | Description: Base Qtopia environment |
9 | A complete GUI environment for handhelds. | 9 | A complete GUI environment for handhelds. |
10 | You will probably want to install one of the opie-i18n-* packages. | 10 | You will probably want to install one of the opie-i18n-* packages. |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 4dbfbd8..a55f5f9 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -162,8 +162,9 @@ public: | |||
162 | } | 162 | } |
163 | }; | 163 | }; |
164 | 164 | ||
165 | static int muted=0; | 165 | static int muted=0; |
166 | static int micMuted=0; | ||
166 | 167 | ||
167 | static void setVolume(int t=0, int percent=-1) | 168 | static void setVolume(int t=0, int percent=-1) |
168 | { | 169 | { |
169 | switch (t) { | 170 | switch (t) { |
@@ -183,8 +184,27 @@ static void setVolume(int t=0, int percent=-1) | |||
183 | } break; | 184 | } break; |
184 | } | 185 | } |
185 | } | 186 | } |
186 | 187 | ||
188 | static void setMic(int t=0, int percent=-1) | ||
189 | { | ||
190 | switch (t) { | ||
191 | case 0: { | ||
192 | Config cfg("Sound"); | ||
193 | cfg.setGroup("System"); | ||
194 | if ( percent < 0 ) | ||
195 | percent = cfg.readNumEntry("Mic",50); | ||
196 | |||
197 | int fd = 0; | ||
198 | int mic = micMuted ? 0 : percent; | ||
199 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { | ||
200 | ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &mic); | ||
201 | ::close(fd); | ||
202 | } | ||
203 | } break; | ||
204 | } | ||
205 | } | ||
206 | |||
187 | int qpe_sysBrightnessSteps() | 207 | int qpe_sysBrightnessSteps() |
188 | { | 208 | { |
189 | #if defined(QT_QWS_IPAQ) | 209 | #if defined(QT_QWS_IPAQ) |
190 | return 255; | 210 | return 255; |
@@ -985,8 +1005,17 @@ void QPEApplication::systemMessage( const QCString &msg, const QByteArray &data) | |||
985 | } else if ( msg == "volumeChange(bool)" ) { | 1005 | } else if ( msg == "volumeChange(bool)" ) { |
986 | stream >> muted; | 1006 | stream >> muted; |
987 | setVolume(); | 1007 | setVolume(); |
988 | emit volumeChanged( muted ); | 1008 | emit volumeChanged( muted ); |
1009 | } else if ( msg == "setMic(int,int)") { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com> | ||
1010 | int t,v; | ||
1011 | stream >> t >> v; | ||
1012 | setMic(t,v); | ||
1013 | emit micChanged( micMuted ); | ||
1014 | } else if ( msg == "micChange(bool)" ) { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com> | ||
1015 | stream >> micMuted; | ||
1016 | setMic(); | ||
1017 | emit micChanged( micMuted ); | ||
989 | } else if ( msg == "setScreenSaverMode(int)" ) { | 1018 | } else if ( msg == "setScreenSaverMode(int)" ) { |
990 | if ( type() == GuiServer ) { | 1019 | if ( type() == GuiServer ) { |
991 | int old = disable_suspend; | 1020 | int old = disable_suspend; |
992 | stream >> disable_suspend; | 1021 | stream >> disable_suspend; |
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index fd5e57d..23606db 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -84,8 +84,9 @@ signals: | |||
84 | void clientMoused(); | 84 | void clientMoused(); |
85 | void timeChanged(); | 85 | void timeChanged(); |
86 | void clockChanged( bool pm ); | 86 | void clockChanged( bool pm ); |
87 | void volumeChanged( bool muted ); | 87 | void volumeChanged( bool muted ); |
88 | void micChanged( bool muted ); | ||
88 | void appMessage( const QCString& msg, const QByteArray& data); | 89 | void appMessage( const QCString& msg, const QByteArray& data); |
89 | void weekChanged( bool startOnMonday ); | 90 | void weekChanged( bool startOnMonday ); |
90 | void dateFormatChanged( DateFormat ); | 91 | void dateFormatChanged( DateFormat ); |
91 | void flush(); | 92 | void flush(); |
@@ -116,8 +117,13 @@ private: | |||
116 | QCopChannel *sysChannel; | 117 | QCopChannel *sysChannel; |
117 | QCopChannel *pidChannel; | 118 | QCopChannel *pidChannel; |
118 | #endif | 119 | #endif |
119 | QPEApplicationData *d; | 120 | QPEApplicationData *d; |
121 | |||
122 | bool reserved_sh; | ||
123 | |||
124 | |||
125 | |||
120 | }; | 126 | }; |
121 | 127 | ||
122 | 128 | ||
123 | #endif | 129 | #endif |