summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sound/PeakFile.cpp52
-rw-r--r--src/sound/PeakFile.h6
-rw-r--r--src/sound/PeakFileManager.cpp14
-rw-r--r--src/sound/PeakFileManager.h6
4 files changed, 39 insertions, 39 deletions
diff --git a/src/sound/PeakFile.cpp b/src/sound/PeakFile.cpp
index ef9ff65..7a89996 100644
--- a/src/sound/PeakFile.cpp
+++ b/src/sound/PeakFile.cpp
@@ -35,12 +35,12 @@ using std::cout;
using std::cerr;
using std::endl;
-//#define DEBUG_PEATDEFILE 1
-//#define DEBUG_PEATDEFILE_BRIEF 1
-//#define DEBUG_PEATDEFILE_CACHE 1
+//#define DEBUG_PEAKFILE 1
+//#define DEBUG_PEAKFILE_BRIEF 1
+//#define DEBUG_PEAKFILE_CACHE 1
-#ifdef DEBUG_PEATDEFILE
-#define DEBUG_PEATDEFILE_BRIEF 1
+#ifdef DEBUG_PEAKFILE
+#define DEBUG_PEAKFILE_BRIEF 1
#endif
namespace Rosegarden
@@ -94,7 +94,7 @@ PeakFile::open()
parseHeader();
} catch (BadSoundFileException s) {
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
cerr << "PeakFile::open - EXCEPTION \"" << s.getMessage() << "\""
<< endl;
#endif
@@ -216,7 +216,7 @@ PeakFile::write(unsigned short updatePercentage)
if (!m_audioFile->open())
return false;
} catch (BadSoundFileException e) {
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cerr << "PeakFile::write - \"" << e.getMessage() << "\"" << std::endl;
#endif
@@ -484,7 +484,7 @@ PeakFile::writePeaks(unsigned short /*updatePercentage*/,
return ;
m_keepProcessing = true;
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
cout << "PeakFile::writePeaks - calculating peaks" << endl;
#endif
@@ -624,7 +624,7 @@ PeakFile::writePeaks(unsigned short /*updatePercentage*/,
m_numberOfPeaks++;
}
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
cout << "PeakFile::writePeaks - "
<< "completed peaks" << endl;
#endif
@@ -642,7 +642,7 @@ PeakFile::getPreview(const RealTime &startTime,
int width,
bool showMinima)
{
-#ifdef DEBUG_PEATDEFILE_BRIEF
+#ifdef DEBUG_PEAKFILE_BRIEF
std::cout << "PeakFile::getPreview - "
<< "startTime = " << startTime
<< ", endTime = " << endTime
@@ -658,7 +658,7 @@ PeakFile::getPreview(const RealTime &startTime,
// Regenerate cache on these conditions
//
if (!m_peakCache.length()) {
-#ifdef DEBUG_PEATDEFILE_CACHE
+#ifdef DEBUG_PEAKFILE_CACHE
std::cerr << "PeakFile::getPreview - no peak cache" << std::endl;
#endif
@@ -675,13 +675,13 @@ PeakFile::getPreview(const RealTime &startTime,
<< std::endl;
}
-#ifdef DEBUG_PEATDEFILE_CACHE
+#ifdef DEBUG_PEAKFILE_CACHE
std::cout << "PeakFile::getPreview - generated peak cache - "
<< "size = " << m_peakCache.length() << std::endl;
#endif
} else {
-#ifdef DEBUG_PEATDEFILE_CACHE
+#ifdef DEBUG_PEAKFILE_CACHE
std::cout << "PeakFile::getPreview - file size = " << getSize()
<< ", not generating cache" << std::endl;
#endif
@@ -694,13 +694,13 @@ PeakFile::getPreview(const RealTime &startTime,
//
if (startTime == m_lastPreviewStartTime && endTime == m_lastPreviewEndTime
&& width == m_lastPreviewWidth && showMinima == m_lastPreviewShowMinima) {
-#ifdef DEBUG_PEATDEFILE_CACHE
+#ifdef DEBUG_PEAKFILE_CACHE
std::cout << "PeakFile::getPreview - hit last preview cache" << std::endl;
#endif
return m_lastPreviewCache;
} else {
-#ifdef DEBUG_PEATDEFILE_CACHE
+#ifdef DEBUG_PEAKFILE_CACHE
std::cout << "PeakFile::getPreview - last preview " << m_lastPreviewStartTime
<< " -> " << m_lastPreviewEndTime << ", w " << m_lastPreviewWidth << "; this " << startTime << " -> " << endTime << ", w " << width << std::endl;
#endif
@@ -724,7 +724,7 @@ PeakFile::getPreview(const RealTime &startTime,
std::string peakData;
int peakNumber;
-#ifdef DEBUG_PEATDEFILE_BRIEF
+#ifdef DEBUG_PEAKFILE_BRIEF
std::cout << "PeakFile::getPreview - getting preview for \""
<< m_audioFile->getFilename() << "\"" << endl;
@@ -743,7 +743,7 @@ PeakFile::getPreview(const RealTime &startTime,
break;
default:
-#ifdef DEBUG_PEATDEFILE_BRIEF
+#ifdef DEBUG_PEAKFILE_BRIEF
std::cout << "PeakFile::getPreview - "
<< "unsupported peak length format (" << m_format << ")"
@@ -766,14 +766,14 @@ PeakFile::getPreview(const RealTime &startTime,
if (!m_peakCache.length()) {
if (scanToPeak(peakNumber) == false) {
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cout << "PeakFile::getPreview: scanToPeak(" << peakNumber << ") failed" << std::endl;
#endif
m_lastPreviewCache.push_back(0.0f);
}
}
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
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;
#endif
@@ -797,14 +797,14 @@ PeakFile::getPreview(const RealTime &startTime,
// Problem with the get - probably an EOF
// return the results so far.
//
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cout << "PeakFile::getPreview - \"" << e.getMessage() << "\"\n"
<< endl;
#endif
goto done;
}
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cout << "PeakFile::getPreview - "
<< "read from file" << std::endl;
#endif
@@ -820,7 +820,7 @@ PeakFile::getPreview(const RealTime &startTime,
//
if (charNum + charLength <= m_peakCache.length()) {
peakData = m_peakCache.substr(charNum, charLength);
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cout << "PeakFile::getPreview - "
<< "hit peakCache" << std::endl;
@@ -835,7 +835,7 @@ PeakFile::getPreview(const RealTime &startTime,
// We didn't get the whole peak block - return what
// we've got so far
//
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cout << "PeakFile::getPreview - "
<< "failed to get complete peak block"
<< endl;
@@ -852,7 +852,7 @@ PeakFile::getPreview(const RealTime &startTime,
inValue -= (1 << (m_format * 8));
}
-#ifdef DEBUG_PEATDEFILE
+#ifdef DEBUG_PEAKFILE
std::cout << "found potential hivalue " << inValue << std::endl;
#endif
@@ -883,7 +883,7 @@ PeakFile::getPreview(const RealTime &startTime,
float value = hiValues[ch] / divisor;
-#ifdef DEBUG_PEATDEFILE_BRIEF
+#ifdef DEBUG_PEAKFILE_BRIEF
std::cout << "VALUE = " << hiValues[ch] / divisor << std::endl;
#endif
@@ -912,7 +912,7 @@ done:
m_lastPreviewWidth = width;
m_lastPreviewShowMinima = showMinima;
-#ifdef DEBUG_PEATDEFILE_BRIEF
+#ifdef DEBUG_PEAKFILE_BRIEF
std::cout << "Returning " << m_lastPreviewCache.size() << " items" << std::endl;
#endif
diff --git a/src/sound/PeakFile.h b/src/sound/PeakFile.h
index 00260fb..86ecc56 100644
--- a/src/sound/PeakFile.h
+++ b/src/sound/PeakFile.h
@@ -26,8 +26,8 @@
#include "SoundFile.h"
#include "RealTime.h"
-#ifndef _PEATDEFILE_H_
-#define _PEATDEFILE_H_
+#ifndef _PEAKFILE_H_
+#define _PEAKFILE_H_
// A PeakFile is generated to the BWF Supplement 3 Peak Envelope Chunk
// format as defined here:
@@ -192,6 +192,6 @@ protected:
}
-#endif // _PEATDEFILE_H_
+#endif // _PEAKFILE_H_
diff --git a/src/sound/PeakFileManager.cpp b/src/sound/PeakFileManager.cpp
index 0469f85..e860e00 100644
--- a/src/sound/PeakFileManager.cpp
+++ b/src/sound/PeakFileManager.cpp
@@ -132,7 +132,7 @@ PeakFileManager::hasValidPeaks(AudioFile *audioFile)
PeakFile *peakFile = getPeakFile(audioFile);
if (peakFile == 0) {
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
std::cerr << "PeakFileManager::hasValidPeaks - no peak file found"
<< std::endl;
#endif
@@ -150,7 +150,7 @@ PeakFileManager::hasValidPeaks(AudioFile *audioFile)
} else if (audioFile->getType() == BWF) {
// check internal peak chunk
} else {
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
std::cout << "PeakFileManager::hasValidPeaks - unsupported file type"
<< std::endl;
#endif
@@ -170,7 +170,7 @@ void
PeakFileManager::generatePeaks(AudioFile *audioFile,
unsigned short updatePercentage)
{
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
std::cout << "PeakFileManager::generatePeaks - generating peaks for \""
<< audioFile->getFilename() << "\"" << std::endl;
#endif
@@ -199,7 +199,7 @@ PeakFileManager::generatePeaks(AudioFile *audioFile,
} else if (audioFile->getType() == BWF) {
// write the file out and incorporate the peak chunk
} else {
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
std::cerr << "PeakFileManager::generatePeaks - unsupported file type"
<< std::endl;
#endif
@@ -237,7 +237,7 @@ PeakFileManager::getPreview(AudioFile *audioFile,
width,
showMinima);
} catch (SoundFile::BadSoundFileException e) {
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
std::cout << "PeakFileManager::getPreview "
<< "\"" << e << "\"" << std::endl;
#else
@@ -250,7 +250,7 @@ PeakFileManager::getPreview(AudioFile *audioFile,
} else if (audioFile->getType() == BWF) {
// write the file out and incorporate the peak chunk
}
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
else {
std::cerr << "PeakFileManager::getPreview - unsupported file type"
<< std::endl;
@@ -306,7 +306,7 @@ PeakFileManager::stopPreview()
TQFile file(fileName);
bool removed = file.remove();
-#ifdef DEBUG_PEATDEFILEMANAGER
+#ifdef DEBUG_PEAKFILEMANAGER
if (removed) {
std::cout << "PeakFileManager::stopPreview() - removed preview"
diff --git a/src/sound/PeakFileManager.h b/src/sound/PeakFileManager.h
index b909495..f608bc8 100644
--- a/src/sound/PeakFileManager.h
+++ b/src/sound/PeakFileManager.h
@@ -27,8 +27,8 @@
//
//
-#ifndef _PEATDEFILEMANAGER_H_
-#define _PEATDEFILEMANAGER_H_
+#ifndef _PEAKFILEMANAGER_H_
+#define _PEAKFILEMANAGER_H_
#include <string>
#include <iostream>
@@ -158,6 +158,6 @@ protected:
}
-#endif // _PEATDEFILEMANAGER_H_
+#endif // _PEAKFILEMANAGER_H_