author | schurig <schurig> | 2004-09-10 12:34:40 (UTC) |
---|---|---|
committer | schurig <schurig> | 2004-09-10 12:34:40 (UTC) |
commit | 85928a3781d9a91b58ea414c0d7982459cc21920 (patch) (side-by-side diff) | |
tree | 10aeedf3a79fe2372c55bda730b6913b5562231b | |
parent | 9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521 (diff) | |
download | opie-85928a3781d9a91b58ea414c0d7982459cc21920.zip opie-85928a3781d9a91b58ea414c0d7982459cc21920.tar.gz opie-85928a3781d9a91b58ea414c0d7982459cc21920.tar.bz2 |
support for DEVFS
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opierec/device.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opierec/qtrec.cpp | 7 |
3 files changed, 27 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 7b4bfd9..e6afbd8 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -278,13 +278,17 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { } } } void MediaPlayer::blank( bool b ) { +#ifdef QT_QWS_DEVFS + fd=open("/dev/fb/0",O_RDWR); +#else fd=open("/dev/fb0",O_RDWR); +#endif #ifdef QT_QWS_SL5XXX fl= open( "/dev/fl", O_RDWR ); #endif if (fd != -1) { if ( b ) { odebug << "do blanking" << oendl; diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp index 683f0a5..cb47b77 100644 --- a/noncore/multimedia/opierec/device.cpp +++ b/noncore/multimedia/opierec/device.cpp @@ -72,13 +72,17 @@ qDebug( "Opening %s",dspstr); qDebug( "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg ); return -1; } qDebug( "Opening mixer" ); int mixerHandle=0; +#ifdef QT_QWS_DEVFS + if (( mixerHandle = open("/dev/sound/mixer",O_RDWR))<0) { +#else if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { +#endif perror("open(\"/dev/mixer\")"); QString errorMsg="Could not open audio device\n /dev/dsp\n" +(QString)strerror(errno); qDebug( "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg ); } @@ -165,13 +169,17 @@ int Device::getInVolume() { return cfg.readNumEntry("Mic"); } void Device::changedOutVolume(int vol) { int level = (vol << 8) + vol; 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 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &level) == -1) perror("ioctl(\"MIXER_IN_WRITE\")"); Config cfg("qpe"); cfg.setGroup("Volume"); cfg.writeEntry("VolumePercent", QString::number( vol )); @@ -181,13 +189,17 @@ void Device::changedOutVolume(int vol) { ::close(fd); } void Device::changedInVolume(int vol ) { int level = (vol << 8) + vol; 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 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1) perror("ioctl(\"MIXER_IN_WRITE\")"); Config cfg("qpe"); cfg.setGroup("Volume"); cfg.writeEntry("Mic", QString::number(vol )); QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; @@ -197,13 +209,17 @@ void Device::changedInVolume(int vol ) { } bool Device::selectMicInput() { int md=0; int info=MIXER_WRITE(SOUND_MIXER_MIC); +#ifdef QT_QWS_DEVFS + md = ::open( "/dev/sound/mixer", O_RDWR ); +#else md = ::open( "/dev/mixer", O_RDWR ); +#endif if ( md == -1) perror("open(\"/dev/mixer\")"); else { if( ioctl( md, SOUND_MIXER_WRITE_RECSRC, &info) == -1) perror("ioctl(\"SOUND_MIXER_WRITE_RECSRC\")"); ::close(md); diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index 1141faa..c237726 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp @@ -76,16 +76,23 @@ static int deviceBitRates[] = { 8, 16, -1 }; #define DSPSTRIN "/dev/dsp" #define DSPSTRMIXERIN "/dev/mixer" #endif #else +#ifdef QT_QWS_DEVFS +#define DSPSTROUT "/dev/sound/dsp" +#define DSPSTRIN "/dev/sound/dsp" +#define DSPSTRMIXERIN "/dev/sound/mixer" +#define DSPSTRMIXEROUT "/dev/sound/mixer" +#else #define DSPSTROUT "/dev/dsp" #define DSPSTRIN "/dev/dsp" #define DSPSTRMIXERIN "/dev/mixer" #define DSPSTRMIXEROUT "/dev/mixer" +#endif #endif //#define ZAURUS 0 struct adpcm_state encoder_state; struct adpcm_state decoder_state; |