-Fixed buffer deallocation in LooperClip

This commit is contained in:
Harry van Haaren 2013-08-13 17:06:59 +01:00
parent 40850e0e41
commit a19be701c9
3 changed files with 3 additions and 10 deletions

3
FIXME
View file

@ -3,6 +3,3 @@
=TimeManager class, auto register TimeObservers with it.
Segfaulting on register in constructor
=LooperClip setRequestedBuffer()
// Send Deallocate event for _buffer *here* *now*

2
TODO
View file

@ -5,8 +5,6 @@
- Add AudioBuffer soundfile writer in order to check contents (looper distortion bug)
- Update recording mechanism to request buffers when they're getting full
- Update GUI threading to become controller independant, allowing a
ControllerUpdater instance run in the UI thread, updating each Controller
subclass instance. This affords OSC user-interfaces, as well a the GUI, as well

View file

@ -39,15 +39,15 @@ class LooperClip
_recordhead = 0;
}
/// loads a sample: eg from disk
/// loads a sample: eg from disk, unloading current sample if necessary
void load( AudioBuffer* ab )
{
_loaded = true;
if ( _buffer )
{
// unload old buffer!
printf("LooperClip: FIXME:TODO de-allocate old sample here!\n");
EventDeallocateBuffer e( _buffer );
writeToGuiRingbuffer( &e );
}
_buffer = ab;
@ -69,8 +69,6 @@ class LooperClip
ab->getData().at(i) = _buffer->getData().at( i );
}
// Send Deallocate event for _buffer *here* *now*
EventDeallocateBuffer e( _buffer );
writeToGuiRingbuffer( &e );
}