summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2013-06-14 10:25:54 +0200
committerJohn Glover <j@johnglover.net>2013-06-14 10:25:54 +0200
commit867963906f35b676e100e5310c729ab342db1851 (patch)
tree181ee58445d07962aef8a5dbc22eef45a95e3ed3 /src
parent0c446da72f68df37b2377850bb8d978424b9d401 (diff)
downloadsimpl-867963906f35b676e100e5310c729ab342db1851.tar.gz
simpl-867963906f35b676e100e5310c729ab342db1851.tar.bz2
simpl-867963906f35b676e100e5310c729ab342db1851.zip
Allow Frame audio to be specified as less than frame size (with the remainder automatically set to 0).
Diffstat (limited to 'src')
-rw-r--r--src/simpl/base.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/simpl/base.cpp b/src/simpl/base.cpp
index 83155c5..2cbb285 100644
--- a/src/simpl/base.cpp
+++ b/src/simpl/base.cpp
@@ -356,6 +356,12 @@ void Frame::audio(sample* new_audio, int size) {
std::rotate(_audio, _audio + size, _audio + _size);
std::copy(new_audio, new_audio + size, _audio + (_size - size));
}
+ else if(size < _size) {
+ std::copy(new_audio, new_audio + size, _audio);
+ for(int i = size; i < _size; i++) {
+ _audio[i] = 0.0;
+ }
+ }
else if(size == _size) {
std::copy(new_audio, new_audio + size, _audio);
}