-Added #define DEBUG options for Clip testing

This commit is contained in:
Harry van Haaren 2013-08-22 14:36:56 +01:00
parent d31cf4012f
commit 1c4142c9bf
6 changed files with 34 additions and 11 deletions

View file

@ -40,7 +40,9 @@ class AudioBuffer
void setBeats(int b)
{
#ifdef DEBUG_BUFFER
printf("AudioBuffer now has %i beats\n", b );
#endif
numBeats = b;
}

View file

@ -116,15 +116,15 @@ class ClipSelector : public Fl_Button
**/
void setState( int clipNum, GridLogic::State s )
{
#ifdef DEBUG_CLIP
cout << "setState clipNum = " << clipNum << " state = " << s << endl;
#endif
switch(s)
{
case GridLogic::STATE_RECORDING:
clips[clipNum].setName();
break;
case GridLogic::STATE_STOPPED:
//clips[clipNum].setName();
break;
case GridLogic::STATE_EMPTY:
case GridLogic::STATE_PLAYING:
case GridLogic::STATE_PLAY_QUEUED:

View file

@ -2,6 +2,19 @@
#ifndef LUPPP_CONFIG_H
#define LUPPP_CONFIG_H
/// Build options
//#define DEBUG_ALL 1
#ifdef DEBUG_ALL
#define DEBUG_CLIP 1
#define DEBUG_BUFFER 1
#endif
/// General Options
#define NTRACKS 8
#define NSCENES 10
#define MAX_BUFFER_SIZE 1024

View file

@ -10,7 +10,7 @@
class Controller
{
public:
/// registers subclass instance with ControllerUpdater.
/// registers subclass instance with ControllerUpdater
Controller();
virtual ~Controller(){};

View file

@ -158,7 +158,9 @@ void handleGuiEvents()
AudioBuffer* ab = new AudioBuffer(ev.numElements);
EventLooperClipRequestBuffer returnEvent(ev.track, ev.scene, ab);
writeToDspRingbuffer( &returnEvent );
#ifdef DEBUG_BUFFER
printf("new buffer going to track %i, scene %i\n",ev.track, ev.scene);
#endif
} break; }
case Event::DEALLOCATE_BUFFER: {
if ( availableRead >= sizeof(EventDeallocateBuffer) ) {

View file

@ -54,9 +54,10 @@ void GridLogic::pressed( int track, int scene )
{
LooperClip* lc = jack->getLooper( track )->getClip( scene );
GridLogic::State s = lc->getState();
printf("before press state = %s\n", StateString[ int(s) ] );
#ifdef DEBUG_CLIP
printf("GridLogic::pressed() before press state = %s\n", StateString[ int(s) ] );
#endif
if ( s == STATE_EMPTY )
lc->queueRecord();
@ -71,9 +72,11 @@ void GridLogic::pressed( int track, int scene )
s = lc->getState();
printf("after press state = %s\n", StateString[ int(s) ] );
#ifdef DEBUG_CLIP
printf("GridLogic::pressed() after press state = %s\n", StateString[ int(s) ] );
#endif
jack->getControllerUpdater()->setSceneState(track, scene, s );
}
@ -98,8 +101,10 @@ void GridLogic::updateState()
void GridLogic::bar()
{
#ifdef DEBUG_CLIP
EventGuiPrint e( "GridLogic::bar()\n" );
writeToGuiRingbuffer( &e );
#endif
/// iterate over all clips, if they're set to QUEUED, set to the next state
for( int i = 0; i < NTRACKS*NSCENES; i++ )
@ -107,13 +112,14 @@ void GridLogic::bar()
int track = i / NSCENES;
int scene = i - track * NSCENES;
jack->getLooper( track )->getClip( scene )->bar();
#ifdef DEBUG_CLIP
GridLogic::State s = jack->getLooper( track )->getClip( scene )->getState();
if ( s != STATE_EMPTY )
{
printf("%i, %i:after bar() state = %s\n", track, scene, StateString[ int(s) ] );
}
#endif
}
}