-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 #ifndef LUPPP_CONFIG_H
#define LUPPP_CONFIG_H #define LUPPP_CONFIG_H
/// Build options /// DEBUG OPTIONS
//#define DEBUG_ALL 1 // Clip selection / queueing
#ifdef DEBUG_ALL
#define DEBUG_CLIP 1 #define DEBUG_CLIP 1
// Buffer loading / resizing
#define DEBUG_BUFFER 1 #define DEBUG_BUFFER 1
#endif
/// General Options /// General Options
#define NTRACKS 8 #define NTRACKS 8
#define NSCENES 10 #define NSCENES 10
#define MAX_BUFFER_SIZE 1024 #define MAX_BUFFER_SIZE 1024
// nsamples remaining during recording before Looper requests larger buffer
#define LOOPER_SAMPLES_BEFORE_REQUEST 44100 #define LOOPER_SAMPLES_BEFORE_REQUEST 44100
#endif // LUPPP_CONFIG_H #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 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 ); LooperClip* lc = jack->getLooper( t )->getClip( s );
if ( s == scene ) if ( s == scene )
{
lc->queuePlay(); lc->queuePlay();
//else jack->getControllerUpdater()->setSceneState( t, s, lc->getState() );
//lc->queueStop(); }
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++ ) for(unsigned int s = 0; s < NSCENES; s++ )
{ {
jack->getControllerUpdater()->setSceneState( -1, s, s );
} }
*/ */
} }
void GridLogic::pressed( int track, int scene ) 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 ); LooperClip* lc = jack->getLooper( track )->getClip( scene );
GridLogic::State s = lc->getState(); GridLogic::State s = lc->getState();
@ -70,13 +80,10 @@ void GridLogic::pressed( int track, int scene )
if ( s == STATE_RECORDING ) if ( s == STATE_RECORDING )
lc->queueStop(); lc->queueStop();
s = lc->getState(); s = lc->getState();
#ifdef DEBUG_CLIP #ifdef DEBUG_CLIP
printf("GridLogic::pressed() after press state = %s\n", StateString[ int(s) ] ); printf("GridLogic::pressed() after press state = %s\n", StateString[ int(s) ] );
#endif #endif
jack->getControllerUpdater()->setSceneState(track, scene, s ); jack->getControllerUpdater()->setSceneState(track, scene, s );
} }

View file

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