summaryrefslogtreecommitdiff
path: root/src/audiofile.cc
diff options
context:
space:
mode:
author- <nemo@alice.(none)>2013-05-10 11:15:23 +0200
committer- <nemo@alice.(none)>2013-05-10 11:15:23 +0200
commitdd64f50a05b2834014582134e13daf8575c70757 (patch)
treef6dbd415063a3bd6912b3276f9dec5e6b6b438ce /src/audiofile.cc
parent9aeb20d5586aa2a548ac6583bc42f84a5e065bff (diff)
Outcommented lazy loading of sound files.
Diffstat (limited to 'src/audiofile.cc')
-rw-r--r--src/audiofile.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/audiofile.cc b/src/audiofile.cc
index b3b47e8..b0180cb 100644
--- a/src/audiofile.cc
+++ b/src/audiofile.cc
@@ -168,9 +168,12 @@ void AudioFile::reset() {
void AudioFile::load()
{
+ /*
+ Lazy load of drum kits
init();
return;
-/*
+ */
+
if(data) return;
SF_INFO sf_info;
@@ -182,8 +185,7 @@ void AudioFile::load()
size = sf_info.frames;
- data = new sample_t[size];
-
+ sample_t* data = new sample_t[size];
size = sf_read_float(fh, data, size);
printf("Loaded %d samples %p\n", size, this);
@@ -191,9 +193,10 @@ void AudioFile::load()
sf_close(fh);
mutex.lock();
+ this->data = data;
is_loaded = true;
mutex.unlock();
-*/
+
//DEBUG(audiofile, "Loading of %s completed.\n", filename.c_str());
}