diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-09-15 09:28:15 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-09-15 09:28:15 +0200 |
commit | 22e8c588324184b777cea9f55ec0fc73b56949b8 (patch) | |
tree | cb75167772447848650d90b01c171b344cdc61e3 /src/audiofile.cc | |
parent | 9883fb4fc232ebdea44dcf7b015499d31f999695 (diff) |
New experimental sample selector (enable using --with-experimental argument on ./configure).
Diffstat (limited to 'src/audiofile.cc')
-rw-r--r-- | src/audiofile.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/audiofile.cc b/src/audiofile.cc index 511df27..37fb5cc 100644 --- a/src/audiofile.cc +++ b/src/audiofile.cc @@ -171,7 +171,7 @@ void AudioFile::reset() mutex.unlock(); } -void AudioFile::load() +void AudioFile::load(int num_samples) { /* Lazy load of drum kits @@ -191,6 +191,8 @@ void AudioFile::load() size = sf_info.frames; + if(num_samples != ALL_SAMPLES && (int)size > num_samples) size = num_samples; + sample_t* data = new sample_t[size]; size = sf_read_float(fh, data, size); |