From a19be701c9081302ab784a9d5b96b594e53c7d3c Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Tue, 13 Aug 2013 17:06:59 +0100 Subject: [PATCH] -Fixed buffer deallocation in LooperClip --- FIXME | 3 --- TODO | 2 -- src/looperclip.hxx | 8 +++----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/FIXME b/FIXME index 6857dea..35c2509 100644 --- a/FIXME +++ b/FIXME @@ -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* diff --git a/TODO b/TODO index 9adf4e4..9f56705 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/src/looperclip.hxx b/src/looperclip.hxx index a6fbc2d..a9cefde 100644 --- a/src/looperclip.hxx +++ b/src/looperclip.hxx @@ -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 ); }