summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-06 12:47:33 (UTC)
committer zecke <zecke>2004-03-06 12:47:33 (UTC)
commite605df00284707a6dc4dd2ba51962531d43a5bea (patch) (side-by-side diff)
treee18e8234e406ccf528672cad35a8fa349cabbf97
parenta66fd5afde517e9a61e74fc17df617297f134c96 (diff)
downloadopie-e605df00284707a6dc4dd2ba51962531d43a5bea.zip
opie-e605df00284707a6dc4dd2ba51962531d43a5bea.tar.gz
opie-e605df00284707a6dc4dd2ba51962531d43a5bea.tar.bz2
-ioctl( fd, MIXER_WRITE( 0 ), &vol );
+ioctl( fd, MIXER_WRITE( SOUND_MIXER_PCM ), &vol ); don't hardcode the mixer
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c339a78..5d05ed5 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -328,65 +328,65 @@ public:
}
private:
mutable QImageDrag *resImage;
};
static int& hack(int& i)
{
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
// These should be created, but aren't in Qt 2.3.0
(void)new QUtf8Codec;
(void)new QUtf16Codec;
#endif
return i;
}
static int muted = 0;
static int micMuted = 0;
static void setVolume( int t = 0, int percent = -1 )
{
switch ( t ) {
case 0: {
Config cfg( "qpe" );
cfg.setGroup( "Volume" );
if ( percent < 0 )
percent = cfg.readNumEntry( "VolumePercent", 50 );
#ifndef QT_NO_SOUND
int fd = 0;
if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
int vol = muted ? 0 : percent;
// set both channels to same volume
vol |= vol << 8;
- ioctl( fd, MIXER_WRITE( 0 ), &vol );
+ ioctl( fd, MIXER_WRITE( SOUND_MIXER_PCM ), &vol );
::close( fd );
}
#endif
}
break;
}
}
static void setMic( int t = 0, int percent = -1 )
{
switch ( t ) {
case 0: {
Config cfg( "qpe" );
cfg.setGroup( "Volume" );
if ( percent < 0 )
percent = cfg.readNumEntry( "Mic", 50 );
#ifndef QT_NO_SOUND
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 );
}
#endif
}
break;
}
}
static void setBass( int t = 0, int percent = -1 )