summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec/qtrec.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opierec/qtrec.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp129
1 files changed, 64 insertions, 65 deletions
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
@@ -8,24 +8,22 @@
8#include "pixmaps.h" 8#include "pixmaps.h"
9#include "qtrec.h" 9#include "qtrec.h"
10#include "waveform.h" 10#include "waveform.h"
11
12#include <pthread.h>
13
14extern "C" { 11extern "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>
22#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
23#include <qpe/resource.h> 20#include <qpe/resource.h>
24#include <qpe/storage.h> 21#include <qpe/storage.h>
22using 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>
31#include <qlabel.h> 29#include <qlabel.h>
@@ -38,6 +36,7 @@ extern "C" {
38#include <qtabwidget.h> 36#include <qtabwidget.h>
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>
43#include <math.h> 42#include <math.h>
@@ -53,7 +52,7 @@ extern "C" {
53#include <unistd.h> 52#include <unistd.h>
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
59#include <alsa/asoundlib.h> 58#include <alsa/asoundlib.h>
@@ -136,17 +135,17 @@ void quickRec()
136 int level = 0; 135 int level = 0;
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 ];
152 short sbuf[ BUFSIZE ]; 151 short sbuf[ BUFSIZE ];
@@ -157,7 +156,7 @@ void quickRec()
157 156
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 }
163 162
@@ -166,7 +165,7 @@ void quickRec()
166 165
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;
172 } 171 }
@@ -192,14 +191,14 @@ void quickRec()
192 } 191 }
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);
198 memset( outbuffer, 0, BUFSIZE); 197 memset( outbuffer, 0, BUFSIZE);
199 198
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
205 return; 204 return;
@@ -210,7 +209,7 @@ void quickRec()
210 209
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;
216 } 215 }
@@ -250,7 +249,7 @@ void quickRec()
250 249
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 }
256 255
@@ -373,7 +372,7 @@ void playIt()
373 qApp->processEvents(); 372 qApp->processEvents();
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;
379 break; 378 break;
@@ -718,7 +717,7 @@ void QtRec::initIconView() {
718 QPixmap image0( ( const char** ) image0_data ); 717 QPixmap image0( ( const char** ) image0_data );
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++) {
724 723
@@ -860,7 +859,7 @@ void QtRec::initConfig() {
860} 859}
861 860
862void QtRec::stop() { 861void QtRec::stop() {
863 qWarning("STOP"); 862 owarn << "STOP" << oendl;
864 setRecordButton(false); 863 setRecordButton(false);
865 864
866 if( !recording) 865 if( !recording)
@@ -922,20 +921,20 @@ bool QtRec::rec() { //record
922// soundDevice->getDeviceChannels()); 921// soundDevice->getDeviceChannels());
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
931 if( filePara.SecondsToRecord == 0) { 930 if( filePara.SecondsToRecord == 0) {
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;
941 } 940 }
@@ -947,7 +946,7 @@ bool QtRec::rec() { //record
947 paused = false; 946 paused = false;
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);
953 // } 952 // }
@@ -966,7 +965,7 @@ bool QtRec::rec() { //record
966 setCaption( msg); 965 setCaption( msg);
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
972#ifdef THREADED 971#ifdef THREADED
@@ -1010,13 +1009,13 @@ void QtRec::thisTab(QWidget* widg) {
1010 1009
1011void QtRec::getOutVol( ) { 1010void 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}
1016 1015
1017void QtRec::getInVol() { 1016void 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}
1022 1021
@@ -1090,11 +1089,11 @@ bool QtRec::setupAudio( bool b) {
1090 1089
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
1100 1099
@@ -1110,15 +1109,15 @@ bool QtRec::setupAudio( bool b) {
1110 } 1109 }
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
1117 soundDevice = new Device( this, dspString, mixerString, b); 1116 soundDevice = new Device( this, dspString, mixerString, b);
1118// soundDevice->openDsp(); 1117// soundDevice->openDsp();
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 ////////////////// <<<<<<<<<<<<>>>>>>>>>>>>
1124 soundDevice->setDeviceFormat( sampleformat); 1123 soundDevice->setDeviceFormat( sampleformat);
@@ -1149,7 +1148,7 @@ bool QtRec::setupAudio( bool b) {
1149 1148
1150 1149
1151bool QtRec::setUpFile() { //setup file for recording 1150bool 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 &)"",
1155 true, 1154 true,
@@ -1182,7 +1181,7 @@ bool QtRec::doPlay() {
1182 recording = false; 1181 recording = false;
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);
1188 1187
@@ -1234,7 +1233,7 @@ void QtRec::changesamplerateCombo(int i) {
1234 rate = sampleRateComboBox->text(i).toInt(&ok, 10); 1233 rate = sampleRateComboBox->text(i).toInt(&ok, 10);
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}
1240 1239
@@ -1254,7 +1253,7 @@ void QtRec::changeDirCombo(int index) {
1254 const QString path = (*it)->path(); 1253 const QString path = (*it)->path();
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 }
1260 cfg.write(); 1259 cfg.write();
@@ -1374,7 +1373,7 @@ void QtRec::keyPressEvent( QKeyEvent *e) {
1374 // newSound(); 1373 // newSound();
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();
1380 } 1379 }
@@ -1428,19 +1427,19 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) {
1428 break; 1427 break;
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;
1446 } 1445 }
@@ -1475,11 +1474,11 @@ void QtRec::endRecording() {
1475// move tmp file to regular file 1474// move tmp file to regular file
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");
1485 1484
@@ -1495,10 +1494,10 @@ void QtRec::endRecording() {
1495 QString time; 1494 QString time;
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 }
1504 1503
@@ -1516,7 +1515,7 @@ void QtRec::endPlaying() {
1516 stopped = true; 1515 stopped = true;
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
1522 toBeginningButton->setEnabled( true); 1521 toBeginningButton->setEnabled( true);
@@ -1528,7 +1527,7 @@ void QtRec::endPlaying() {
1528 soundDevice->closeDevice( false); 1527 soundDevice->closeDevice( false);
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;
1534 filePara.numberSamples = 0; 1533 filePara.numberSamples = 0;
@@ -1537,9 +1536,9 @@ void QtRec::endPlaying() {
1537 filePara.fd = 0; 1536 filePara.fd = 0;
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
1545 if(soundDevice) delete soundDevice; 1544 if(soundDevice) delete soundDevice;
@@ -1561,7 +1560,7 @@ bool QtRec::openPlayFile() {
1561 for(int i=0;i<nFiles+1;i++) { //look for file 1560 for(int i=0;i<nFiles+1;i++) { //look for file
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 }
1567 wavFile = new WavFile(this, 1566 wavFile = new WavFile(this,
@@ -1586,10 +1585,10 @@ bool QtRec::openPlayFile() {
1586 timeSlider->setPageStep(1); 1585 timeSlider->setPageStep(1);
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 );
1595 } 1594 }
@@ -1690,7 +1689,7 @@ void QtRec::doRename() {
1690} 1689}
1691 1690
1692void QtRec::okRename() { 1691void 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();
1696 1695
@@ -1702,7 +1701,7 @@ void QtRec::okRename() {
1702 1701
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);
1708 1707
@@ -1773,7 +1772,7 @@ void QtRec::doVolMuting(bool b) {
1773} 1772}
1774 1773
1775void QtRec::doMicMuting(bool b) { 1774void 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" );
1779 cfg.writeEntry( "MicMute",b); 1778 cfg.writeEntry( "MicMute",b);
@@ -1829,7 +1828,7 @@ long QtRec::checkDiskSpace(const QString &path) {
1829// char f_fpack[6]; /* Pack name */ 1828// char f_fpack[6]; /* Pack name */
1830 1829
1831void QtRec::receive( const QCString &msg, const QByteArray & ) { 1830void QtRec::receive( const QCString &msg, const QByteArray & ) {
1832 qDebug("Voicerecord received message "+msg); 1831 odebug << "Voicerecord received message "+msg << oendl;
1833 1832
1834} 1833}
1835 1834
@@ -1854,7 +1853,7 @@ void QtRec::timerEvent( QTimerEvent * ) {
1854 stop(); 1853 stop();
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
1860 QString msg; 1859 QString msg;
@@ -1870,7 +1869,7 @@ void QtRec::timerEvent( QTimerEvent * ) {
1870 1869
1871void QtRec::changeTimeSlider(int index) { 1870void 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;
1876 1875
@@ -1885,7 +1884,7 @@ void QtRec::changeTimeSlider(int index) {
1885 1884
1886void QtRec::timeSliderPressed() { 1885void 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;
1891} 1890}
@@ -1894,7 +1893,7 @@ void QtRec::timeSliderReleased() {
1894 if( ListView1->currentItem() == 0) return; 1893 if( ListView1->currentItem() == 0) return;
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);
1900 total = newPos*4; 1899 total = newPos*4;
@@ -1924,7 +1923,7 @@ void QtRec::rewindTimerTimeout() {
1924 sliderValue = sliderValue - ( filePara.numberSamples / 100); 1923 sliderValue = sliderValue - ( filePara.numberSamples / 100);
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;
1930 timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); 1929 timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds);
@@ -1938,7 +1937,7 @@ void QtRec::rewindReleased() {
1938 stopped = false; 1937 stopped = false;
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();
1944 } 1943 }
@@ -2002,7 +2001,7 @@ QString QtRec::getStorage(const QString &fileName) {
2002 // const QString options = (*it)->options(); 2001 // const QString options = (*it)->options();
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;
2008 // struct mntent *me; 2007 // struct mntent *me;