-Updated GridLogic playback code, config debug #defines

This commit is contained in:
Harry van Haaren 2013-08-22 15:00:57 +01:00
parent 8b96ff9c22
commit c439bb01e5
3 changed files with 27 additions and 18 deletions

View file

@ -2,23 +2,19 @@
#ifndef LUPPP_CONFIG_H
#define LUPPP_CONFIG_H
/// Build options
//#define DEBUG_ALL 1
#ifdef DEBUG_ALL
/// DEBUG OPTIONS
// Clip selection / queueing
#define DEBUG_CLIP 1
// Buffer loading / resizing
#define DEBUG_BUFFER 1
#endif
/// General Options
#define NTRACKS 8
#define NSCENES 10
#define MAX_BUFFER_SIZE 1024
// nsamples remaining during recording before Looper requests larger buffer
#define LOOPER_SAMPLES_BEFORE_REQUEST 44100
#endif // LUPPP_CONFIG_H

View file

@ -30,28 +30,38 @@ void GridLogic::launchScene( int scene )
{
for(unsigned int t = 0; t < NTRACKS; t++ )
{
for(unsigned int s = 0; s < NSCENES; s++ )
for(int s = 0; s < NSCENES; s++ )
{
LooperClip* lc = jack->getLooper( t )->getClip( s );
if ( s == scene )
{
lc->queuePlay();
//else
//lc->queueStop();
jack->getControllerUpdater()->setSceneState( t, s, lc->getState() );
}
else
{
bool current = lc->playing();
lc->queueStop();
bool next = lc->playing();
if ( current != next )
{
jack->getControllerUpdater()->setSceneState( t, s, lc->getState() );
}
}
}
}
/*
for(unsigned int s = 0; s < NSCENES; s++ )
{
jack->getControllerUpdater()->setSceneState( -1, s, s );
}
*/
}
void GridLogic::pressed( int track, int scene )
{
// get the clip, do the "press" action based on current state.
LooperClip* lc = jack->getLooper( track )->getClip( scene );
GridLogic::State s = lc->getState();
@ -70,13 +80,10 @@ void GridLogic::pressed( int track, int scene )
if ( s == STATE_RECORDING )
lc->queueStop();
s = lc->getState();
#ifdef DEBUG_CLIP
printf("GridLogic::pressed() after press state = %s\n", StateString[ int(s) ] );
#endif
jack->getControllerUpdater()->setSceneState(track, scene, s );
}

View file

@ -142,7 +142,7 @@ void LooperClip::bar()
_playhead = 0;
}
else if ( _queueStop )
else if ( _queueStop && _loaded )
{
_playing = false;
s = GridLogic::STATE_STOPPED;
@ -162,6 +162,12 @@ void LooperClip::bar()
_recordhead = 0;
}
else if ( _queuePlay )
{
// clip was queued, but there's nothing loaded
_queuePlay = false;
change = true;
}
if ( _recording )
{