-Updated recording logic, buffer updates tested and working. Can sample from JACK and playback

This commit is contained in:
Harry van Haaren 2013-08-07 00:33:38 +01:00
parent 18bd5144b2
commit edb2913d6e
6 changed files with 14 additions and 4 deletions

View file

@ -60,18 +60,21 @@ void GridLogic::bar()
{
state[i] = STATE_PLAYING;
jack->getLooper( track )->setRecord( scene, false);
jack->getLooper( track )->play( scene, true);
change = true;
}
else if ( state[i] == STATE_STOP_QUEUED )
{
state[i] = STATE_LOADED;
jack->getLooper( track )->setRecord( scene, false);
jack->getLooper( track )->play( scene, false);
change = true;
}
else if ( state[i] == STATE_RECORD_QUEUED )
{
state[i] = STATE_RECORDING;
jack->getLooper( track )->setRecord( scene, true);
jack->getLooper( track )->play( scene, false);
change = true;
}

View file

@ -16,7 +16,7 @@ void Logic::tapTempo()
void Logic::trackVolume(int t, float v)
{
printf( "Logic trackVolume() %i, %f\n", t, v );
//printf( "Logic trackVolume() %i, %f\n", t, v );
jack->getTrackOutput( t )->setMaster( v );
jack->getControllerUpdater()->volume( t, v );
}

View file

@ -47,6 +47,11 @@ void Looper::setRecord(int scene, bool r)
clips[scene].recording(r);
}
void Looper::play(int scene, bool r)
{
clips[scene].playing(r);
}
LooperClip* Looper::getClip(int scene)
{
return &clips[scene];
@ -210,7 +215,6 @@ void Looper::process(int nframes, Buffers* buffers)
if ( clips[clip].recordSpaceAvailable() < LOOPER_SAMPLES_BEFORE_REQUEST &&
!clips[clip].newBufferInTransit() )
{
printf("requesting new buffer now\n");
EventLooperClipRequestBuffer e( track, clip, clips[clip].audioBufferSize() + 44100 * 4);
writeToGuiRingbuffer( &e );
clips[clip].newBufferInTransit(true);
@ -219,6 +223,7 @@ void Looper::process(int nframes, Buffers* buffers)
// copy data from input buffer to recording buffer
float* input = buffers->audio[Buffers::MASTER_INPUT];
clips[clip].record( nframes, input, 0 );
}
else if ( clips[clip].playing() )
{

View file

@ -39,6 +39,7 @@ class Looper : public AudioProcessor, public TimeObserver
void queuePlayScene( int sc );
void play(int scene, bool r);
void setRecord(int scene, bool r);

View file

@ -112,6 +112,7 @@ class LooperClip
}
bool loaded(){return _loaded;}
void playing(bool p){_playing = p;}
bool playing(){return _playing;}
bool recording(){return _recording;}
void recording(bool r){_recording = r;}

View file

@ -98,8 +98,8 @@ class TrackOutput : public AudioProcessor
{
float tmp = _trackBuffer[i];
*masterR++ += tmp; // * _toMaster;
*masterL++ += tmp; // * _toMaster;
*masterL++ += tmp * _toMaster;
*masterR++ += tmp * _toMaster;
//*reverb++ += tmp * _toReverb;
//*sidechain++ += tmp * _toSidechain;