summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Side-by-side diff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 4dbfbd8..a55f5f9 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -165,2 +165,3 @@ public:
static int muted=0;
+static int micMuted=0;
@@ -186,2 +187,21 @@ static void setVolume(int t=0, int percent=-1)
+static void setMic(int t=0, int percent=-1)
+{
+ switch (t) {
+ case 0: {
+ Config cfg("Sound");
+ cfg.setGroup("System");
+ if ( percent < 0 )
+ percent = cfg.readNumEntry("Mic",50);
+
+ int fd = 0;
+ int mic = micMuted ? 0 : percent;
+ if ((fd = open("/dev/mixer", O_RDWR))>=0) {
+ ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &mic);
+ ::close(fd);
+ }
+ } break;
+ }
+}
+
int qpe_sysBrightnessSteps()
@@ -988,2 +1008,11 @@ void QPEApplication::systemMessage( const QCString &msg, const QByteArray &data)
emit volumeChanged( muted );
+ } else if ( msg == "setMic(int,int)") { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com>
+ int t,v;
+ stream >> t >> v;
+ setMic(t,v);
+ emit micChanged( micMuted );
+ } else if ( msg == "micChange(bool)" ) { // Added: 2002-02-08 by Jeremy Cowgar <jc@cowgar.com>
+ stream >> micMuted;
+ setMic();
+ emit micChanged( micMuted );
} else if ( msg == "setScreenSaverMode(int)" ) {