mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Updated Buffer handling in LooperClip
This commit is contained in:
parent
cbd4e347cc
commit
0e8c5ea91b
2 changed files with 9 additions and 6 deletions
|
@ -16,11 +16,17 @@ class AudioBuffer
|
|||
}
|
||||
AudioBuffer(unsigned long size)
|
||||
{
|
||||
//ID = id;
|
||||
/// no ID assigned: it *takes* the one from the previous buffer!
|
||||
numBeats = 0;
|
||||
buffer.resize(size);
|
||||
}
|
||||
|
||||
/// this function is used for "resizing" an exisiting buffer, and should
|
||||
/// not be called for any other reason.
|
||||
void setID(int id)
|
||||
{
|
||||
ID = id;
|
||||
}
|
||||
|
||||
int getID()
|
||||
{
|
||||
|
|
|
@ -59,12 +59,9 @@ void LooperClip::setRequestedBuffer( AudioBuffer* ab )
|
|||
if ( _buffer )
|
||||
{
|
||||
size_t size = _buffer->getData().size();
|
||||
memcpy( &ab->getData().at(0), &_buffer->getData().at(0), sizeof(float)*size);
|
||||
|
||||
for(size_t i = 0; i < size; i++)
|
||||
{
|
||||
ab->getData().at(i) = _buffer->getData().at( i );
|
||||
}
|
||||
|
||||
ab->setID ( _buffer->getID() );
|
||||
ab->setBeats( _buffer->getBeats() );
|
||||
|
||||
EventDeallocateBuffer e( _buffer );
|
||||
|
|
Loading…
Add table
Reference in a new issue