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) (unidiff)
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
@@ -565,7 +565,11 @@ static void setVolume( int t = 0, int percent = -1 )
565 percent = cfg.readNumEntry( "VolumePercent", 50 ); 565 percent = cfg.readNumEntry( "VolumePercent", 50 );
566#ifndef QT_NO_SOUND 566#ifndef QT_NO_SOUND
567 int fd = 0; 567 int fd = 0;
568#ifdef QT_QWS_DEVFS
569 if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
570#else
568 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { 571 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
572#endif
569 int vol = muted ? 0 : percent; 573 int vol = muted ? 0 : percent;
570 // set both channels to same volume 574 // set both channels to same volume
571 vol |= vol << 8; 575 vol |= vol << 8;
@@ -590,7 +594,11 @@ static void setMic( int t = 0, int percent = -1 )
590#ifndef QT_NO_SOUND 594#ifndef QT_NO_SOUND
591 int fd = 0; 595 int fd = 0;
592 int mic = micMuted ? 0 : percent; 596 int mic = micMuted ? 0 : percent;
597#ifdef QT_QWS_DEVFS
598 if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
599#else
593 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { 600 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
601#endif
594 ioctl( fd, MIXER_WRITE( SOUND_MIXER_MIC ), &mic ); 602 ioctl( fd, MIXER_WRITE( SOUND_MIXER_MIC ), &mic );
595 ::close( fd ); 603 ::close( fd );
596 } 604 }
@@ -613,7 +621,11 @@ static void setBass( int t = 0, int percent = -1 )
613#ifndef QT_NO_SOUND 621#ifndef QT_NO_SOUND
614 int fd = 0; 622 int fd = 0;
615 int bass = percent; 623 int bass = percent;
624#ifdef QT_QWS_DEVFS
625 if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
626#else
616 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { 627 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
628#endif
617 ioctl( fd, MIXER_WRITE( SOUND_MIXER_BASS ), &bass ); 629 ioctl( fd, MIXER_WRITE( SOUND_MIXER_BASS ), &bass );
618 ::close( fd ); 630 ::close( fd );
619 } 631 }
@@ -636,7 +648,11 @@ static void setTreble( int t = 0, int percent = -1 )
636#ifndef QT_NO_SOUND 648#ifndef QT_NO_SOUND
637 int fd = 0; 649 int fd = 0;
638 int treble = percent; 650 int treble = percent;
651#ifdef QT_QWS_DEVFS
652 if ( ( fd = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) {
653#else
639 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { 654 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
655#endif
640 ioctl( fd, MIXER_WRITE( SOUND_MIXER_TREBLE ), &treble ); 656 ioctl( fd, MIXER_WRITE( SOUND_MIXER_TREBLE ), &treble );
641 ::close( fd ); 657 ::close( fd );
642 } 658 }