author | llornkcor <llornkcor> | 2004-04-25 20:37:28 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-04-25 20:37:28 (UTC) |
commit | ae76c412a340a0808ed6ece5e4a8fbc04baa4ff3 (patch) (side-by-side diff) | |
tree | a086457c05142e1ac2749844ffcb458d96550c6f | |
parent | 22d51bcaa58b90a3ffd4d429c43e6c24e1694ab3 (diff) | |
download | opie-ae76c412a340a0808ed6ece5e4a8fbc04baa4ff3.zip opie-ae76c412a340a0808ed6ece5e4a8fbc04baa4ff3.tar.gz opie-ae76c412a340a0808ed6ece5e4a8fbc04baa4ff3.tar.bz2 |
soundcard descriptor mucking about
-rw-r--r-- | noncore/multimedia/opierec/device.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp index 5319d97..db2d63f 100644 --- a/noncore/multimedia/opierec/device.cpp +++ b/noncore/multimedia/opierec/device.cpp @@ -28,3 +28,3 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco mixstr = (char *)mixr; - + devForm=-1; @@ -34,6 +34,6 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco if( !record){ //playing - odebug << "setting up DSP for playing" << oendl; + odebug << "setting up DSP for playing" << oendl; flags = O_WRONLY; } else { //recording - odebug << "setting up DSP for recording" << oendl; + odebug << "setting up DSP for recording" << oendl; flags = O_RDWR; @@ -98,3 +98,3 @@ void Device::changedOutVolume(int vol) { QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; - owarn << "changing output vol " << vol << "" << oendl; + owarn << "changing output vol " << vol << "" << oendl; } @@ -113,3 +113,3 @@ void Device::changedInVolume(int vol ) { QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; - owarn << "changing input volume " << vol << "" << oendl; + owarn << "changing input volume " << vol << "" << oendl; } @@ -151,3 +151,3 @@ exit(1); */ -odebug << "Opening " << dspstr << "" << oendl; +odebug << "Opening " << dspstr << "" << oendl; if (( sd = ::open( dspstr, flags)) == -1) { @@ -156,3 +156,3 @@ odebug << "Opening " << dspstr << "" << oendl; +(QString)strerror(errno); - odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; + odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; return -1; @@ -160,3 +160,3 @@ odebug << "Opening " << dspstr << "" << oendl; -odebug << "Opening mixer" << oendl; +odebug << "Opening mixer" << oendl; int mixerHandle=0; @@ -166,3 +166,3 @@ odebug << "Opening mixer" << oendl; +(QString)strerror(errno); - odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; + odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; } @@ -182,3 +182,3 @@ odebug << "Opening mixer" << oendl; close(pipefd[1]); - // odebug << "" << soundDevice->sd << "" << oendl; + // odebug << "" << soundDevice->sd << "" << oendl; _exit(0); @@ -208,4 +208,4 @@ odebug << "Opening mixer" << oendl; // sd = s.toInt(&ok, 10); -// odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl; - +// odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl; + // f2.close(); @@ -213,4 +213,4 @@ odebug << "Opening mixer" << oendl; ::close(mixerHandle ); -// odebug << "open device " << dspstr << "" << oendl; -// odebug << "success! " << sd << "" << oendl; +// odebug << "open device " << dspstr << "" << oendl; +// odebug << "success! " << sd << "" << oendl; return sd; @@ -232,3 +232,3 @@ bool Device::closeDevice( bool) { // sd=0; -// odebug << "closed dsp" << oendl; +// odebug << "closed dsp" << oendl; return true; @@ -237,3 +237,3 @@ bool Device::closeDevice( bool) { bool Device::setDeviceFormat( int form) { - odebug << "set device res " << form << " " << sd << "" << oendl; + odebug << "set device res " << form << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format @@ -247,3 +247,3 @@ bool Device::setDeviceFormat( int form) { bool Device::setDeviceChannels( int ch) { - odebug << "set channels " << ch << " " << sd << "" << oendl; + odebug << "set channels " << ch << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { @@ -257,3 +257,3 @@ bool Device::setDeviceChannels( int ch) { bool Device::setDeviceRate( int rate) { - odebug << "set rate " << rate << " " << sd << "" << oendl; + odebug << "set rate " << rate << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { @@ -318,7 +318,7 @@ int Device::getDeviceFragSize() { int frag_size; - + if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { - odebug << "no fragsize" << oendl; + odebug << "no fragsize" << oendl; } else { - odebug << "driver says frag size is " << frag_size << "" << oendl; + odebug << "driver says frag size is " << frag_size << "" << oendl; } @@ -347,3 +347,3 @@ int Device::devRead(int soundDescriptor, short *buf, int size) { int number = 0; - number = ::read( soundDescriptor, (char *)buf, size); + number = ::read( sd /*soundDescriptor*/, (char *)buf, size); return number; @@ -353,3 +353,3 @@ int Device::devWrite(int soundDescriptor, short * buf, int size) { int bytesWritten = 0; - bytesWritten = ::write( soundDescriptor, buf, size); + bytesWritten = ::write( sd /*soundDescriptor*/, buf, size); return bytesWritten; |