summaryrefslogtreecommitdiff
authorjeremy <jeremy>2002-02-10 13:22:54 (UTC)
committer jeremy <jeremy>2002-02-10 13:22:54 (UTC)
commit261b98eff083215db69843da28a05cfd1f7b3795 (patch) (side-by-side diff)
tree3e9ed039218f0a132c9413987e03a5b6dc5cb24e
parentd0d626304ffb0de247e22760bc342e72406e301a (diff)
downloadopie-261b98eff083215db69843da28a05cfd1f7b3795.zip
opie-261b98eff083215db69843da28a05cfd1f7b3795.tar.gz
opie-261b98eff083215db69843da28a05cfd1f7b3795.tar.bz2
Added support for setMic and micChange QCop messages. These additions
are exactly like setVolume and volumeChange excopt of course, they change the mic input level instead of the volume out level.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/opie-base.control2
-rw-r--r--library/qpeapplication.cpp29
-rw-r--r--library/qpeapplication.h6
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
@@ -3,7 +3,7 @@ Priority: required
Section: opie/system
Maintainer: Warwick Allison <warwick@trolltech.com>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
+Version: $QPE_VERSION-$SUB_VERSION.1
Depends: qt-embedded (>=$QTE_VERSION), opie-qcop, opie-taskbar, opie-pics, opie-sounds, apmd
Description: Base Qtopia environment
A complete GUI environment for handhelds.
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 4dbfbd8..a55f5f9 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -163,6 +163,7 @@ public:
};
static int muted=0;
+static int micMuted=0;
static void setVolume(int t=0, int percent=-1)
{
@@ -184,6 +185,25 @@ 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()
{
#if defined(QT_QWS_IPAQ)
@@ -986,6 +1006,15 @@ void QPEApplication::systemMessage( const QCString &msg, const QByteArray &data)
stream >> muted;
setVolume();
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)" ) {
if ( type() == GuiServer ) {
int old = disable_suspend;
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index fd5e57d..23606db 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -85,6 +85,7 @@ signals:
void timeChanged();
void clockChanged( bool pm );
void volumeChanged( bool muted );
+ void micChanged( bool muted );
void appMessage( const QCString& msg, const QByteArray& data);
void weekChanged( bool startOnMonday );
void dateFormatChanged( DateFormat );
@@ -117,6 +118,11 @@ private:
QCopChannel *pidChannel;
#endif
QPEApplicationData *d;
+
+ bool reserved_sh;
+
+
+
};