summaryrefslogtreecommitdiff
path: root/src/audiofile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/audiofile.cc')
-rw-r--r--src/audiofile.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/audiofile.cc b/src/audiofile.cc
index c3dba3c..b8b4ef9 100644
--- a/src/audiofile.cc
+++ b/src/audiofile.cc
@@ -31,12 +31,22 @@
#include <sndfile.h>
-AudioFile::AudioFile(std::string filename, bool preload)
+AudioFile::AudioFile(std::string filename, bool preload, int min_velocity)
{
this->filename = filename;
data = NULL;
size = 0;
- if(preload) load();
+
+ char *p = (char*)filename.c_str() + filename.length() - 6;
+ int num = atoi(p);
+ if(num < 0) num *= -1;
+
+ printf("%s", filename.c_str());
+ if(preload && num >= min_velocity) {
+ printf(" ... loading");
+ load();
+ }
+ printf("\n");
}
AudioFile::~AudioFile()