diff options
author | - <nemo@alice.(none)> | 2013-05-10 11:15:23 +0200 |
---|---|---|
committer | - <nemo@alice.(none)> | 2013-05-10 11:15:23 +0200 |
commit | dd64f50a05b2834014582134e13daf8575c70757 (patch) | |
tree | f6dbd415063a3bd6912b3276f9dec5e6b6b438ce /src | |
parent | 9aeb20d5586aa2a548ac6583bc42f84a5e065bff (diff) |
Outcommented lazy loading of sound files.
Diffstat (limited to 'src')
-rw-r--r-- | src/audiofile.cc | 11 |
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()); } |