summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
authorschurig <schurig>2004-09-10 12:18:17 (UTC)
committer schurig <schurig>2004-09-10 12:18:17 (UTC)
commit9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521 (patch) (side-by-side diff)
tree53927c6a19c69d54bb3d0e092ac57180bcb60222 /library/qpeapplication.cpp
parented70ec4945c7816ec6e899207ec8b99e20e10da5 (diff)
downloadopie-9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521.zip
opie-9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521.tar.gz
opie-9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521.tar.bz2
added support for DEVFS
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c6d9cfd..ca90427 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -562,13 +562,17 @@ static void setVolume( int t = 0, int percent = -1 )
Config cfg( "qpe" );
cfg.setGroup( "Volume" );
if ( percent < 0 )
percent = cfg.readNumEntry( "VolumePercent", 50 );
#ifndef QT_NO_SOUND
int fd = 0;
+#ifdef QT_QWS_DEVFS
+ if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
+#else
if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
+#endif
int vol = muted ? 0 : percent;
// set both channels to same volume
vol |= vol << 8;
ioctl( fd, MIXER_WRITE( SOUND_MIXER_VOLUME ), &vol );
::close( fd );
}
@@ -587,13 +591,17 @@ static void setMic( int t = 0, int percent = -1 )
if ( percent < 0 )
percent = cfg.readNumEntry( "Mic", 50 );
#ifndef QT_NO_SOUND
int fd = 0;
int mic = micMuted ? 0 : percent;
+#ifdef QT_QWS_DEVFS
+ if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
+#else
if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
+#endif
ioctl( fd, MIXER_WRITE( SOUND_MIXER_MIC ), &mic );
::close( fd );
}
#endif
}
break;
@@ -610,13 +618,17 @@ static void setBass( int t = 0, int percent = -1 )
if ( percent < 0 )
percent = cfg.readNumEntry( "BassPercent", 50 );
#ifndef QT_NO_SOUND
int fd = 0;
int bass = percent;
+#ifdef QT_QWS_DEVFS
+ if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
+#else
if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
+#endif
ioctl( fd, MIXER_WRITE( SOUND_MIXER_BASS ), &bass );
::close( fd );
}
#endif
}
break;
@@ -633,13 +645,17 @@ static void setTreble( int t = 0, int percent = -1 )
if ( percent < 0 )
percent = cfg.readNumEntry( "TreblePercent", 50 );
#ifndef QT_NO_SOUND
int fd = 0;
int treble = percent;
+#ifdef QT_QWS_DEVFS
+ if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
+#else
if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
+#endif
ioctl( fd, MIXER_WRITE( SOUND_MIXER_TREBLE ), &treble );
::close( fd );
}
#endif
}
break;