-rw-r--r-- | noncore/multimedia/opierec/device.cpp | 44 | ||||
-rw-r--r-- | noncore/multimedia/opierec/helpwindow.cpp | 11 | ||||
-rw-r--r-- | noncore/multimedia/opierec/opierec.pro | 6 | ||||
-rw-r--r-- | noncore/multimedia/opierec/qtrec.cpp | 129 | ||||
-rw-r--r-- | noncore/multimedia/opierec/wavFile.cpp | 67 | ||||
-rw-r--r-- | noncore/multimedia/opierec/waveform.cpp | 12 |
6 files changed, 139 insertions, 130 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp index ce49e96..5319d97 100644 --- a/noncore/multimedia/opierec/device.cpp +++ b/noncore/multimedia/opierec/device.cpp | |||
@@ -3,8 +3,11 @@ | |||
3 | #include "device.h" | 3 | #include "device.h" |
4 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
5 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
6 | #include <qpe/qcopenvelope_qws.h> | 8 | #include <qpe/qcopenvelope_qws.h> |
9 | using namespace Opie::Core; | ||
7 | 10 | ||
8 | 11 | /* STD */ | |
9 | #include <fcntl.h> | 12 | #include <fcntl.h> |
10 | #include <stdio.h> | 13 | #include <stdio.h> |
@@ -14,7 +17,4 @@ | |||
14 | #include <unistd.h> | 17 | #include <unistd.h> |
15 | #include<sys/wait.h> | 18 | #include<sys/wait.h> |
16 | // #include <sys/stat.h> | ||
17 | // #include <sys/time.h> | ||
18 | // #include <sys/types.h> | ||
19 | #include <unistd.h> | 19 | #include <unistd.h> |
20 | #include <errno.h> | 20 | #include <errno.h> |
@@ -33,8 +33,8 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco | |||
33 | 33 | ||
34 | if( !record){ //playing | 34 | if( !record){ //playing |
35 | qDebug("setting up DSP for playing"); | 35 | odebug << "setting up DSP for playing" << oendl; |
36 | flags = O_WRONLY; | 36 | flags = O_WRONLY; |
37 | } else { //recording | 37 | } else { //recording |
38 | qDebug("setting up DSP for recording"); | 38 | odebug << "setting up DSP for recording" << oendl; |
39 | flags = O_RDWR; | 39 | flags = O_RDWR; |
40 | // flags = O_RDONLY; | 40 | // flags = O_RDONLY; |
@@ -97,5 +97,5 @@ void Device::changedOutVolume(int vol) { | |||
97 | cfg.writeEntry("VolumePercent", QString::number( vol )); | 97 | cfg.writeEntry("VolumePercent", QString::number( vol )); |
98 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 98 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
99 | qWarning("changing output vol %d", vol); | 99 | owarn << "changing output vol " << vol << "" << oendl; |
100 | } | 100 | } |
101 | ::close(fd); | 101 | ::close(fd); |
@@ -112,5 +112,5 @@ void Device::changedInVolume(int vol ) { | |||
112 | cfg.writeEntry("Mic", QString::number(vol )); | 112 | cfg.writeEntry("Mic", QString::number(vol )); |
113 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; | 113 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; |
114 | qWarning("changing input volume %d", vol); | 114 | owarn << "changing input volume " << vol << "" << oendl; |
115 | } | 115 | } |
116 | ::close(fd); | 116 | ::close(fd); |
@@ -150,14 +150,14 @@ exit(1); | |||
150 | case 0: { | 150 | case 0: { |
151 | */ | 151 | */ |
152 | qDebug("Opening %s",dspstr); | 152 | odebug << "Opening " << dspstr << "" << oendl; |
153 | if (( sd = ::open( dspstr, flags)) == -1) { | 153 | if (( sd = ::open( dspstr, flags)) == -1) { |
154 | perror("open(\"/dev/dsp\")"); | 154 | perror("open(\"/dev/dsp\")"); |
155 | QString errorMsg="Could not open audio device\n /dev/dsp\n" | 155 | QString errorMsg="Could not open audio device\n /dev/dsp\n" |
156 | +(QString)strerror(errno); | 156 | +(QString)strerror(errno); |
157 | qDebug("XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg); | 157 | odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; |
158 | return -1; | 158 | return -1; |
159 | } | 159 | } |
160 | 160 | ||
161 | qDebug("Opening mixer"); | 161 | odebug << "Opening mixer" << oendl; |
162 | int mixerHandle=0; | 162 | int mixerHandle=0; |
163 | if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { | 163 | if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { |
@@ -165,5 +165,5 @@ qDebug("Opening mixer"); | |||
165 | QString errorMsg="Could not open audio device\n /dev/dsp\n" | 165 | QString errorMsg="Could not open audio device\n /dev/dsp\n" |
166 | +(QString)strerror(errno); | 166 | +(QString)strerror(errno); |
167 | qDebug("XXXXXXXXXXXXXXXXXXXXXX "+errorMsg); | 167 | odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; |
168 | } | 168 | } |
169 | 169 | ||
@@ -181,5 +181,5 @@ qDebug("Opening mixer"); | |||
181 | write(pipefd[1], message, sizeof(message)); | 181 | write(pipefd[1], message, sizeof(message)); |
182 | close(pipefd[1]); | 182 | close(pipefd[1]); |
183 | // qDebug("%d",soundDevice->sd ); | 183 | // odebug << "" << soundDevice->sd << "" << oendl; |
184 | _exit(0); | 184 | _exit(0); |
185 | } | 185 | } |
@@ -207,11 +207,11 @@ qDebug("Opening mixer"); | |||
207 | // bool ok; | 207 | // bool ok; |
208 | // sd = s.toInt(&ok, 10); | 208 | // sd = s.toInt(&ok, 10); |
209 | // qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s); | 209 | // odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl; |
210 | 210 | ||
211 | // f2.close(); | 211 | // f2.close(); |
212 | // } | 212 | // } |
213 | ::close(mixerHandle ); | 213 | ::close(mixerHandle ); |
214 | // qDebug("open device %s", dspstr); | 214 | // odebug << "open device " << dspstr << "" << oendl; |
215 | // qDebug("success! %d",sd); | 215 | // odebug << "success! " << sd << "" << oendl; |
216 | return sd; | 216 | return sd; |
217 | } | 217 | } |
@@ -231,10 +231,10 @@ bool Device::closeDevice( bool) { | |||
231 | // sdfd=0; | 231 | // sdfd=0; |
232 | // sd=0; | 232 | // sd=0; |
233 | // qDebug("closed dsp"); | 233 | // odebug << "closed dsp" << oendl; |
234 | return true; | 234 | return true; |
235 | } | 235 | } |
236 | 236 | ||
237 | bool Device::setDeviceFormat( int form) { | 237 | bool Device::setDeviceFormat( int form) { |
238 | qDebug("set device res %d %d", form, sd); | 238 | odebug << "set device res " << form << " " << sd << "" << oendl; |
239 | if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format | 239 | if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format |
240 | perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); | 240 | perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); |
@@ -246,5 +246,5 @@ bool Device::setDeviceFormat( int form) { | |||
246 | 246 | ||
247 | bool Device::setDeviceChannels( int ch) { | 247 | bool Device::setDeviceChannels( int ch) { |
248 | qDebug("set channels %d %d", ch, sd); | 248 | odebug << "set channels " << ch << " " << sd << "" << oendl; |
249 | if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { | 249 | if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { |
250 | perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); | 250 | perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); |
@@ -256,5 +256,5 @@ bool Device::setDeviceChannels( int ch) { | |||
256 | 256 | ||
257 | bool Device::setDeviceRate( int rate) { | 257 | bool Device::setDeviceRate( int rate) { |
258 | qDebug("set rate %d %d", rate, sd); | 258 | odebug << "set rate " << rate << " " << sd << "" << oendl; |
259 | if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { | 259 | if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { |
260 | perror("ioctl(\"SNDCTL_DSP_SPEED\")"); | 260 | perror("ioctl(\"SNDCTL_DSP_SPEED\")"); |
@@ -319,7 +319,7 @@ int Device::getDeviceFragSize() { | |||
319 | 319 | ||
320 | if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { | 320 | if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { |
321 | qDebug("no fragsize"); | 321 | odebug << "no fragsize" << oendl; |
322 | } else { | 322 | } else { |
323 | qDebug("driver says frag size is %d", frag_size); | 323 | odebug << "driver says frag size is " << frag_size << "" << oendl; |
324 | } | 324 | } |
325 | return frag_size; | 325 | return frag_size; |
diff --git a/noncore/multimedia/opierec/helpwindow.cpp b/noncore/multimedia/opierec/helpwindow.cpp index 6aebaa1..7f984c3 100644 --- a/noncore/multimedia/opierec/helpwindow.cpp +++ b/noncore/multimedia/opierec/helpwindow.cpp | |||
@@ -10,12 +10,17 @@ | |||
10 | 10 | ||
11 | #include "helpwindow.h" | 11 | #include "helpwindow.h" |
12 | #include <qlayout.h> | ||
13 | 12 | ||
14 | #include <qtoolbar.h> | 13 | /* OPIE */ |
14 | #include <opie2/odebug.h> | ||
15 | #include <qpe/resource.h> | 15 | #include <qpe/resource.h> |
16 | using namespace Opie::Core; | ||
16 | 17 | ||
18 | /* QT */ | ||
19 | #include <qlayout.h> | ||
20 | #include <qtoolbar.h> | ||
17 | #include <qaction.h> | 21 | #include <qaction.h> |
18 | #include <qmenubar.h> | 22 | #include <qmenubar.h> |
19 | 23 | ||
24 | /* STD */ | ||
20 | #include <ctype.h> | 25 | #include <ctype.h> |
21 | 26 | ||
@@ -26,5 +31,5 @@ HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* par | |||
26 | layout->setSpacing( 2); | 31 | layout->setSpacing( 2); |
27 | layout->setMargin( 2); | 32 | layout->setMargin( 2); |
28 | qDebug(_path); | 33 | odebug << _path << oendl; |
29 | browser = new QTextBrowser( this ); | 34 | browser = new QTextBrowser( this ); |
30 | QStringList Strlist; | 35 | QStringList Strlist; |
diff --git a/noncore/multimedia/opierec/opierec.pro b/noncore/multimedia/opierec/opierec.pro index 7b08f0e..ea1bae3 100644 --- a/noncore/multimedia/opierec/opierec.pro +++ b/noncore/multimedia/opierec/opierec.pro | |||
@@ -1,5 +1,3 @@ | |||
1 | #CONFIG = qt warn_on pdaudio | 1 | CONFIG = qt warn_on |
2 | CONFIG = qt warn_on opie | ||
3 | #CONFIG = qt warn_on quick-app | ||
4 | HEADERS = adpcm.h \ | 2 | HEADERS = adpcm.h \ |
5 | pixmaps.h \ | 3 | pixmaps.h \ |
@@ -30,5 +28,5 @@ contains(CONFIG, pdaudio) { | |||
30 | } | 28 | } |
31 | 29 | ||
32 | contains(CONFIG, opie) { | 30 | !contains(CONFIG, pdaudio) { |
33 | INCLUDEPATH += $(OPIEDIR)/include | 31 | INCLUDEPATH += $(OPIEDIR)/include |
34 | DEPENDPATH += $(OPIEDIR)/include | 32 | DEPENDPATH += $(OPIEDIR)/include |
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index 1c64ab1..2187d5a 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp | |||
@@ -9,13 +9,10 @@ | |||
9 | #include "qtrec.h" | 9 | #include "qtrec.h" |
10 | #include "waveform.h" | 10 | #include "waveform.h" |
11 | |||
12 | #include <pthread.h> | ||
13 | |||
14 | extern "C" { | 11 | extern "C" { |
15 | #include "adpcm.h" | 12 | #include "adpcm.h" |
16 | } | 13 | } |
17 | 14 | ||
18 | #include <sys/soundcard.h> | 15 | /* OPIE */ |
19 | 16 | #include <opie2/odebug.h> | |
20 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
@@ -23,8 +20,9 @@ extern "C" { | |||
23 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
24 | #include <qpe/storage.h> | 21 | #include <qpe/storage.h> |
22 | using namespace Opie::Core; | ||
25 | 23 | ||
24 | /* QT */ | ||
26 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
27 | #include <qcombobox.h> | 26 | #include <qcombobox.h> |
28 | //#include <qdatetime.h> | ||
29 | #include <qdir.h> | 27 | #include <qdir.h> |
30 | #include <qgroupbox.h> | 28 | #include <qgroupbox.h> |
@@ -39,4 +37,5 @@ extern "C" { | |||
39 | #include <qtimer.h> | 37 | #include <qtimer.h> |
40 | 38 | ||
39 | /* STD */ | ||
41 | #include <errno.h> | 40 | #include <errno.h> |
42 | #include <fcntl.h> | 41 | #include <fcntl.h> |
@@ -54,5 +53,5 @@ extern "C" { | |||
54 | #include <sys/wait.h> | 53 | #include <sys/wait.h> |
55 | #include <sys/signal.h> | 54 | #include <sys/signal.h> |
56 | 55 | #include <pthread.h> | |
57 | 56 | ||
58 | #ifdef PDAUDIO //ALSA | 57 | #ifdef PDAUDIO //ALSA |
@@ -137,15 +136,15 @@ void quickRec() | |||
137 | int threshold = 0; | 136 | int threshold = 0; |
138 | // int bits = filePara.resolution; | 137 | // int bits = filePara.resolution; |
139 | // qDebug("bits %d", bits); | 138 | // odebug << "bits " << bits << "" << oendl; |
140 | 139 | ||
141 | if( filePara.resolution == 16 ) { //AFMT_S16_LE) | 140 | if( filePara.resolution == 16 ) { //AFMT_S16_LE) |
142 | // qDebug("AFMT_S16_LE size %d", filePara.SecondsToRecord); | 141 | // odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl; |
143 | // qDebug("samples to record %d", filePara.samplesToRecord); | 142 | // odebug << "samples to record " << filePara.samplesToRecord << "" << oendl; |
144 | // qDebug("%d", filePara.sd); | 143 | // odebug << "" << filePara.sd << "" << oendl; |
145 | level = 7; | 144 | level = 7; |
146 | threshold = 0; | 145 | threshold = 0; |
147 | 146 | ||
148 | if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { | 147 | if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { |
149 | // qDebug("start recording WAVE_FORMAT_DVI_ADPCM"); | 148 | // odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl; |
150 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> | 149 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> |
151 | char abuf[ BUFSIZE/2 ]; | 150 | char abuf[ BUFSIZE/2 ]; |
@@ -158,5 +157,5 @@ void quickRec() | |||
158 | for(;;) { | 157 | for(;;) { |
159 | if ( stopped) { | 158 | if ( stopped) { |
160 | // qDebug("quickRec:: stopped"); | 159 | // odebug << "quickRec:: stopped" << oendl; |
161 | break; | 160 | break; |
162 | } | 161 | } |
@@ -167,5 +166,5 @@ void quickRec() | |||
167 | if(number <= 0) { | 166 | if(number <= 0) { |
168 | perror("recording error "); | 167 | perror("recording error "); |
169 | qDebug( "%s %d", filePara.fileName, number); | 168 | odebug << "" << filePara.fileName << " " << number << "" << oendl; |
170 | stopped = true; | 169 | stopped = true; |
171 | return; | 170 | return; |
@@ -193,5 +192,5 @@ void quickRec() | |||
193 | } else { | 192 | } else { |
194 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> | 193 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> |
195 | qDebug("start recording WAVE_FORMAT_PCM"); | 194 | odebug << "start recording WAVE_FORMAT_PCM" << oendl; |
196 | short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; | 195 | short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; |
197 | memset( inbuffer, 0, BUFSIZE); | 196 | memset( inbuffer, 0, BUFSIZE); |
@@ -200,5 +199,5 @@ void quickRec() | |||
200 | for(;;) { | 199 | for(;;) { |
201 | if ( stopped) { | 200 | if ( stopped) { |
202 | qDebug("quickRec:: stopped"); | 201 | odebug << "quickRec:: stopped" << oendl; |
203 | stopped = true; | 202 | stopped = true; |
204 | break; // stop if playing was set to false | 203 | break; // stop if playing was set to false |
@@ -211,5 +210,5 @@ void quickRec() | |||
211 | if( number <= 0) { | 210 | if( number <= 0) { |
212 | perror( "recording error "); | 211 | perror( "recording error "); |
213 | qDebug( filePara.fileName); | 212 | odebug << filePara.fileName << oendl; |
214 | stopped = true; | 213 | stopped = true; |
215 | return; | 214 | return; |
@@ -251,5 +250,5 @@ void quickRec() | |||
251 | for(;;) { | 250 | for(;;) { |
252 | if ( stopped) { | 251 | if ( stopped) { |
253 | qDebug("quickRec:: stopped"); | 252 | odebug << "quickRec:: stopped" << oendl; |
254 | break; // stop if playing was set to false | 253 | break; // stop if playing was set to false |
255 | } | 254 | } |
@@ -374,5 +373,5 @@ void playIt() | |||
374 | 373 | ||
375 | if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { | 374 | if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { |
376 | qWarning("Jane! Stop this crazy thing!"); | 375 | owarn << "Jane! Stop this crazy thing!" << oendl; |
377 | stopped = true; | 376 | stopped = true; |
378 | // playing = false; | 377 | // playing = false; |
@@ -719,5 +718,5 @@ void QtRec::initIconView() { | |||
719 | 718 | ||
720 | int nFiles = cfg.readNumEntry("NumberofFiles",0); | 719 | int nFiles = cfg.readNumEntry("NumberofFiles",0); |
721 | // qDebug("init number of files %d", nFiles); | 720 | // odebug << "init number of files " << nFiles << "" << oendl; |
722 | 721 | ||
723 | for(int i=1;i<= nFiles;i++) { | 722 | for(int i=1;i<= nFiles;i++) { |
@@ -861,5 +860,5 @@ void QtRec::initConfig() { | |||
861 | 860 | ||
862 | void QtRec::stop() { | 861 | void QtRec::stop() { |
863 | qWarning("STOP"); | 862 | owarn << "STOP" << oendl; |
864 | setRecordButton(false); | 863 | setRecordButton(false); |
865 | 864 | ||
@@ -923,8 +922,8 @@ bool QtRec::rec() { //record | |||
923 | 922 | ||
924 | //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); | 923 | //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); |
925 | // qDebug("sample rate is %d", filePara.sampleRate); | 924 | // odebug << "sample rate is " << filePara.sampleRate << "" << oendl; |
926 | filePara.SecondsToRecord = getCurrentSizeLimit(); | 925 | filePara.SecondsToRecord = getCurrentSizeLimit(); |
927 | 926 | ||
928 | // qDebug("size limit %d sec", filePara.SecondsToRecord); | 927 | // odebug << "size limit " << filePara.SecondsToRecord << " sec" << oendl; |
929 | int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); | 928 | int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); |
930 | 929 | ||
@@ -932,9 +931,9 @@ bool QtRec::rec() { //record | |||
932 | fileSize = diskSize; | 931 | fileSize = diskSize; |
933 | } else if( filePara.format == WAVE_FORMAT_PCM) { | 932 | } else if( filePara.format == WAVE_FORMAT_PCM) { |
934 | // qDebug("WAVE_FORMAT_PCM"); | 933 | // odebug << "WAVE_FORMAT_PCM" << oendl; |
935 | fileSize = (filePara.SecondsToRecord ) * filePara.channels | 934 | fileSize = (filePara.SecondsToRecord ) * filePara.channels |
936 | * filePara.sampleRate * ( filePara.resolution / 8) + 1000; | 935 | * filePara.sampleRate * ( filePara.resolution / 8) + 1000; |
937 | } else { | 936 | } else { |
938 | // qDebug("WAVE_FORMAT_DVI_ADPCM"); | 937 | // odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; |
939 | fileSize = ((filePara.SecondsToRecord) * filePara.channels | 938 | fileSize = ((filePara.SecondsToRecord) * filePara.channels |
940 | * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250; | 939 | * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250; |
@@ -948,5 +947,5 @@ bool QtRec::rec() { //record | |||
948 | } | 947 | } |
949 | // else { | 948 | // else { |
950 | qDebug("Setting timeslider %d", filePara.samplesToRecord); | 949 | odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl; |
951 | // if(fileSize != 0) | 950 | // if(fileSize != 0) |
952 | timeSlider->setRange(0, filePara.samplesToRecord); | 951 | timeSlider->setRange(0, filePara.samplesToRecord); |
@@ -967,5 +966,5 @@ bool QtRec::rec() { //record | |||
967 | #endif | 966 | #endif |
968 | filePara.fileName=currentFile.latin1(); | 967 | filePara.fileName=currentFile.latin1(); |
969 | qDebug("Start recording thread"); | 968 | odebug << "Start recording thread" << oendl; |
970 | stopped = false; | 969 | stopped = false; |
971 | 970 | ||
@@ -1011,5 +1010,5 @@ void QtRec::thisTab(QWidget* widg) { | |||
1011 | void QtRec::getOutVol( ) { | 1010 | void QtRec::getOutVol( ) { |
1012 | filePara.outVol = soundDevice->getOutVolume(); | 1011 | filePara.outVol = soundDevice->getOutVolume(); |
1013 | // qDebug("out vol %d", filePara.outVol); | 1012 | // odebug << "out vol " << filePara.outVol << "" << oendl; |
1014 | OutputSlider->setValue( -filePara.outVol); | 1013 | OutputSlider->setValue( -filePara.outVol); |
1015 | } | 1014 | } |
@@ -1017,5 +1016,5 @@ void QtRec::getOutVol( ) { | |||
1017 | void QtRec::getInVol() { | 1016 | void QtRec::getInVol() { |
1018 | filePara.inVol = soundDevice->getInVolume(); | 1017 | filePara.inVol = soundDevice->getInVolume(); |
1019 | // qDebug("in vol %d", filePara.inVol); | 1018 | // odebug << "in vol " << filePara.inVol << "" << oendl; |
1020 | InputSlider->setValue( -filePara.inVol); | 1019 | InputSlider->setValue( -filePara.inVol); |
1021 | } | 1020 | } |
@@ -1091,9 +1090,9 @@ bool QtRec::setupAudio( bool b) { | |||
1091 | if( !compressionCheckBox->isChecked()) { | 1090 | if( !compressionCheckBox->isChecked()) { |
1092 | filePara.format = WAVE_FORMAT_PCM; | 1091 | filePara.format = WAVE_FORMAT_PCM; |
1093 | // qDebug("WAVE_FORMAT_PCM"); | 1092 | // odebug << "WAVE_FORMAT_PCM" << oendl; |
1094 | } else { | 1093 | } else { |
1095 | filePara.format = WAVE_FORMAT_DVI_ADPCM; | 1094 | filePara.format = WAVE_FORMAT_DVI_ADPCM; |
1096 | sampleformat = AFMT_S16_LE; | 1095 | sampleformat = AFMT_S16_LE; |
1097 | // qDebug("WAVE_FORMAT_DVI_ADPCM"); | 1096 | // odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; |
1098 | } | 1097 | } |
1099 | #endif | 1098 | #endif |
@@ -1111,6 +1110,6 @@ bool QtRec::setupAudio( bool b) { | |||
1111 | 1110 | ||
1112 | // if(soundDevice) delete soundDevice; | 1111 | // if(soundDevice) delete soundDevice; |
1113 | qDebug("<<<<<<<<<<<<<<<<<<<open dsp %d %d %d", filePara.sampleRate, filePara.channels, sampleformat); | 1112 | odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl; |
1114 | qWarning("change waveform settings"); | 1113 | owarn << "change waveform settings" << oendl; |
1115 | waveform->changeSettings( filePara.sampleRate, filePara.channels ); | 1114 | waveform->changeSettings( filePara.sampleRate, filePara.channels ); |
1116 | 1115 | ||
@@ -1119,5 +1118,5 @@ bool QtRec::setupAudio( bool b) { | |||
1119 | soundDevice->reset(); | 1118 | soundDevice->reset(); |
1120 | 1119 | ||
1121 | qDebug("device has been made %d", soundDevice->sd); | 1120 | odebug << "device has been made " << soundDevice->sd << "" << oendl; |
1122 | 1121 | ||
1123 | ////////////////// <<<<<<<<<<<<>>>>>>>>>>>> | 1122 | ////////////////// <<<<<<<<<<<<>>>>>>>>>>>> |
@@ -1150,5 +1149,5 @@ bool QtRec::setupAudio( bool b) { | |||
1150 | 1149 | ||
1151 | bool QtRec::setUpFile() { //setup file for recording | 1150 | bool QtRec::setUpFile() { //setup file for recording |
1152 | // qDebug("Setting up wavfile"); | 1151 | // odebug << "Setting up wavfile" << oendl; |
1153 | // if(wavFile) delete wavFile; | 1152 | // if(wavFile) delete wavFile; |
1154 | wavFile = new WavFile( this, (const QString &)"", | 1153 | wavFile = new WavFile( this, (const QString &)"", |
@@ -1183,5 +1182,5 @@ bool QtRec::doPlay() { | |||
1183 | 1182 | ||
1184 | QString num; | 1183 | QString num; |
1185 | qDebug( "Play number of samples %d", filePara.numberSamples); | 1184 | odebug << "Play number of samples " << filePara.numberSamples << "" << oendl; |
1186 | 1185 | ||
1187 | // timeSlider->setRange( 0, filePara.numberSamples); | 1186 | // timeSlider->setRange( 0, filePara.numberSamples); |
@@ -1235,5 +1234,5 @@ void QtRec::changesamplerateCombo(int i) { | |||
1235 | cfg.writeEntry( "samplerate",rate); | 1234 | cfg.writeEntry( "samplerate",rate); |
1236 | filePara.sampleRate=rate; | 1235 | filePara.sampleRate=rate; |
1237 | qDebug( "Change sample rate %d", rate); | 1236 | odebug << "Change sample rate " << rate << "" << oendl; |
1238 | cfg.write(); | 1237 | cfg.write(); |
1239 | } | 1238 | } |
@@ -1255,5 +1254,5 @@ void QtRec::changeDirCombo(int index) { | |||
1255 | recDir = path; | 1254 | recDir = path; |
1256 | cfg.writeEntry("directory", recDir); | 1255 | cfg.writeEntry("directory", recDir); |
1257 | qDebug("new rec dir "+recDir); | 1256 | odebug << "new rec dir "+recDir << oendl; |
1258 | } | 1257 | } |
1259 | } | 1258 | } |
@@ -1375,5 +1374,5 @@ void QtRec::keyPressEvent( QKeyEvent *e) { | |||
1375 | break; | 1374 | break; |
1376 | case Key_Left: { | 1375 | case Key_Left: { |
1377 | qDebug("rewinding"); | 1376 | odebug << "rewinding" << oendl; |
1378 | if( !e->isAutoRepeat()) | 1377 | if( !e->isAutoRepeat()) |
1379 | rewindPressed(); | 1378 | rewindPressed(); |
@@ -1429,17 +1428,17 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { | |||
1429 | case Key_Up: | 1428 | case Key_Up: |
1430 | // stop(); | 1429 | // stop(); |
1431 | qDebug("Up"); | 1430 | odebug << "Up" << oendl; |
1432 | break; | 1431 | break; |
1433 | case Key_Down: | 1432 | case Key_Down: |
1434 | // start(); | 1433 | // start(); |
1435 | // qDebug("Down"); | 1434 | // odebug << "Down" << oendl; |
1436 | // newSound(); | 1435 | // newSound(); |
1437 | break; | 1436 | break; |
1438 | case Key_Left: | 1437 | case Key_Left: |
1439 | qDebug("Left"); | 1438 | odebug << "Left" << oendl; |
1440 | rewindReleased(); | 1439 | rewindReleased(); |
1441 | break; | 1440 | break; |
1442 | case Key_Right: | 1441 | case Key_Right: |
1443 | qDebug("Right"); | 1442 | odebug << "Right" << oendl; |
1444 | FastforwardReleased(); | 1443 | FastforwardReleased(); |
1445 | break; | 1444 | break; |
@@ -1476,9 +1475,9 @@ void QtRec::endRecording() { | |||
1476 | QString cmd; | 1475 | QString cmd; |
1477 | cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); | 1476 | cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); |
1478 | // qDebug("moving tmp file to "+currentFileName); | 1477 | // odebug << "moving tmp file to "+currentFileName << oendl; |
1479 | system( cmd.latin1()); | 1478 | system( cmd.latin1()); |
1480 | } | 1479 | } |
1481 | 1480 | ||
1482 | qDebug("Just moved " + wavFile->currentFileName); | 1481 | odebug << "Just moved " + wavFile->currentFileName << oendl; |
1483 | Config cfg("OpieRec"); | 1482 | Config cfg("OpieRec"); |
1484 | cfg.setGroup("Sounds"); | 1483 | cfg.setGroup("Sounds"); |
@@ -1496,8 +1495,8 @@ void QtRec::endRecording() { | |||
1496 | time.sprintf("%.2f", filePara.numberOfRecordedSeconds); | 1495 | time.sprintf("%.2f", filePara.numberOfRecordedSeconds); |
1497 | cfg.writeEntry( wavFile->currentFileName, time ); | 1496 | cfg.writeEntry( wavFile->currentFileName, time ); |
1498 | // qDebug("writing config numberOfRecordedSeconds "+time); | 1497 | // odebug << "writing config numberOfRecordedSeconds "+time << oendl; |
1499 | 1498 | ||
1500 | cfg.write(); | 1499 | cfg.write(); |
1501 | qDebug("finished recording"); | 1500 | odebug << "finished recording" << oendl; |
1502 | timeLabel->setText(""); | 1501 | timeLabel->setText(""); |
1503 | } | 1502 | } |
@@ -1517,5 +1516,5 @@ void QtRec::endPlaying() { | |||
1517 | waveform->reset(); | 1516 | waveform->reset(); |
1518 | // errorStop(); | 1517 | // errorStop(); |
1519 | // qDebug("end playing"); | 1518 | // odebug << "end playing" << oendl; |
1520 | setRecordButton( false); | 1519 | setRecordButton( false); |
1521 | 1520 | ||
@@ -1529,5 +1528,5 @@ void QtRec::endPlaying() { | |||
1529 | soundDevice->sd = -1; | 1528 | soundDevice->sd = -1; |
1530 | // if(soundDevice) delete soundDevice; | 1529 | // if(soundDevice) delete soundDevice; |
1531 | // qDebug("file and sound device closed"); | 1530 | // odebug << "file and sound device closed" << oendl; |
1532 | timeLabel->setText(""); | 1531 | timeLabel->setText(""); |
1533 | total = 0; | 1532 | total = 0; |
@@ -1538,7 +1537,7 @@ void QtRec::endPlaying() { | |||
1538 | // if(wavFile) delete wavFile; //this crashes | 1537 | // if(wavFile) delete wavFile; //this crashes |
1539 | 1538 | ||
1540 | // qDebug("track closed"); | 1539 | // odebug << "track closed" << oendl; |
1541 | killTimers(); | 1540 | killTimers(); |
1542 | qWarning("reset slider"); | 1541 | owarn << "reset slider" << oendl; |
1543 | timeSlider->setValue(0); | 1542 | timeSlider->setValue(0); |
1544 | 1543 | ||
@@ -1562,5 +1561,5 @@ bool QtRec::openPlayFile() { | |||
1562 | if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) { | 1561 | if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) { |
1563 | currentFileName = cfg.readEntry( currentFile, "" ); | 1562 | currentFileName = cfg.readEntry( currentFile, "" ); |
1564 | qDebug("opening for play: " + currentFileName); | 1563 | odebug << "opening for play: " + currentFileName << oendl; |
1565 | } | 1564 | } |
1566 | } | 1565 | } |
@@ -1587,8 +1586,8 @@ bool QtRec::openPlayFile() { | |||
1587 | monitoring = true; | 1586 | monitoring = true; |
1588 | 1587 | ||
1589 | qDebug("file %d, samples %d %d", filePara.fd, filePara.numberSamples, filePara.sampleRate); | 1588 | odebug << "file " << filePara.fd << ", samples " << filePara.numberSamples << " " << filePara.sampleRate << "" << oendl; |
1590 | int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); | 1589 | int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); |
1591 | 1590 | ||
1592 | qWarning("seconds %d", sec); | 1591 | owarn << "seconds " << sec << "" << oendl; |
1593 | 1592 | ||
1594 | timeSlider->setRange(0, filePara.numberSamples ); | 1593 | timeSlider->setRange(0, filePara.numberSamples ); |
@@ -1691,5 +1690,5 @@ void QtRec::doRename() { | |||
1691 | 1690 | ||
1692 | void QtRec::okRename() { | 1691 | void QtRec::okRename() { |
1693 | qDebug(renameBox->text()); | 1692 | odebug << renameBox->text() << oendl; |
1694 | QString filename = renameBox->text(); | 1693 | QString filename = renameBox->text(); |
1695 | cancelRename(); | 1694 | cancelRename(); |
@@ -1703,5 +1702,5 @@ void QtRec::okRename() { | |||
1703 | QString file = ListView1->currentItem()->text(0); | 1702 | QString file = ListView1->currentItem()->text(0); |
1704 | 1703 | ||
1705 | qDebug("filename is " + filename); | 1704 | odebug << "filename is " + filename << oendl; |
1706 | 1705 | ||
1707 | int nFiles = cfg.readNumEntry("NumberofFiles",0); | 1706 | int nFiles = cfg.readNumEntry("NumberofFiles",0); |
@@ -1774,5 +1773,5 @@ void QtRec::doVolMuting(bool b) { | |||
1774 | 1773 | ||
1775 | void QtRec::doMicMuting(bool b) { | 1774 | void QtRec::doMicMuting(bool b) { |
1776 | // qDebug("mic mute"); | 1775 | // odebug << "mic mute" << oendl; |
1777 | Config cfg( "qpe" ); | 1776 | Config cfg( "qpe" ); |
1778 | cfg. setGroup( "Volume" ); | 1777 | cfg. setGroup( "Volume" ); |
@@ -1830,5 +1829,5 @@ long QtRec::checkDiskSpace(const QString &path) { | |||
1830 | 1829 | ||
1831 | void QtRec::receive( const QCString &msg, const QByteArray & ) { | 1830 | void QtRec::receive( const QCString &msg, const QByteArray & ) { |
1832 | qDebug("Voicerecord received message "+msg); | 1831 | odebug << "Voicerecord received message "+msg << oendl; |
1833 | 1832 | ||
1834 | } | 1833 | } |
@@ -1855,5 +1854,5 @@ void QtRec::timerEvent( QTimerEvent * ) { | |||
1855 | } | 1854 | } |
1856 | 1855 | ||
1857 | qDebug( "%d", secCount ); | 1856 | odebug << "" << secCount << "" << oendl; |
1858 | QString timeString; | 1857 | QString timeString; |
1859 | #ifdef DEV_VERSION | 1858 | #ifdef DEV_VERSION |
@@ -1871,5 +1870,5 @@ void QtRec::timerEvent( QTimerEvent * ) { | |||
1871 | void QtRec::changeTimeSlider(int index) { | 1870 | void QtRec::changeTimeSlider(int index) { |
1872 | if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; | 1871 | if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; |
1873 | // qDebug("Slider moved to %d",index); | 1872 | // odebug << "Slider moved to " << index << "" << oendl; |
1874 | paused = true; | 1873 | paused = true; |
1875 | stopped = true; | 1874 | stopped = true; |
@@ -1886,5 +1885,5 @@ void QtRec::changeTimeSlider(int index) { | |||
1886 | void QtRec::timeSliderPressed() { | 1885 | void QtRec::timeSliderPressed() { |
1887 | if( ListView1->currentItem() == 0) return; | 1886 | if( ListView1->currentItem() == 0) return; |
1888 | // qDebug("slider pressed"); | 1887 | // odebug << "slider pressed" << oendl; |
1889 | paused = true; | 1888 | paused = true; |
1890 | stopped = true; | 1889 | stopped = true; |
@@ -1895,5 +1894,5 @@ void QtRec::timeSliderReleased() { | |||
1895 | sliderPos = timeSlider->value(); | 1894 | sliderPos = timeSlider->value(); |
1896 | 1895 | ||
1897 | // qDebug("slider released %d", sliderPos); | 1896 | // odebug << "slider released " << sliderPos << "" << oendl; |
1898 | stopped = false; | 1897 | stopped = false; |
1899 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); | 1898 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); |
@@ -1925,5 +1924,5 @@ void QtRec::rewindTimerTimeout() { | |||
1925 | // if(toBeginningButton->isDown()) | 1924 | // if(toBeginningButton->isDown()) |
1926 | timeSlider->setValue( sliderValue ) ; | 1925 | timeSlider->setValue( sliderValue ) ; |
1927 | // qDebug("%d", sliderValue); | 1926 | // odebug << "" << sliderValue << "" << oendl; |
1928 | QString timeString; | 1927 | QString timeString; |
1929 | filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2; | 1928 | filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2; |
@@ -1939,5 +1938,5 @@ void QtRec::rewindReleased() { | |||
1939 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); | 1938 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); |
1940 | total = newPos * 4; | 1939 | total = newPos * 4; |
1941 | // qDebug("rewind released %d", total); | 1940 | // odebug << "rewind released " << total << "" << oendl; |
1942 | startTimer( 1000); | 1941 | startTimer( 1000); |
1943 | doPlay(); | 1942 | doPlay(); |
@@ -2003,5 +2002,5 @@ QString QtRec::getStorage(const QString &fileName) { | |||
2003 | // if( name.find( tr("Internal"),0,true) == -1) { | 2002 | // if( name.find( tr("Internal"),0,true) == -1) { |
2004 | // storageComboBox->insertItem( name +" -> "+disk); | 2003 | // storageComboBox->insertItem( name +" -> "+disk); |
2005 | // qDebug(name); | 2004 | // odebug << name << oendl; |
2006 | } | 2005 | } |
2007 | return storage; | 2006 | return storage; |
diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp index 35bc14d..7e9b50f 100644 --- a/noncore/multimedia/opierec/wavFile.cpp +++ b/noncore/multimedia/opierec/wavFile.cpp | |||
@@ -3,15 +3,18 @@ | |||
3 | #include "qtrec.h" | 3 | #include "qtrec.h" |
4 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
7 | #include <qpe/config.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
10 | /* QT */ | ||
5 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
6 | #include <qdir.h> | 12 | #include <qdir.h> |
7 | 13 | ||
8 | #include <qpe/config.h> | 14 | /* STD */ |
9 | |||
10 | #include <errno.h> | 15 | #include <errno.h> |
11 | |||
12 | #include <sys/time.h> | 16 | #include <sys/time.h> |
13 | #include <sys/types.h> | 17 | #include <sys/types.h> |
14 | #include <sys/vfs.h> | 18 | #include <sys/vfs.h> |
15 | |||
16 | #include <fcntl.h> | 19 | #include <fcntl.h> |
17 | #include <math.h> | 20 | #include <math.h> |
@@ -25,5 +28,5 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int | |||
25 | : QObject( parent) | 28 | : QObject( parent) |
26 | { | 29 | { |
27 | //qDebug("new wave file"); | 30 | //odebug << "new wave file" << oendl; |
28 | bool b = makeNwFile; | 31 | bool b = makeNwFile; |
29 | wavSampleRate=sampleRate; | 32 | wavSampleRate=sampleRate; |
@@ -41,5 +44,5 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int | |||
41 | bool WavFile::newFile() { | 44 | bool WavFile::newFile() { |
42 | 45 | ||
43 | // qDebug("Set up new file"); | 46 | // odebug << "Set up new file" << oendl; |
44 | Config cfg("OpieRec"); | 47 | Config cfg("OpieRec"); |
45 | cfg.setGroup("Settings"); | 48 | cfg.setGroup("Settings"); |
@@ -61,5 +64,5 @@ bool WavFile::newFile() { | |||
61 | currentFileName+=".wav"; | 64 | currentFileName+=".wav"; |
62 | 65 | ||
63 | // qDebug("set up file for recording: "+currentFileName); | 66 | // odebug << "set up file for recording: "+currentFileName << oendl; |
64 | char pointer[] = "/tmp/opierec-XXXXXX"; | 67 | char pointer[] = "/tmp/opierec-XXXXXX"; |
65 | int fd = 0; | 68 | int fd = 0; |
@@ -76,5 +79,5 @@ bool WavFile::newFile() { | |||
76 | } | 79 | } |
77 | 80 | ||
78 | // qDebug("Opening tmp file %s",pointer); | 81 | // odebug << "Opening tmp file " << pointer << "" << oendl; |
79 | track.setName( pointer); | 82 | track.setName( pointer); |
80 | 83 | ||
@@ -86,5 +89,5 @@ bool WavFile::newFile() { | |||
86 | if(!track.open( IO_ReadWrite | IO_Truncate)) { | 89 | if(!track.open( IO_ReadWrite | IO_Truncate)) { |
87 | QString errorMsg=(QString)strerror(errno); | 90 | QString errorMsg=(QString)strerror(errno); |
88 | qDebug(errorMsg); | 91 | odebug << errorMsg << oendl; |
89 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); | 92 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); |
90 | 93 | ||
@@ -107,5 +110,5 @@ void WavFile::closeFile() { | |||
107 | 110 | ||
108 | int WavFile::openFile(const QString ¤tFileName) { | 111 | int WavFile::openFile(const QString ¤tFileName) { |
109 | // qDebug("open play file "+currentFileName); | 112 | // odebug << "open play file "+currentFileName << oendl; |
110 | closeFile(); | 113 | closeFile(); |
111 | 114 | ||
@@ -114,5 +117,5 @@ int WavFile::openFile(const QString ¤tFileName) { | |||
114 | if(!track.open(IO_ReadOnly)) { | 117 | if(!track.open(IO_ReadOnly)) { |
115 | QString errorMsg=(QString)strerror(errno); | 118 | QString errorMsg=(QString)strerror(errno); |
116 | qDebug("<<<<<<<<<<< "+errorMsg+currentFileName); | 119 | odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl; |
117 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); | 120 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); |
118 | return -1; | 121 | return -1; |
@@ -132,9 +135,9 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { | |||
132 | if( wavFormat == WAVE_FORMAT_PCM) { | 135 | if( wavFormat == WAVE_FORMAT_PCM) { |
133 | (*hdr).fmtTag = 1; // PCM | 136 | (*hdr).fmtTag = 1; // PCM |
134 | // qDebug("set header WAVE_FORMAT_PCM"); | 137 | // odebug << "set header WAVE_FORMAT_PCM" << oendl; |
135 | } | 138 | } |
136 | else { | 139 | else { |
137 | (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM | 140 | (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM |
138 | // qDebug("set header WAVE_FORMAT_DVI_ADPCM"); | 141 | // odebug << "set header WAVE_FORMAT_DVI_ADPCM" << oendl; |
139 | } | 142 | } |
140 | 143 | ||
@@ -161,10 +164,10 @@ bool WavFile::adjustHeaders(int fd, int total) { | |||
161 | lseek( fd, 40, SEEK_SET); | 164 | lseek( fd, 40, SEEK_SET); |
162 | write( fd, &total, sizeof(total)); | 165 | write( fd, &total, sizeof(total)); |
163 | qDebug("adjusting header %d", total); | 166 | odebug << "adjusting header " << total << "" << oendl; |
164 | return true; | 167 | return true; |
165 | } | 168 | } |
166 | 169 | ||
167 | int WavFile::parseWavHeader(int fd) { | 170 | int WavFile::parseWavHeader(int fd) { |
168 | qDebug("Parsing wav header"); | 171 | odebug << "Parsing wav header" << oendl; |
169 | char string[4]; | 172 | char string[4]; |
170 | int found; | 173 | int found; |
@@ -174,18 +177,18 @@ int WavFile::parseWavHeader(int fd) { | |||
174 | 177 | ||
175 | if (read(fd, string, 4) < 4) { | 178 | if (read(fd, string, 4) < 4) { |
176 | qDebug(" Could not read from sound file.\n"); | 179 | odebug << " Could not read from sound file.\n" << oendl; |
177 | return -1; | 180 | return -1; |
178 | } | 181 | } |
179 | if (strncmp(string, "RIFF", 4)) { | 182 | if (strncmp(string, "RIFF", 4)) { |
180 | qDebug(" not a valid WAV file.\n"); | 183 | odebug << " not a valid WAV file.\n" << oendl; |
181 | return -1; | 184 | return -1; |
182 | } | 185 | } |
183 | lseek(fd, 4, SEEK_CUR); | 186 | lseek(fd, 4, SEEK_CUR); |
184 | if (read(fd, string, 4) < 4) { | 187 | if (read(fd, string, 4) < 4) { |
185 | qDebug("Could not read from sound file.\n"); | 188 | odebug << "Could not read from sound file.\n" << oendl; |
186 | return -1; | 189 | return -1; |
187 | } | 190 | } |
188 | if (strncmp(string, "WAVE", 4)) { | 191 | if (strncmp(string, "WAVE", 4)) { |
189 | qDebug("not a valid WAV file.\n"); | 192 | odebug << "not a valid WAV file.\n" << oendl; |
190 | return -1; | 193 | return -1; |
191 | } | 194 | } |
@@ -194,10 +197,10 @@ int WavFile::parseWavHeader(int fd) { | |||
194 | while (!found) { | 197 | while (!found) { |
195 | if (read(fd, string, 4) < 4) { | 198 | if (read(fd, string, 4) < 4) { |
196 | qDebug("Could not read from sound file.\n"); | 199 | odebug << "Could not read from sound file.\n" << oendl; |
197 | return -1; | 200 | return -1; |
198 | } | 201 | } |
199 | if (strncmp(string, "fmt ", 4)) { | 202 | if (strncmp(string, "fmt ", 4)) { |
200 | if (read(fd, &longdata, 4) < 4) { | 203 | if (read(fd, &longdata, 4) < 4) { |
201 | qDebug("Could not read from sound file.\n"); | 204 | odebug << "Could not read from sound file.\n" << oendl; |
202 | return -1; | 205 | return -1; |
203 | } | 206 | } |
@@ -206,5 +209,5 @@ int WavFile::parseWavHeader(int fd) { | |||
206 | lseek(fd, 4, SEEK_CUR); | 209 | lseek(fd, 4, SEEK_CUR); |
207 | if (read(fd, &fmt, 2) < 2) { | 210 | if (read(fd, &fmt, 2) < 2) { |
208 | qDebug("Could not read format chunk.\n"); | 211 | odebug << "Could not read format chunk.\n" << oendl; |
209 | return -1; | 212 | return -1; |
210 | } | 213 | } |
@@ -216,28 +219,28 @@ int WavFile::parseWavHeader(int fd) { | |||
216 | wavFormat = fmt; | 219 | wavFormat = fmt; |
217 | // compressionFormat=fmt; | 220 | // compressionFormat=fmt; |
218 | qDebug("compressionFormat is %d", fmt); | 221 | odebug << "compressionFormat is " << fmt << "" << oendl; |
219 | if (read(fd, &ch, 2) < 2) { | 222 | if (read(fd, &ch, 2) < 2) { |
220 | qDebug("Could not read format chunk.\n"); | 223 | odebug << "Could not read format chunk.\n" << oendl; |
221 | return -1; | 224 | return -1; |
222 | } else { | 225 | } else { |
223 | wavChannels = ch; | 226 | wavChannels = ch; |
224 | qDebug("File has %d channels", ch); | 227 | odebug << "File has " << ch << " channels" << oendl; |
225 | } | 228 | } |
226 | if (read(fd, &samplerrate, 4) < 4) { | 229 | if (read(fd, &samplerrate, 4) < 4) { |
227 | qDebug("Could not read from format chunk.\n"); | 230 | odebug << "Could not read from format chunk.\n" << oendl; |
228 | return -1; | 231 | return -1; |
229 | } else { | 232 | } else { |
230 | wavSampleRate = samplerrate; | 233 | wavSampleRate = samplerrate; |
231 | // sampleRate = samplerrate; | 234 | // sampleRate = samplerrate; |
232 | qDebug("File has samplerate of %d",(int) samplerrate); | 235 | odebug << "File has samplerate of " << (int) samplerrate << "" << oendl; |
233 | } | 236 | } |
234 | lseek(fd, 6, SEEK_CUR); | 237 | lseek(fd, 6, SEEK_CUR); |
235 | if (read(fd, &bitrate, 2) < 2) { | 238 | if (read(fd, &bitrate, 2) < 2) { |
236 | qDebug("Could not read format chunk.\n"); | 239 | odebug << "Could not read format chunk.\n" << oendl; |
237 | return -1; | 240 | return -1; |
238 | } else { | 241 | } else { |
239 | wavResolution=bitrate; | 242 | wavResolution=bitrate; |
240 | // resolution = bitrate; | 243 | // resolution = bitrate; |
241 | qDebug("File has bitrate of %d", bitrate); | 244 | odebug << "File has bitrate of " << bitrate << "" << oendl; |
242 | } | 245 | } |
243 | found++; | 246 | found++; |
@@ -247,5 +250,5 @@ int WavFile::parseWavHeader(int fd) { | |||
247 | while (!found) { | 250 | while (!found) { |
248 | if (read(fd, string, 4) < 4) { | 251 | if (read(fd, string, 4) < 4) { |
249 | qDebug("Could not read from sound file.\n"); | 252 | odebug << "Could not read from sound file.\n" << oendl; |
250 | return -1; | 253 | return -1; |
251 | } | 254 | } |
@@ -253,5 +256,5 @@ int WavFile::parseWavHeader(int fd) { | |||
253 | if (strncmp(string, "data", 4)) { | 256 | if (strncmp(string, "data", 4)) { |
254 | if (read(fd, &longdata, 4)<4) { | 257 | if (read(fd, &longdata, 4)<4) { |
255 | qDebug("Could not read from sound file.\n"); | 258 | odebug << "Could not read from sound file.\n" << oendl; |
256 | return -1; | 259 | return -1; |
257 | } | 260 | } |
@@ -260,5 +263,5 @@ int WavFile::parseWavHeader(int fd) { | |||
260 | } else { | 263 | } else { |
261 | if (read(fd, &longdata, 4) < 4) { | 264 | if (read(fd, &longdata, 4) < 4) { |
262 | qDebug("Could not read from sound file.\n"); | 265 | odebug << "Could not read from sound file.\n" << oendl; |
263 | return -1; | 266 | return -1; |
264 | } else { | 267 | } else { |
diff --git a/noncore/multimedia/opierec/waveform.cpp b/noncore/multimedia/opierec/waveform.cpp index 9cc40b4..7c9a25f 100644 --- a/noncore/multimedia/opierec/waveform.cpp +++ b/noncore/multimedia/opierec/waveform.cpp | |||
@@ -20,6 +20,10 @@ | |||
20 | #include "waveform.h" | 20 | #include "waveform.h" |
21 | 21 | ||
22 | #include <qpainter.h> | 22 | /* OPIE */ |
23 | #include <opie2/odebug.h> | ||
24 | using namespace Opie::Core; | ||
23 | 25 | ||
26 | /* QT */ | ||
27 | #include <qpainter.h> | ||
24 | 28 | ||
25 | Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) | 29 | Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) |
@@ -39,7 +43,7 @@ void Waveform::changeSettings( int frequency, int channels ) | |||
39 | { | 43 | { |
40 | makePixmap(); | 44 | makePixmap(); |
41 | // qWarning("change waveform %d, %d", frequency, channels); | 45 | // owarn << "change waveform " << frequency << ", " << channels << "" << oendl; |
42 | samplesPerPixel = frequency * channels / (5 * windowSize); | 46 | samplesPerPixel = frequency * channels / (5 * windowSize); |
43 | qWarning("Waveform::changeSettings %d", samplesPerPixel); | 47 | owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl; |
44 | if ( !samplesPerPixel ) | 48 | if ( !samplesPerPixel ) |
45 | samplesPerPixel = 1; | 49 | samplesPerPixel = 1; |
@@ -97,5 +101,5 @@ void Waveform::newSamples( const short *buf, int len ) | |||
97 | 101 | ||
98 | // Copy the final state back to the object. | 102 | // Copy the final state back to the object. |
99 | //qWarning("%d, %d, %d", currentValue, numSamples, windowPosn); | 103 | //owarn << "" << currentValue << ", " << numSamples << ", " << windowPosn << "" << oendl; |
100 | this->currentValue = currentValue; | 104 | this->currentValue = currentValue; |
101 | this->numSamples = numSamples; | 105 | this->numSamples = numSamples; |