Diffstat (limited to 'noncore/multimedia/opierec/wavFile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opierec/wavFile.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp index 80453e1..b53c416 100644 --- a/noncore/multimedia/opierec/wavFile.cpp +++ b/noncore/multimedia/opierec/wavFile.cpp @@ -29,3 +29,3 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int { -//odebug << "new wave file" << oendl; + owarn << "new wave file: " << fileName << oendl; bool b = makeNwFile; @@ -111,16 +111,16 @@ void WavFile::closeFile() { int WavFile::openFile(const QString ¤tFileName) { -// odebug << "open play file "+currentFileName << oendl; + qWarning("open play file "+currentFileName);; closeFile(); - track.setName(currentFileName); - - if(!track.open(IO_ReadOnly)) { - QString errorMsg=(QString)strerror(errno); - odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl; - QMessageBox::message("Note", "Error opening file.\n" +errorMsg); - return -1; - } else { - parseWavHeader( track.handle()); - } - return track.handle(); + track.setName(currentFileName); + + if(!track.open(IO_ReadOnly)) { + QString errorMsg=(QString)strerror(errno); + odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl; + QMessageBox::message("Note", "Error opening file.\n" +errorMsg); + return -1; + } else { + parseWavHeader( track.handle()); + } + return track.handle(); } @@ -154,3 +154,3 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { write( fd,hdr, sizeof(*hdr)); - odebug << "writing header: bitrate " << wavResolution << ", samplerate " << wavSampleRate << ", channels " << wavChannels << oendl; + owarn << "writing header: bitrate " << wavResolution << ", samplerate " << wavSampleRate << ", channels " << wavChannels << oendl; return true; @@ -164,3 +164,3 @@ bool WavFile::adjustHeaders(int fd, int total) { write( fd, &total, sizeof(total)); - odebug << "adjusting header " << total << "" << oendl; + owarn << "adjusting header " << total << "" << oendl; return true; @@ -169,3 +169,3 @@ bool WavFile::adjustHeaders(int fd, int total) { int WavFile::parseWavHeader(int fd) { - odebug << "Parsing wav header" << oendl; + owarn << "Parsing wav header" << oendl; char string[4]; @@ -177,3 +177,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - odebug << " Could not read from sound file." << oendl; + owarn << " Could not read from sound file." << oendl; return -1; @@ -181,3 +181,3 @@ int WavFile::parseWavHeader(int fd) { if (strncmp(string, "RIFF", 4)) { - odebug << " not a valid WAV file." << oendl; + owarn << " not a valid WAV file." << oendl; return -1; @@ -186,3 +186,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - odebug << "Could not read from sound file." << oendl; + owarn << "Could not read from sound file." << oendl; return -1; @@ -190,3 +190,3 @@ int WavFile::parseWavHeader(int fd) { if (strncmp(string, "WAVE", 4)) { - odebug << "not a valid WAV file." << oendl; + owarn << "not a valid WAV file." << oendl; return -1; @@ -197,3 +197,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, string, 4) < 4) { - odebug << "Could not read from sound file." << oendl; + owarn << "Could not read from sound file." << oendl; return -1; @@ -202,3 +202,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &longdata, 4) < 4) { - odebug << "Could not read from sound file." << oendl; + owarn << "Could not read from sound file." << oendl; return -1; @@ -209,3 +209,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &fmt, 2) < 2) { - odebug << "Could not read format chunk." << oendl; + owarn << "Could not read format chunk." << oendl; return -1; @@ -213,3 +213,3 @@ int WavFile::parseWavHeader(int fd) { if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) { - odebug << "Wave file contains unknown format. Unable to continue." << oendl; + owarn << "Wave file contains unknown format. Unable to continue." << oendl; return -1; @@ -218,5 +218,5 @@ int WavFile::parseWavHeader(int fd) { // compressionFormat=fmt; - odebug << "compressionFormat is " << fmt << "" << oendl; + owarn << "compressionFormat is " << fmt << "" << oendl; if (read(fd, &ch, 2) < 2) { - odebug << "Could not read format chunk." << oendl; + owarn << "Could not read format chunk." << oendl; return -1; @@ -224,6 +224,6 @@ int WavFile::parseWavHeader(int fd) { wavChannels = ch; - odebug << "File has " << ch << " channels" << oendl; + owarn << "File has " << ch << " channels" << oendl; } if (read(fd, &samplerrate, 4) < 4) { - odebug << "Could not read from format chunk." << oendl; + owarn << "Could not read from format chunk." << oendl; return -1; @@ -232,3 +232,3 @@ int WavFile::parseWavHeader(int fd) { // sampleRate = samplerrate; - odebug << "File has samplerate of " << (int) samplerrate << "" << oendl; + owarn << "File has samplerate of " << (int) samplerrate << "" << oendl; } @@ -236,3 +236,3 @@ int WavFile::parseWavHeader(int fd) { if (read(fd, &bitrate, 2) < 2) { - odebug << "Could not read format chunk." << oendl; + owarn << "Could not read format chunk." << oendl; return -1; @@ -241,3 +241,3 @@ int WavFile::parseWavHeader(int fd) { // resolution = bitrate; - odebug << "File has bitrate of " << bitrate << "" << oendl; + owarn << "File has bitrate of " << bitrate << "" << oendl; } |