From 9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521 Mon Sep 17 00:00:00 2001 From: schurig Date: Fri, 10 Sep 2004 12:18:17 +0000 Subject: added support for DEVFS --- (limited to 'library/qpeapplication.cpp') diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index c6d9cfd..ca90427 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -565,7 +565,11 @@ static void setVolume( int t = 0, int percent = -1 ) 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; @@ -590,7 +594,11 @@ static void setMic( int t = 0, int percent = -1 ) #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 ); } @@ -613,7 +621,11 @@ static void setBass( int t = 0, int percent = -1 ) #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 ); } @@ -636,7 +648,11 @@ static void setTreble( int t = 0, int percent = -1 ) #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 ); } -- cgit v0.9.0.2