-Aesthetic code improvements

main
Harry van Haaren 2013-12-07 23:27:33 +00:00
parent 5da65ef645
commit d25a7ab339
3 changed files with 9 additions and 4 deletions

View File

@ -59,6 +59,11 @@ void Looper::setRequestedBuffer(int s, AudioBuffer* ab)
clips[s]->setRequestedBuffer( ab );
}
void Looper::setFpb(int f)
{
fpb = f;
}
void Looper::process(unsigned int nframes, Buffers* buffers)
{
// process each clip individually: this allows for playback of one clip,
@ -97,6 +102,7 @@ void Looper::process(unsigned int nframes, Buffers* buffers)
for(unsigned int i = 0; i < nframes; i++ )
{
// REFACTOR into system that is better than per sample function calls
float tmp = clips[clip]->getSample(playSpeed);
float deltaPitch = 12 * log ( playSpeed ) / log (2);

View File

@ -28,7 +28,7 @@ class Looper : public AudioProcessor, public TimeObserver
void setRequestedBuffer(int s, AudioBuffer* ab);
/// stores the framesPerBeat from TimeManager. Used to stretch audio
void setFpb(int f) { fpb = f; }
void setFpb(int f);
/// Retrieve a clip from the Looper
LooperClip* getClip(int scene);

View File

@ -139,7 +139,6 @@ void LooperClip::setRequestedBuffer( AudioBuffer* ab )
void LooperClip::recieveSaveBuffer( AudioBuffer* saveBuffer )
{
// CRITICAL FIXME: crash on buffer size difference
if ( saveBuffer->getData().size() >= _buffer->getData().at(0) )
{
// copy current contents into save buffer,
@ -184,8 +183,8 @@ void LooperClip::record(int count, float* L, float* R)
else
{
// break: this is *BAD*, audio data is lost but the buffer isn't here
// yet to hold new audio data so there's no option. This has only been
// experienced during development / testing, not actual usage.
// yet to hold new audio data so there's no option. This has not been
// encountered in actual usage, only during the development process.
char buffer [50];
sprintf (buffer, "LooperClip t %i, s %i, Error: out of mem!",track, scene );
EventGuiPrint e( buffer );