summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec/qtrec.cpp
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/multimedia/opierec/qtrec.cpp
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
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
@@ -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;
}