-Updated APC handling, bug hunting

This commit is contained in:
Harry van Haaren 2013-08-13 00:41:17 +01:00
parent d90921319b
commit 0306a1873e
7 changed files with 36 additions and 12 deletions

View file

@ -58,6 +58,7 @@ void handleDspEvents()
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventLooperLoad) );
Looper* l = jack->getLooper( ev.track );
l->setSample( ev.clip, (AudioBuffer*)ev.audioBuffer );
jack->getGridLogic()->load( ev.track, ev.clip );
} break; }
case Event::METRONOME_ACTIVE: {
if ( availableRead >= sizeof(EventMetronomeActive) ) {

View file

@ -38,6 +38,12 @@ void GridLogic::released( int track, int scene )
jack->getControllerUpdater()->setSceneState(track, scene, state[track*NSCENES + scene] );
}
void GridLogic::load(int track, int scene)
{
state[track*NSCENES + scene] = STATE_LOADED;
jack->getControllerUpdater()->setSceneState(track, scene, state[track*NSCENES + scene] );
}
void GridLogic::updateState()
{

View file

@ -54,6 +54,9 @@ class GridLogic : public TimeObserver
/// button release / click-release event
void released( int track, int scene );
/// GUI load event
void load(int track, int scene);
/// resend entire grid state to controllers
void updateState();

View file

@ -189,9 +189,9 @@ int Jack::process (jack_nframes_t nframes)
}
metronome->process( nframes, &buffers );
//metronome->process( nframes, &buffers );
/*
// process fx
float* buf[] = {
buffers.audio[Buffers::REVERB],
@ -205,7 +205,8 @@ int Jack::process (jack_nframes_t nframes)
reverbMeter->process(nframes, buffers.audio[Buffers::REVERB], buffers.audio[Buffers::REVERB] );
reverb->process( nframes, &buf[0], &buf[2] );
}
*/
// db meter on master output, then memcpy to JACK
masterMeter->process(nframes, buffers.audio[Buffers::MASTER_OUT_L], buffers.audio[Buffers::MASTER_OUT_R] );
@ -223,8 +224,14 @@ int Jack::process (jack_nframes_t nframes)
for(int i = 0; i < buffers.nframes; i++)
{
buffers.audio[Buffers::JACK_MASTER_OUT_L][i] = buffers.audio[Buffers::MASTER_OUT_L][i];
buffers.audio[Buffers::JACK_MASTER_OUT_R][i] = buffers.audio[Buffers::MASTER_OUT_R][i];
float tmp = 0.f;
for(int t = 0; t < NTRACKS; t++)
{
tmp += buffers.audio[Buffers::TRACK_0 + t][i];
}
buffers.audio[Buffers::JACK_MASTER_OUT_L][i] = tmp;
buffers.audio[Buffers::JACK_MASTER_OUT_R][i] = tmp;
}
/*

View file

@ -49,7 +49,14 @@ void Looper::setRecord(int scene, bool r)
void Looper::play(int scene, bool r)
{
clips[scene].playing(r);
if ( r )
{
for(int i = 0; i < NSCENES; i++)
{
clips[scene].playing(false);
}
clips[scene].playing(true);
}
}
LooperClip* Looper::getClip(int scene)
@ -185,7 +192,7 @@ void Looper::process(int nframes, Buffers* buffers)
if ( clips[clip].recording() )
{
if ( clips[clip].recordSpaceAvailable() < LOOPER_SAMPLES_BEFORE_REQUEST &&
!clips[clip].newBufferInTransit() )
!clips[clip].newBufferInTransit() )
{
EventLooperClipRequestBuffer e( track, clip, clips[clip].audioBufferSize() + 44100 * 4);
writeToGuiRingbuffer( &e );
@ -206,7 +213,7 @@ void Looper::process(int nframes, Buffers* buffers)
out[i] = clips[clip].getSample();
}
// update UI of progress
// FIXME: should user ControllerUpdater
if ( uiUpdateCounter > uiUpdateConstant )
{
jack->getControllerUpdater()->setTrackSceneProgress(track, clip, clips[clip].getProgress() );

View file

@ -53,8 +53,6 @@ class LooperClip
_buffer = ab;
_playhead = 0;
_playing = true;
}
/// used to update the size of the buffer for this looperclip. The current
@ -99,7 +97,10 @@ class LooperClip
unsigned long recordSpaceAvailable()
{
return _buffer->getData().size() - _recordhead;
if ( _buffer )
return _buffer->getData().size() - _recordhead;
return 0;
}
size_t audioBufferSize()

View file

@ -105,7 +105,6 @@ class TrackOutput : public AudioProcessor
*sidechain++ += tmp * _toSidechain;
*postSidechain++ += tmp * _toPostSidechain;
}
}
~TrackOutput()