summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec/wavFile.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/wavFile.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/wavFile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/wavFile.cpp67
1 files changed, 35 insertions, 32 deletions
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 &currentFileName) {
-// qDebug("open play file "+currentFileName);
+// odebug << "open play file "+currentFileName << oendl;
closeFile();
@@ -115,3 +118,3 @@ int WavFile::openFile(const QString &currentFileName) {
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;