-rw-r--r-- | noncore/multimedia/opierec/device.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp index f9a80c5..11071d8 100644 --- a/noncore/multimedia/opierec/device.cpp +++ b/noncore/multimedia/opierec/device.cpp @@ -1,13 +1,13 @@ // device.cpp #include "device.h" #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> - +#include <qpe/custom.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/soundcard.h> @@ -23,13 +23,13 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record ) : QObject( parent) { dspstr = (char *)dsp; mixstr = (char *)mixr; - + devForm=-1; devCh=-1; devRate=-1; if( !record){ //playing qDebug("setting up DSP for playing"); @@ -141,13 +141,13 @@ exit(1); } switch (pid = fork()) { case -1: perror("The fork failed!"); break; case 0: { - */ + */ if (( sd = ::open( dspstr, flags)) == -1) { perror("open(\"/dev/dsp\")"); QString errorMsg="Could not open audio device\n /dev/dsp\n" +(QString)strerror(errno); qDebug(errorMsg); return -1; @@ -173,20 +173,20 @@ exit(1); write(pipefd[1], message, sizeof(message)); close(pipefd[1]); // qDebug("%d",soundDevice->sd ); _exit(0); } default: - // pid greater than zero is parent getting the child's pid + // pid greater than zero is parent getting the child's pid printf("Child's pid is %d\n",pid); QString s; close(pipefd[1]); read(pipefd[0], message, sizeof(message)); s = message; close(pipefd[0]); - + // while(wait(NULL)!=pid) // ; printf("child %ld terminated normally, return status is zero\n", (long) pid); */ // filePara.sd=(long) pid; /* QFile f2("/pid"); @@ -196,13 +196,13 @@ exit(1); s = t.readLine(); // } */ // bool ok; // sd = s.toInt(&ok, 10); // qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s); - + // f2.close(); // } ::close(mixerHandle ); qDebug("open device %s", dspstr); qDebug("success! %d",sd); return sd; @@ -287,13 +287,13 @@ int Device::getDeviceRate() { return dRate; } int Device::getDeviceBits() { int dBits=0; -#ifndef QT_QWS_EBX // zaurus doesnt have this +#if !defined(OPIE_NO_SOUND_PCM_READ_BITS) // zaurus doesnt have this if (ioctl( sd, SOUND_PCM_READ_BITS, &dBits) == -1) { perror("ioctl(\"SNDCTL_PCM_READ_BITS\")"); } #endif return dBits; } @@ -305,13 +305,13 @@ int Device::getDeviceChannels() { } return dCh; } int Device::getDeviceFragSize() { int frag_size; - + if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { qDebug("no fragsize"); } else qDebug("driver says frag size is %d", frag_size); return frag_size; } |