Rename a few build variables for overall consistency

pull/1/head
Timothy Pearson 12 years ago
parent efe74e7dc3
commit 4da01909a8

@ -35,12 +35,12 @@ using std::cout;
using std::cerr; using std::cerr;
using std::endl; using std::endl;
//#define DEBUG_PEAKFILE 1 //#define DEBUG_PEATDEFILE 1
//#define DEBUG_PEAKFILE_BRIEF 1 //#define DEBUG_PEATDEFILE_BRIEF 1
//#define DEBUG_PEAKFILE_CACHE 1 //#define DEBUG_PEATDEFILE_CACHE 1
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
#define DEBUG_PEAKFILE_BRIEF 1 #define DEBUG_PEATDEFILE_BRIEF 1
#endif #endif
namespace Rosegarden namespace Rosegarden
@ -94,7 +94,7 @@ PeakFile::open()
parseHeader(); parseHeader();
} catch (BadSoundFileException s) { } catch (BadSoundFileException s) {
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
cerr << "PeakFile::open - EXCEPTION \"" << s.getMessage() << "\"" cerr << "PeakFile::open - EXCEPTION \"" << s.getMessage() << "\""
<< endl; << endl;
#endif #endif
@ -216,7 +216,7 @@ PeakFile::write(unsigned short updatePercentage)
if (!m_audioFile->open()) if (!m_audioFile->open())
return false; return false;
} catch (BadSoundFileException e) { } catch (BadSoundFileException e) {
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cerr << "PeakFile::write - \"" << e.getMessage() << "\"" << std::endl; std::cerr << "PeakFile::write - \"" << e.getMessage() << "\"" << std::endl;
#endif #endif
@ -484,7 +484,7 @@ PeakFile::writePeaks(unsigned short /*updatePercentage*/,
return ; return ;
m_keepProcessing = true; m_keepProcessing = true;
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
cout << "PeakFile::writePeaks - calculating peaks" << endl; cout << "PeakFile::writePeaks - calculating peaks" << endl;
#endif #endif
@ -624,7 +624,7 @@ PeakFile::writePeaks(unsigned short /*updatePercentage*/,
m_numberOfPeaks++; m_numberOfPeaks++;
} }
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
cout << "PeakFile::writePeaks - " cout << "PeakFile::writePeaks - "
<< "completed peaks" << endl; << "completed peaks" << endl;
#endif #endif
@ -642,7 +642,7 @@ PeakFile::getPreview(const RealTime &startTime,
int width, int width,
bool showMinima) bool showMinima)
{ {
#ifdef DEBUG_PEAKFILE_BRIEF #ifdef DEBUG_PEATDEFILE_BRIEF
std::cout << "PeakFile::getPreview - " std::cout << "PeakFile::getPreview - "
<< "startTime = " << startTime << "startTime = " << startTime
<< ", endTime = " << endTime << ", endTime = " << endTime
@ -658,7 +658,7 @@ PeakFile::getPreview(const RealTime &startTime,
// Regenerate cache on these conditions // Regenerate cache on these conditions
// //
if (!m_peakCache.length()) { if (!m_peakCache.length()) {
#ifdef DEBUG_PEAKFILE_CACHE #ifdef DEBUG_PEATDEFILE_CACHE
std::cerr << "PeakFile::getPreview - no peak cache" << std::endl; std::cerr << "PeakFile::getPreview - no peak cache" << std::endl;
#endif #endif
@ -675,13 +675,13 @@ PeakFile::getPreview(const RealTime &startTime,
<< std::endl; << std::endl;
} }
#ifdef DEBUG_PEAKFILE_CACHE #ifdef DEBUG_PEATDEFILE_CACHE
std::cout << "PeakFile::getPreview - generated peak cache - " std::cout << "PeakFile::getPreview - generated peak cache - "
<< "size = " << m_peakCache.length() << std::endl; << "size = " << m_peakCache.length() << std::endl;
#endif #endif
} else { } else {
#ifdef DEBUG_PEAKFILE_CACHE #ifdef DEBUG_PEATDEFILE_CACHE
std::cout << "PeakFile::getPreview - file size = " << getSize() std::cout << "PeakFile::getPreview - file size = " << getSize()
<< ", not generating cache" << std::endl; << ", not generating cache" << std::endl;
#endif #endif
@ -694,13 +694,13 @@ PeakFile::getPreview(const RealTime &startTime,
// //
if (startTime == m_lastPreviewStartTime && endTime == m_lastPreviewEndTime if (startTime == m_lastPreviewStartTime && endTime == m_lastPreviewEndTime
&& width == m_lastPreviewWidth && showMinima == m_lastPreviewShowMinima) { && width == m_lastPreviewWidth && showMinima == m_lastPreviewShowMinima) {
#ifdef DEBUG_PEAKFILE_CACHE #ifdef DEBUG_PEATDEFILE_CACHE
std::cout << "PeakFile::getPreview - hit last preview cache" << std::endl; std::cout << "PeakFile::getPreview - hit last preview cache" << std::endl;
#endif #endif
return m_lastPreviewCache; return m_lastPreviewCache;
} else { } else {
#ifdef DEBUG_PEAKFILE_CACHE #ifdef DEBUG_PEATDEFILE_CACHE
std::cout << "PeakFile::getPreview - last preview " << m_lastPreviewStartTime std::cout << "PeakFile::getPreview - last preview " << m_lastPreviewStartTime
<< " -> " << m_lastPreviewEndTime << ", w " << m_lastPreviewWidth << "; this " << startTime << " -> " << endTime << ", w " << width << std::endl; << " -> " << m_lastPreviewEndTime << ", w " << m_lastPreviewWidth << "; this " << startTime << " -> " << endTime << ", w " << width << std::endl;
#endif #endif
@ -724,7 +724,7 @@ PeakFile::getPreview(const RealTime &startTime,
std::string peakData; std::string peakData;
int peakNumber; int peakNumber;
#ifdef DEBUG_PEAKFILE_BRIEF #ifdef DEBUG_PEATDEFILE_BRIEF
std::cout << "PeakFile::getPreview - getting preview for \"" std::cout << "PeakFile::getPreview - getting preview for \""
<< m_audioFile->getFilename() << "\"" << endl; << m_audioFile->getFilename() << "\"" << endl;
@ -743,7 +743,7 @@ PeakFile::getPreview(const RealTime &startTime,
break; break;
default: default:
#ifdef DEBUG_PEAKFILE_BRIEF #ifdef DEBUG_PEATDEFILE_BRIEF
std::cout << "PeakFile::getPreview - " std::cout << "PeakFile::getPreview - "
<< "unsupported peak length format (" << m_format << ")" << "unsupported peak length format (" << m_format << ")"
@ -766,14 +766,14 @@ PeakFile::getPreview(const RealTime &startTime,
if (!m_peakCache.length()) { if (!m_peakCache.length()) {
if (scanToPeak(peakNumber) == false) { if (scanToPeak(peakNumber) == false) {
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "PeakFile::getPreview: scanToPeak(" << peakNumber << ") failed" << std::endl; std::cout << "PeakFile::getPreview: scanToPeak(" << peakNumber << ") failed" << std::endl;
#endif #endif
m_lastPreviewCache.push_back(0.0f); m_lastPreviewCache.push_back(0.0f);
} }
} }
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "PeakFile::getPreview: step is " << step << ", format * pointsPerValue * chans is " << (m_format * m_pointsPerValue * m_channels) << std::endl; std::cout << "PeakFile::getPreview: step is " << step << ", format * pointsPerValue * chans is " << (m_format * m_pointsPerValue * m_channels) << std::endl;
std::cout << "i = " << i << ", peakNumber = " << peakNumber << ", nextPeakNumber = " << nextPeakNumber << std::endl; std::cout << "i = " << i << ", peakNumber = " << peakNumber << ", nextPeakNumber = " << nextPeakNumber << std::endl;
#endif #endif
@ -797,14 +797,14 @@ PeakFile::getPreview(const RealTime &startTime,
// Problem with the get - probably an EOF // Problem with the get - probably an EOF
// return the results so far. // return the results so far.
// //
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "PeakFile::getPreview - \"" << e.getMessage() << "\"\n" std::cout << "PeakFile::getPreview - \"" << e.getMessage() << "\"\n"
<< endl; << endl;
#endif #endif
goto done; goto done;
} }
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "PeakFile::getPreview - " std::cout << "PeakFile::getPreview - "
<< "read from file" << std::endl; << "read from file" << std::endl;
#endif #endif
@ -820,7 +820,7 @@ PeakFile::getPreview(const RealTime &startTime,
// //
if (charNum + charLength <= m_peakCache.length()) { if (charNum + charLength <= m_peakCache.length()) {
peakData = m_peakCache.substr(charNum, charLength); peakData = m_peakCache.substr(charNum, charLength);
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "PeakFile::getPreview - " std::cout << "PeakFile::getPreview - "
<< "hit peakCache" << std::endl; << "hit peakCache" << std::endl;
@ -835,7 +835,7 @@ PeakFile::getPreview(const RealTime &startTime,
// We didn't get the whole peak block - return what // We didn't get the whole peak block - return what
// we've got so far // we've got so far
// //
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "PeakFile::getPreview - " std::cout << "PeakFile::getPreview - "
<< "failed to get complete peak block" << "failed to get complete peak block"
<< endl; << endl;
@ -852,7 +852,7 @@ PeakFile::getPreview(const RealTime &startTime,
inValue -= (1 << (m_format * 8)); inValue -= (1 << (m_format * 8));
} }
#ifdef DEBUG_PEAKFILE #ifdef DEBUG_PEATDEFILE
std::cout << "found potential hivalue " << inValue << std::endl; std::cout << "found potential hivalue " << inValue << std::endl;
#endif #endif
@ -883,7 +883,7 @@ PeakFile::getPreview(const RealTime &startTime,
float value = hiValues[ch] / divisor; float value = hiValues[ch] / divisor;
#ifdef DEBUG_PEAKFILE_BRIEF #ifdef DEBUG_PEATDEFILE_BRIEF
std::cout << "VALUE = " << hiValues[ch] / divisor << std::endl; std::cout << "VALUE = " << hiValues[ch] / divisor << std::endl;
#endif #endif
@ -912,7 +912,7 @@ done:
m_lastPreviewWidth = width; m_lastPreviewWidth = width;
m_lastPreviewShowMinima = showMinima; m_lastPreviewShowMinima = showMinima;
#ifdef DEBUG_PEAKFILE_BRIEF #ifdef DEBUG_PEATDEFILE_BRIEF
std::cout << "Returning " << m_lastPreviewCache.size() << " items" << std::endl; std::cout << "Returning " << m_lastPreviewCache.size() << " items" << std::endl;
#endif #endif

@ -26,8 +26,8 @@
#include "SoundFile.h" #include "SoundFile.h"
#include "RealTime.h" #include "RealTime.h"
#ifndef _PEAKFILE_H_ #ifndef _PEATDEFILE_H_
#define _PEAKFILE_H_ #define _PEATDEFILE_H_
// A PeakFile is generated to the BWF Supplement 3 Peak Envelope Chunk // A PeakFile is generated to the BWF Supplement 3 Peak Envelope Chunk
// format as defined here: // format as defined here:
@ -192,6 +192,6 @@ protected:
} }
#endif // _PEAKFILE_H_ #endif // _PEATDEFILE_H_

@ -132,7 +132,7 @@ PeakFileManager::hasValidPeaks(AudioFile *audioFile)
PeakFile *peakFile = getPeakFile(audioFile); PeakFile *peakFile = getPeakFile(audioFile);
if (peakFile == 0) { if (peakFile == 0) {
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
std::cerr << "PeakFileManager::hasValidPeaks - no peak file found" std::cerr << "PeakFileManager::hasValidPeaks - no peak file found"
<< std::endl; << std::endl;
#endif #endif
@ -150,7 +150,7 @@ PeakFileManager::hasValidPeaks(AudioFile *audioFile)
} else if (audioFile->getType() == BWF) { } else if (audioFile->getType() == BWF) {
// check internal peak chunk // check internal peak chunk
} else { } else {
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
std::cout << "PeakFileManager::hasValidPeaks - unsupported file type" std::cout << "PeakFileManager::hasValidPeaks - unsupported file type"
<< std::endl; << std::endl;
#endif #endif
@ -170,7 +170,7 @@ void
PeakFileManager::generatePeaks(AudioFile *audioFile, PeakFileManager::generatePeaks(AudioFile *audioFile,
unsigned short updatePercentage) unsigned short updatePercentage)
{ {
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
std::cout << "PeakFileManager::generatePeaks - generating peaks for \"" std::cout << "PeakFileManager::generatePeaks - generating peaks for \""
<< audioFile->getFilename() << "\"" << std::endl; << audioFile->getFilename() << "\"" << std::endl;
#endif #endif
@ -199,7 +199,7 @@ PeakFileManager::generatePeaks(AudioFile *audioFile,
} else if (audioFile->getType() == BWF) { } else if (audioFile->getType() == BWF) {
// write the file out and incorporate the peak chunk // write the file out and incorporate the peak chunk
} else { } else {
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
std::cerr << "PeakFileManager::generatePeaks - unsupported file type" std::cerr << "PeakFileManager::generatePeaks - unsupported file type"
<< std::endl; << std::endl;
#endif #endif
@ -237,7 +237,7 @@ PeakFileManager::getPreview(AudioFile *audioFile,
width, width,
showMinima); showMinima);
} catch (SoundFile::BadSoundFileException e) { } catch (SoundFile::BadSoundFileException e) {
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
std::cout << "PeakFileManager::getPreview " std::cout << "PeakFileManager::getPreview "
<< "\"" << e << "\"" << std::endl; << "\"" << e << "\"" << std::endl;
#else #else
@ -250,7 +250,7 @@ PeakFileManager::getPreview(AudioFile *audioFile,
} else if (audioFile->getType() == BWF) { } else if (audioFile->getType() == BWF) {
// write the file out and incorporate the peak chunk // write the file out and incorporate the peak chunk
} }
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
else { else {
std::cerr << "PeakFileManager::getPreview - unsupported file type" std::cerr << "PeakFileManager::getPreview - unsupported file type"
<< std::endl; << std::endl;
@ -306,7 +306,7 @@ PeakFileManager::stopPreview()
TQFile file(fileName); TQFile file(fileName);
bool removed = file.remove(); bool removed = file.remove();
#ifdef DEBUG_PEAKFILEMANAGER #ifdef DEBUG_PEATDEFILEMANAGER
if (removed) { if (removed) {
std::cout << "PeakFileManager::stopPreview() - removed preview" std::cout << "PeakFileManager::stopPreview() - removed preview"

@ -27,8 +27,8 @@
// //
// //
#ifndef _PEAKFILEMANAGER_H_ #ifndef _PEATDEFILEMANAGER_H_
#define _PEAKFILEMANAGER_H_ #define _PEATDEFILEMANAGER_H_
#include <string> #include <string>
#include <iostream> #include <iostream>
@ -158,6 +158,6 @@ protected:
} }
#endif // _PEAKFILEMANAGER_H_ #endif // _PEATDEFILEMANAGER_H_

Loading…
Cancel
Save