-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) void setBeats(int b)
{ {
#ifdef DEBUG_BUFFER
printf("AudioBuffer now has %i beats\n", b ); printf("AudioBuffer now has %i beats\n", b );
#endif
numBeats = b; numBeats = b;
} }

View file

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

View file

@ -2,6 +2,19 @@
#ifndef LUPPP_CONFIG_H #ifndef LUPPP_CONFIG_H
#define 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 NTRACKS 8
#define NSCENES 10 #define NSCENES 10
#define MAX_BUFFER_SIZE 1024 #define MAX_BUFFER_SIZE 1024

View file

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

View file

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

View file

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