-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 @@ -4,6 +4,9 @@ +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> +using namespace Opie::Core; - +/* STD */ #include <fcntl.h> @@ -15,5 +18,2 @@ #include<sys/wait.h> -// #include <sys/stat.h> -// #include <sys/time.h> -// #include <sys/types.h> #include <unistd.h> @@ -34,6 +34,6 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco if( !record){ //playing - qDebug("setting up DSP for playing"); + odebug << "setting up DSP for playing" << oendl; flags = O_WRONLY; } else { //recording - qDebug("setting up DSP for recording"); + 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; - qWarning("changing output vol %d", vol); + owarn << "changing output vol " << vol << "" << oendl; } @@ -113,3 +113,3 @@ void Device::changedInVolume(int vol ) { QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; - qWarning("changing input volume %d", vol); + owarn << "changing input volume " << vol << "" << oendl; } @@ -151,3 +151,3 @@ exit(1); */ -qDebug("Opening %s",dspstr); +odebug << "Opening " << dspstr << "" << oendl; if (( sd = ::open( dspstr, flags)) == -1) { @@ -156,3 +156,3 @@ qDebug("Opening %s",dspstr); +(QString)strerror(errno); - qDebug("XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg); + odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; return -1; @@ -160,3 +160,3 @@ qDebug("Opening %s",dspstr); -qDebug("Opening mixer"); +odebug << "Opening mixer" << oendl; int mixerHandle=0; @@ -166,3 +166,3 @@ qDebug("Opening mixer"); +(QString)strerror(errno); - qDebug("XXXXXXXXXXXXXXXXXXXXXX "+errorMsg); + odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; } @@ -182,3 +182,3 @@ qDebug("Opening mixer"); close(pipefd[1]); - // qDebug("%d",soundDevice->sd ); + // odebug << "" << soundDevice->sd << "" << oendl; _exit(0); @@ -208,3 +208,3 @@ qDebug("Opening mixer"); // sd = s.toInt(&ok, 10); -// qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s); +// odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl; @@ -213,4 +213,4 @@ qDebug("Opening mixer"); ::close(mixerHandle ); -// qDebug("open device %s", dspstr); -// qDebug("success! %d",sd); +// odebug << "open device " << dspstr << "" << oendl; +// odebug << "success! " << sd << "" << oendl; return sd; @@ -232,3 +232,3 @@ bool Device::closeDevice( bool) { // sd=0; -// qDebug("closed dsp"); +// odebug << "closed dsp" << oendl; return true; @@ -237,3 +237,3 @@ bool Device::closeDevice( bool) { bool Device::setDeviceFormat( int form) { - qDebug("set device res %d %d", form, sd); + 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) { - qDebug("set channels %d %d", ch, sd); + 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) { - qDebug("set rate %d %d", rate, sd); + odebug << "set rate " << rate << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { @@ -320,5 +320,5 @@ int Device::getDeviceFragSize() { if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { - qDebug("no fragsize"); + odebug << "no fragsize" << oendl; } else { - qDebug("driver says frag size is %d", frag_size); + odebug << "driver says frag size is " << frag_size << "" << oendl; } 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 @@ -11,7 +11,11 @@ #include "helpwindow.h" -#include <qlayout.h> -#include <qtoolbar.h> +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/resource.h> +using namespace Opie::Core; +/* QT */ +#include <qlayout.h> +#include <qtoolbar.h> #include <qaction.h> @@ -19,2 +23,3 @@ +/* STD */ #include <ctype.h> @@ -27,3 +32,3 @@ HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* par layout->setMargin( 2); - qDebug(_path); + odebug << _path << oendl; browser = new QTextBrowser( this ); 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,4 +1,2 @@ -#CONFIG = qt warn_on pdaudio -CONFIG = qt warn_on opie -#CONFIG = qt warn_on quick-app +CONFIG = qt warn_on HEADERS = adpcm.h \ @@ -31,3 +29,3 @@ contains(CONFIG, pdaudio) { -contains(CONFIG, opie) { +!contains(CONFIG, pdaudio) { INCLUDEPATH += $(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 @@ -10,5 +10,2 @@ #include "waveform.h" - -#include <pthread.h> - extern "C" { @@ -17,4 +14,4 @@ extern "C" { -#include <sys/soundcard.h> - +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/config.h> @@ -24,6 +21,7 @@ extern "C" { #include <qpe/storage.h> +using namespace Opie::Core; +/* QT */ #include <qcheckbox.h> #include <qcombobox.h> -//#include <qdatetime.h> #include <qdir.h> @@ -40,2 +38,3 @@ extern "C" { +/* STD */ #include <errno.h> @@ -55,3 +54,3 @@ extern "C" { #include <sys/signal.h> - +#include <pthread.h> @@ -138,8 +137,8 @@ void quickRec() // int bits = filePara.resolution; -// qDebug("bits %d", bits); +// odebug << "bits " << bits << "" << oendl; if( filePara.resolution == 16 ) { //AFMT_S16_LE) -// qDebug("AFMT_S16_LE size %d", filePara.SecondsToRecord); -// qDebug("samples to record %d", filePara.samplesToRecord); -// qDebug("%d", filePara.sd); +// odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl; +// odebug << "samples to record " << filePara.samplesToRecord << "" << oendl; +// odebug << "" << filePara.sd << "" << oendl; level = 7; @@ -148,3 +147,3 @@ void quickRec() if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { -// qDebug("start recording WAVE_FORMAT_DVI_ADPCM"); +// odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl; // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> @@ -159,3 +158,3 @@ void quickRec() if ( stopped) { -// qDebug("quickRec:: stopped"); +// odebug << "quickRec:: stopped" << oendl; break; @@ -168,3 +167,3 @@ void quickRec() perror("recording error "); - qDebug( "%s %d", filePara.fileName, number); + odebug << "" << filePara.fileName << " " << number << "" << oendl; stopped = true; @@ -194,3 +193,3 @@ void quickRec() // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> - qDebug("start recording WAVE_FORMAT_PCM"); + odebug << "start recording WAVE_FORMAT_PCM" << oendl; short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; @@ -201,3 +200,3 @@ void quickRec() if ( stopped) { - qDebug("quickRec:: stopped"); + odebug << "quickRec:: stopped" << oendl; stopped = true; @@ -212,3 +211,3 @@ void quickRec() perror( "recording error "); - qDebug( filePara.fileName); + odebug << filePara.fileName << oendl; stopped = true; @@ -252,3 +251,3 @@ void quickRec() if ( stopped) { - qDebug("quickRec:: stopped"); + odebug << "quickRec:: stopped" << oendl; break; // stop if playing was set to false @@ -375,3 +374,3 @@ void playIt() if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { - qWarning("Jane! Stop this crazy thing!"); + owarn << "Jane! Stop this crazy thing!" << oendl; stopped = true; @@ -720,3 +719,3 @@ void QtRec::initIconView() { int nFiles = cfg.readNumEntry("NumberofFiles",0); -// qDebug("init number of files %d", nFiles); +// odebug << "init number of files " << nFiles << "" << oendl; @@ -862,3 +861,3 @@ void QtRec::initConfig() { void QtRec::stop() { - qWarning("STOP"); + owarn << "STOP" << oendl; setRecordButton(false); @@ -924,6 +923,6 @@ bool QtRec::rec() { //record //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); -// qDebug("sample rate is %d", filePara.sampleRate); +// odebug << "sample rate is " << filePara.sampleRate << "" << oendl; filePara.SecondsToRecord = getCurrentSizeLimit(); -// qDebug("size limit %d sec", filePara.SecondsToRecord); +// odebug << "size limit " << filePara.SecondsToRecord << " sec" << oendl; int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); @@ -933,3 +932,3 @@ bool QtRec::rec() { //record } else if( filePara.format == WAVE_FORMAT_PCM) { -// qDebug("WAVE_FORMAT_PCM"); +// odebug << "WAVE_FORMAT_PCM" << oendl; fileSize = (filePara.SecondsToRecord ) * filePara.channels @@ -937,3 +936,3 @@ bool QtRec::rec() { //record } else { -// qDebug("WAVE_FORMAT_DVI_ADPCM"); +// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; fileSize = ((filePara.SecondsToRecord) * filePara.channels @@ -949,3 +948,3 @@ bool QtRec::rec() { //record // else { - qDebug("Setting timeslider %d", filePara.samplesToRecord); + odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl; // if(fileSize != 0) @@ -968,3 +967,3 @@ bool QtRec::rec() { //record filePara.fileName=currentFile.latin1(); - qDebug("Start recording thread"); + odebug << "Start recording thread" << oendl; stopped = false; @@ -1012,3 +1011,3 @@ void QtRec::getOutVol( ) { filePara.outVol = soundDevice->getOutVolume(); -// qDebug("out vol %d", filePara.outVol); +// odebug << "out vol " << filePara.outVol << "" << oendl; OutputSlider->setValue( -filePara.outVol); @@ -1018,3 +1017,3 @@ void QtRec::getInVol() { filePara.inVol = soundDevice->getInVolume(); -// qDebug("in vol %d", filePara.inVol); +// odebug << "in vol " << filePara.inVol << "" << oendl; InputSlider->setValue( -filePara.inVol); @@ -1092,3 +1091,3 @@ bool QtRec::setupAudio( bool b) { filePara.format = WAVE_FORMAT_PCM; -// qDebug("WAVE_FORMAT_PCM"); +// odebug << "WAVE_FORMAT_PCM" << oendl; } else { @@ -1096,3 +1095,3 @@ bool QtRec::setupAudio( bool b) { sampleformat = AFMT_S16_LE; -// qDebug("WAVE_FORMAT_DVI_ADPCM"); +// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; } @@ -1112,4 +1111,4 @@ bool QtRec::setupAudio( bool b) { // if(soundDevice) delete soundDevice; - qDebug("<<<<<<<<<<<<<<<<<<<open dsp %d %d %d", filePara.sampleRate, filePara.channels, sampleformat); - qWarning("change waveform settings"); + odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl; + owarn << "change waveform settings" << oendl; waveform->changeSettings( filePara.sampleRate, filePara.channels ); @@ -1120,3 +1119,3 @@ bool QtRec::setupAudio( bool b) { - qDebug("device has been made %d", soundDevice->sd); + odebug << "device has been made " << soundDevice->sd << "" << oendl; @@ -1151,3 +1150,3 @@ bool QtRec::setupAudio( bool b) { bool QtRec::setUpFile() { //setup file for recording -// qDebug("Setting up wavfile"); +// odebug << "Setting up wavfile" << oendl; // if(wavFile) delete wavFile; @@ -1184,3 +1183,3 @@ bool QtRec::doPlay() { QString num; - qDebug( "Play number of samples %d", filePara.numberSamples); + odebug << "Play number of samples " << filePara.numberSamples << "" << oendl; @@ -1236,3 +1235,3 @@ void QtRec::changesamplerateCombo(int i) { filePara.sampleRate=rate; - qDebug( "Change sample rate %d", rate); + odebug << "Change sample rate " << rate << "" << oendl; cfg.write(); @@ -1256,3 +1255,3 @@ void QtRec::changeDirCombo(int index) { cfg.writeEntry("directory", recDir); - qDebug("new rec dir "+recDir); + odebug << "new rec dir "+recDir << oendl; } @@ -1376,3 +1375,3 @@ void QtRec::keyPressEvent( QKeyEvent *e) { case Key_Left: { - qDebug("rewinding"); + odebug << "rewinding" << oendl; if( !e->isAutoRepeat()) @@ -1430,3 +1429,3 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { // stop(); - qDebug("Up"); + odebug << "Up" << oendl; break; @@ -1434,3 +1433,3 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { // start(); - // qDebug("Down"); + // odebug << "Down" << oendl; // newSound(); @@ -1438,3 +1437,3 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { case Key_Left: - qDebug("Left"); + odebug << "Left" << oendl; rewindReleased(); @@ -1442,3 +1441,3 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { case Key_Right: - qDebug("Right"); + odebug << "Right" << oendl; FastforwardReleased(); @@ -1477,3 +1476,3 @@ void QtRec::endRecording() { cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); -// qDebug("moving tmp file to "+currentFileName); +// odebug << "moving tmp file to "+currentFileName << oendl; system( cmd.latin1()); @@ -1481,3 +1480,3 @@ void QtRec::endRecording() { - qDebug("Just moved " + wavFile->currentFileName); + odebug << "Just moved " + wavFile->currentFileName << oendl; Config cfg("OpieRec"); @@ -1497,6 +1496,6 @@ void QtRec::endRecording() { cfg.writeEntry( wavFile->currentFileName, time ); -// qDebug("writing config numberOfRecordedSeconds "+time); +// odebug << "writing config numberOfRecordedSeconds "+time << oendl; cfg.write(); - qDebug("finished recording"); + odebug << "finished recording" << oendl; timeLabel->setText(""); @@ -1518,3 +1517,3 @@ void QtRec::endPlaying() { // errorStop(); -// qDebug("end playing"); +// odebug << "end playing" << oendl; setRecordButton( false); @@ -1530,3 +1529,3 @@ void QtRec::endPlaying() { // if(soundDevice) delete soundDevice; -// qDebug("file and sound device closed"); +// odebug << "file and sound device closed" << oendl; timeLabel->setText(""); @@ -1539,5 +1538,5 @@ void QtRec::endPlaying() { -// qDebug("track closed"); +// odebug << "track closed" << oendl; killTimers(); - qWarning("reset slider"); + owarn << "reset slider" << oendl; timeSlider->setValue(0); @@ -1563,3 +1562,3 @@ bool QtRec::openPlayFile() { currentFileName = cfg.readEntry( currentFile, "" ); - qDebug("opening for play: " + currentFileName); + odebug << "opening for play: " + currentFileName << oendl; } @@ -1588,6 +1587,6 @@ bool QtRec::openPlayFile() { - qDebug("file %d, samples %d %d", filePara.fd, filePara.numberSamples, filePara.sampleRate); + odebug << "file " << filePara.fd << ", samples " << filePara.numberSamples << " " << filePara.sampleRate << "" << oendl; int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); - qWarning("seconds %d", sec); + owarn << "seconds " << sec << "" << oendl; @@ -1692,3 +1691,3 @@ void QtRec::doRename() { void QtRec::okRename() { - qDebug(renameBox->text()); + odebug << renameBox->text() << oendl; QString filename = renameBox->text(); @@ -1704,3 +1703,3 @@ void QtRec::okRename() { - qDebug("filename is " + filename); + odebug << "filename is " + filename << oendl; @@ -1775,3 +1774,3 @@ void QtRec::doVolMuting(bool b) { void QtRec::doMicMuting(bool b) { - // qDebug("mic mute"); + // odebug << "mic mute" << oendl; Config cfg( "qpe" ); @@ -1831,3 +1830,3 @@ long QtRec::checkDiskSpace(const QString &path) { void QtRec::receive( const QCString &msg, const QByteArray & ) { - qDebug("Voicerecord received message "+msg); + odebug << "Voicerecord received message "+msg << oendl; @@ -1856,3 +1855,3 @@ void QtRec::timerEvent( QTimerEvent * ) { - qDebug( "%d", secCount ); + odebug << "" << secCount << "" << oendl; QString timeString; @@ -1872,3 +1871,3 @@ void QtRec::changeTimeSlider(int index) { if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; - // qDebug("Slider moved to %d",index); + // odebug << "Slider moved to " << index << "" << oendl; paused = true; @@ -1887,3 +1886,3 @@ void QtRec::timeSliderPressed() { if( ListView1->currentItem() == 0) return; - // qDebug("slider pressed"); + // odebug << "slider pressed" << oendl; paused = true; @@ -1896,3 +1895,3 @@ void QtRec::timeSliderReleased() { - // qDebug("slider released %d", sliderPos); + // odebug << "slider released " << sliderPos << "" << oendl; stopped = false; @@ -1926,3 +1925,3 @@ void QtRec::rewindTimerTimeout() { timeSlider->setValue( sliderValue ) ; - // qDebug("%d", sliderValue); + // odebug << "" << sliderValue << "" << oendl; QString timeString; @@ -1940,3 +1939,3 @@ void QtRec::rewindReleased() { total = newPos * 4; - // qDebug("rewind released %d", total); + // odebug << "rewind released " << total << "" << oendl; startTimer( 1000); @@ -2004,3 +2003,3 @@ QString QtRec::getStorage(const QString &fileName) { // storageComboBox->insertItem( name +" -> "+disk); - // qDebug(name); + // odebug << name << oendl; } 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 @@ -4,2 +4,8 @@ +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/config.h> +using namespace Opie::Core; + +/* QT */ #include <qmessagebox.h> @@ -7,6 +13,4 @@ -#include <qpe/config.h> - +/* STD */ #include <errno.h> - #include <sys/time.h> @@ -14,3 +18,2 @@ #include <sys/vfs.h> - #include <fcntl.h> @@ -26,3 +29,3 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int { -//qDebug("new wave file"); +//odebug << "new wave file" << oendl; bool b = makeNwFile; @@ -42,3 +45,3 @@ bool WavFile::newFile() { -// qDebug("Set up new file"); +// odebug << "Set up new file" << oendl; Config cfg("OpieRec"); @@ -62,3 +65,3 @@ bool WavFile::newFile() { -// qDebug("set up file for recording: "+currentFileName); +// odebug << "set up file for recording: "+currentFileName << oendl; char pointer[] = "/tmp/opierec-XXXXXX"; @@ -77,3 +80,3 @@ bool WavFile::newFile() { -// qDebug("Opening tmp file %s",pointer); +// odebug << "Opening tmp file " << pointer << "" << oendl; track.setName( pointer); @@ -87,3 +90,3 @@ bool WavFile::newFile() { QString errorMsg=(QString)strerror(errno); - qDebug(errorMsg); + odebug << errorMsg << oendl; QMessageBox::message("Note", "Error opening file.\n" +errorMsg); @@ -108,3 +111,3 @@ void WavFile::closeFile() { int WavFile::openFile(const QString ¤tFileName) { -// qDebug("open play file "+currentFileName); +// odebug << "open play file "+currentFileName << oendl; closeFile(); @@ -115,3 +118,3 @@ int WavFile::openFile(const QString ¤tFileName) { QString errorMsg=(QString)strerror(errno); - qDebug("<<<<<<<<<<< "+errorMsg+currentFileName); + odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl; QMessageBox::message("Note", "Error opening file.\n" +errorMsg); @@ -133,3 +136,3 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { (*hdr).fmtTag = 1; // PCM -// qDebug("set header WAVE_FORMAT_PCM"); +// odebug << "set header WAVE_FORMAT_PCM" << oendl; } @@ -137,3 +140,3 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM - // qDebug("set header WAVE_FORMAT_DVI_ADPCM"); + // odebug << "set header WAVE_FORMAT_DVI_ADPCM" << oendl; } @@ -162,3 +165,3 @@ bool WavFile::adjustHeaders(int fd, int total) { write( fd, &total, sizeof(total)); - qDebug("adjusting header %d", total); + odebug << "adjusting header " << total << "" << oendl; return true; @@ -167,3 +170,3 @@ bool WavFile::adjustHeaders(int fd, int total) { int WavFile::parseWavHeader(int fd) { - qDebug("Parsing wav header"); + odebug << "Parsing wav header" << oendl; char string[4]; @@ -175,3 +178,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - qDebug(" Could not read from sound file.\n"); + odebug << " Could not read from sound file.\n" << oendl; return -1; @@ -179,3 +182,3 @@ int WavFile::parseWavHeader(int fd) { if (strncmp(string, "RIFF", 4)) { - qDebug(" not a valid WAV file.\n"); + odebug << " not a valid WAV file.\n" << oendl; return -1; @@ -184,3 +187,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; @@ -188,3 +191,3 @@ int WavFile::parseWavHeader(int fd) { if (strncmp(string, "WAVE", 4)) { - qDebug("not a valid WAV file.\n"); + odebug << "not a valid WAV file.\n" << oendl; return -1; @@ -195,3 +198,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; @@ -200,3 +203,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &longdata, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; @@ -207,3 +210,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &fmt, 2) < 2) { - qDebug("Could not read format chunk.\n"); + odebug << "Could not read format chunk.\n" << oendl; return -1; @@ -217,5 +220,5 @@ int WavFile::parseWavHeader(int fd) { // compressionFormat=fmt; - qDebug("compressionFormat is %d", fmt); + odebug << "compressionFormat is " << fmt << "" << oendl; if (read(fd, &ch, 2) < 2) { - qDebug("Could not read format chunk.\n"); + odebug << "Could not read format chunk.\n" << oendl; return -1; @@ -223,6 +226,6 @@ int WavFile::parseWavHeader(int fd) { wavChannels = ch; - qDebug("File has %d channels", ch); + odebug << "File has " << ch << " channels" << oendl; } if (read(fd, &samplerrate, 4) < 4) { - qDebug("Could not read from format chunk.\n"); + odebug << "Could not read from format chunk.\n" << oendl; return -1; @@ -231,3 +234,3 @@ int WavFile::parseWavHeader(int fd) { // sampleRate = samplerrate; - qDebug("File has samplerate of %d",(int) samplerrate); + odebug << "File has samplerate of " << (int) samplerrate << "" << oendl; } @@ -235,3 +238,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &bitrate, 2) < 2) { - qDebug("Could not read format chunk.\n"); + odebug << "Could not read format chunk.\n" << oendl; return -1; @@ -240,3 +243,3 @@ int WavFile::parseWavHeader(int fd) { // resolution = bitrate; - qDebug("File has bitrate of %d", bitrate); + odebug << "File has bitrate of " << bitrate << "" << oendl; } @@ -248,3 +251,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; @@ -254,3 +257,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &longdata, 4)<4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; @@ -261,3 +264,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &longdata, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; 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 @@ -21,4 +21,8 @@ -#include <qpainter.h> +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ +#include <qpainter.h> @@ -40,5 +44,5 @@ void Waveform::changeSettings( int frequency, int channels ) makePixmap(); -// qWarning("change waveform %d, %d", frequency, channels); +// owarn << "change waveform " << frequency << ", " << channels << "" << oendl; samplesPerPixel = frequency * channels / (5 * windowSize); - qWarning("Waveform::changeSettings %d", samplesPerPixel); + owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl; if ( !samplesPerPixel ) @@ -98,3 +102,3 @@ void Waveform::newSamples( const short *buf, int len ) // Copy the final state back to the object. -//qWarning("%d, %d, %d", currentValue, numSamples, windowPosn); +//owarn << "" << currentValue << ", " << numSamples << ", " << windowPosn << "" << oendl; this->currentValue = currentValue; |