Diffstat (limited to 'noncore/multimedia/opierec/device.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opierec/device.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp index e7e0f4b..a76665e 100644 --- a/noncore/multimedia/opierec/device.cpp +++ b/noncore/multimedia/opierec/device.cpp | |||
@@ -60,6 +60,7 @@ Device::Device( QObject * parent, bool record ) | |||
60 | if( !record){ //playing | 60 | if( !record){ //playing |
61 | owarn << "setting up DSP for playing" << oendl; | 61 | owarn << "New Sound device DSP for playing" << oendl; |
62 | flags = O_WRONLY; | 62 | flags = O_RDWR; |
63 | // flags = O_WRONLY; | ||
63 | } else { //recording | 64 | } else { //recording |
64 | owarn << "setting up DSP for recording" << oendl; | 65 | owarn << "New Sound device DSP for recording" << oendl; |
65 | flags = O_RDWR; | 66 | flags = O_RDWR; |
@@ -71,2 +72,3 @@ Device::Device( QObject * parent, bool record ) | |||
71 | bool Device::openDsp() { | 72 | bool Device::openDsp() { |
73 | qWarning("Device::openDsp()"); | ||
72 | if( openDevice( flags) == -1) { | 74 | if( openDevice( flags) == -1) { |
@@ -79,6 +81,6 @@ bool Device::openDsp() { | |||
79 | int Device::openDevice( int flags) { | 81 | int Device::openDevice( int flags) { |
80 | owarn << "Opening"<< dspstr; | 82 | owarn << "Opening sound device:"<< DSPSTROUT << oendl; |
81 | 83 | ||
82 | if (( sd = ::open( DSPSTROUT, flags)) == -1) { | 84 | if (( sd = ::open( DSPSTROUT, O_RDWR)) == -1) { |
83 | perror("open(\"/dev/dsp\")"); | 85 | perror("open(\"/dev/dsp\")\n"); |
84 | QString errorMsg="Could not open audio device\n /dev/dsp\n" | 86 | QString errorMsg="Could not open audio device\n /dev/dsp\n" |
@@ -92,2 +94,3 @@ int Device::openDevice( int flags) { | |||
92 | } | 94 | } |
95 | qWarning("opened!"); | ||
93 | return sd; | 96 | return sd; |
@@ -152,2 +155,3 @@ bool Device::selectMicInput() { | |||
152 | bool Device::closeDevice( bool) { | 155 | bool Device::closeDevice( bool) { |
156 | if(sd) | ||
153 | ::close( sd); //close sound device | 157 | ::close( sd); //close sound device |