mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Aesthetic code improvements
This commit is contained in:
parent
5da65ef645
commit
d25a7ab339
3 changed files with 9 additions and 4 deletions
|
@ -59,6 +59,11 @@ void Looper::setRequestedBuffer(int s, AudioBuffer* ab)
|
||||||
clips[s]->setRequestedBuffer( ab );
|
clips[s]->setRequestedBuffer( ab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Looper::setFpb(int f)
|
||||||
|
{
|
||||||
|
fpb = f;
|
||||||
|
}
|
||||||
|
|
||||||
void Looper::process(unsigned int nframes, Buffers* buffers)
|
void Looper::process(unsigned int nframes, Buffers* buffers)
|
||||||
{
|
{
|
||||||
// process each clip individually: this allows for playback of one clip,
|
// 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++ )
|
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 tmp = clips[clip]->getSample(playSpeed);
|
||||||
|
|
||||||
float deltaPitch = 12 * log ( playSpeed ) / log (2);
|
float deltaPitch = 12 * log ( playSpeed ) / log (2);
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Looper : public AudioProcessor, public TimeObserver
|
||||||
void setRequestedBuffer(int s, AudioBuffer* ab);
|
void setRequestedBuffer(int s, AudioBuffer* ab);
|
||||||
|
|
||||||
/// stores the framesPerBeat from TimeManager. Used to stretch audio
|
/// 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
|
/// Retrieve a clip from the Looper
|
||||||
LooperClip* getClip(int scene);
|
LooperClip* getClip(int scene);
|
||||||
|
|
|
@ -139,7 +139,6 @@ void LooperClip::setRequestedBuffer( AudioBuffer* ab )
|
||||||
|
|
||||||
void LooperClip::recieveSaveBuffer( AudioBuffer* saveBuffer )
|
void LooperClip::recieveSaveBuffer( AudioBuffer* saveBuffer )
|
||||||
{
|
{
|
||||||
// CRITICAL FIXME: crash on buffer size difference
|
|
||||||
if ( saveBuffer->getData().size() >= _buffer->getData().at(0) )
|
if ( saveBuffer->getData().size() >= _buffer->getData().at(0) )
|
||||||
{
|
{
|
||||||
// copy current contents into save buffer,
|
// copy current contents into save buffer,
|
||||||
|
@ -184,8 +183,8 @@ void LooperClip::record(int count, float* L, float* R)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// break: this is *BAD*, audio data is lost but the buffer isn't here
|
// 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
|
// yet to hold new audio data so there's no option. This has not been
|
||||||
// experienced during development / testing, not actual usage.
|
// encountered in actual usage, only during the development process.
|
||||||
char buffer [50];
|
char buffer [50];
|
||||||
sprintf (buffer, "LooperClip t %i, s %i, Error: out of mem!",track, scene );
|
sprintf (buffer, "LooperClip t %i, s %i, Error: out of mem!",track, scene );
|
||||||
EventGuiPrint e( buffer );
|
EventGuiPrint e( buffer );
|
||||||
|
|
Loading…
Add table
Reference in a new issue