author | mickeyl <mickeyl> | 2004-04-05 12:48:49 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-05 12:48:49 (UTC) |
commit | f1708be741dfb73ceaffb633b44093f2cb2b3d57 (patch) (side-by-side diff) | |
tree | 0bdcab2ac6c5f0e5cac67eb58807a50bb79d82e0 /core/applets/vmemo | |
parent | 0b481957a2eebf28b05d9803780d05ad4232aa00 (diff) | |
download | opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.zip opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.tar.gz opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.tar.bz2 |
convert core/applets/* to Opie debug framework
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 7dd5b4b..622b1df 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -12,6 +12,10 @@ // copyright 2002 Jeremy Cowgar <jc@cowgar.com> // copyright 2002 and 2003 L.J.Potter <ljp@llornkcor.com> +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + extern "C" { #include "adpcm.h" } @@ -207,7 +211,7 @@ VMemo::VMemo( QWidget *parent, const char *_name ) int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); - qDebug("toggleKey %d", toggleKey); + odebug << "toggleKey " << toggleKey << "" << oendl; if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) systemZaurus=TRUE; else @@ -245,7 +249,7 @@ int VMemo::position() } void VMemo::receive( const QCString &msg, const QByteArray &data ) { - qDebug("receive"); + odebug << "receive" << oendl; QDataStream stream( data, IO_ReadOnly ); if (msg == "toggleRecord()") { @@ -293,7 +297,7 @@ bool VMemo::startRecording() { msgLabel->show(); } - qDebug("Start recording engines"); + odebug << "Start recording engines" << oendl; recording = TRUE; if (openDSP() == -1) { @@ -318,7 +322,7 @@ bool VMemo::startRecording() { s=fileName.find(':'); if(s) fileName=fileName.right(fileName.length()-s-2); - qDebug("pathname will be "+fileName); + odebug << "pathname will be "+fileName << oendl; if( fileName.left(1).find('/') == -1) fileName="/"+fileName; @@ -327,11 +331,11 @@ bool VMemo::startRecording() { fName = "vm_"+ date+ ".wav"; fileName+=fName; - qDebug("filename is "+fileName); + odebug << "filename is "+fileName << oendl; // open tmp file here char *pointer; pointer=tmpnam(NULL); - qDebug("Opening tmp file %s",pointer); + odebug << "Opening tmp file " << pointer << "" << oendl; if(openWAV(pointer ) == -1) { @@ -371,7 +375,7 @@ bool VMemo::startRecording() { void VMemo::stopRecording() { show(); - qDebug("Stopped recording"); + odebug << "Stopped recording" << oendl; recording = FALSE; if(useAlerts) { msgLabel->close(); @@ -399,7 +403,7 @@ int VMemo::openDSP() { resolution = 8; } - qDebug("samplerate: %d, channels %d, resolution %d", speed, channels, resolution); + odebug << "samplerate: " << speed << ", channels " << channels << ", resolution " << resolution << "" << oendl; if(systemZaurus) { dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1 @@ -483,7 +487,7 @@ bool VMemo::record() { int result, value; QString msg; msg.sprintf("Recording format %d", format); - qDebug(msg); + odebug << msg << oendl; Config config("Vmemo"); config.setGroup("Record"); int sRate=config.readNumEntry("SizeLimit", 30); @@ -494,7 +498,7 @@ bool VMemo::record() { // } else { // 16 bit only capabilities msg.sprintf("Recording format other"); - qDebug(msg); + odebug << msg << oendl; int bufsize=1024; int bytesWritten=0; @@ -513,7 +517,7 @@ bool VMemo::record() { result = read(dsp, sound, 1024); // 8192 if( result <= 0) { perror("recording error "); -// qDebug(currentFileName); +// odebug << currentFileName << oendl; QMessageBox::message(tr("Note"),tr("error recording")); recording=FALSE; break; @@ -540,7 +544,7 @@ bool VMemo::record() { break; return FALSE; } - // printf("%d\r",length); + // odebug << "" << length << "\r" << oendl; // fflush(stdout); qApp->processEvents(); } @@ -559,7 +563,7 @@ bool VMemo::record() { write(wav, &length, 4); track.close(); - qDebug("Track closed"); + odebug << "Track closed" << oendl; if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1) perror("ioctl(\"SNDCTL_DSP_RESET\")"); @@ -583,11 +587,11 @@ bool VMemo::record() { QString time; time.sprintf("%.2f", numberOfRecordedSeconds); cfgO.writeEntry( currentFileName, time ); - // qDebug("writing config numberOfRecordedSeconds "+time); + // odebug << "writing config numberOfRecordedSeconds "+time << oendl; cfgO.write(); - qDebug("done recording "+fileName); + odebug << "done recording "+fileName << oendl; Config cfg("qpe"); cfg.setGroup("Volume"); |