|
From: Tapio V. <aa...@us...> - 2011-01-18 17:15:35
|
Module: editor
Branch: master
Commit: bb282719ded81ba0d87cb91bf46bdb9759b4c624
Author: Tapio Vierros <tap...@gm...>
Date: Tue Jan 18 19:13:04 2011 +0200
Provide easy access to old .raw loader.
In case the current ffmpeg loader state is unsatisfactory.
---
pitchvis.cc | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/pitchvis.cc b/pitchvis.cc
index 8439855..698a8e1 100644
--- a/pitchvis.cc
+++ b/pitchvis.cc
@@ -22,9 +22,10 @@ template <typename T> void readVec(std::string const& filename, std::vector<T>&
}
PitchVis::PitchVis(std::string const& filename): step(512), height(768) {
-// std::vector<float> data;
-// try { readVec(filename, data); } catch(std::exception& e) { std::cerr << e.what() << std::endl; return; }
-
+#if 0 // Change this to 1 to use old raw loading
+ std::vector<float> data;
+ try { readVec("music.raw", data); } catch(std::exception& e) { std::cerr << e.what() << std::endl; return; }
+#else
// FIXME: This is rather horrible and needs clean-up
const unsigned buffersize = 512;
std::vector<float> datas(buffersize);
@@ -45,7 +46,7 @@ PitchVis::PitchVis(std::string const& filename): step(512), height(768) {
for (uint64_t i = 0; i < datas.size() / 2; ++i) {
data.push_back(datas[i*2]);
}
-
+#endif
unsigned width = data.size() / step;
img.resize(width * height);
Analyzer analyzer(44100, "");
|