diff --git a/src/audiobuffer.hxx b/src/audiobuffer.hxx index ef29f71..3023e7e 100644 --- a/src/audiobuffer.hxx +++ b/src/audiobuffer.hxx @@ -40,7 +40,9 @@ class AudioBuffer void setBeats(int b) { +#ifdef DEBUG_BUFFER printf("AudioBuffer now has %i beats\n", b ); +#endif numBeats = b; } diff --git a/src/avtk/avtk_clip_selector.h b/src/avtk/avtk_clip_selector.h index 64986c8..e230060 100644 --- a/src/avtk/avtk_clip_selector.h +++ b/src/avtk/avtk_clip_selector.h @@ -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: diff --git a/src/config.hxx b/src/config.hxx index 4343f77..1692989 100644 --- a/src/config.hxx +++ b/src/config.hxx @@ -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 diff --git a/src/controller/controller.hxx b/src/controller/controller.hxx index a3a9863..380b054 100644 --- a/src/controller/controller.hxx +++ b/src/controller/controller.hxx @@ -10,7 +10,7 @@ class Controller { public: - /// registers subclass instance with ControllerUpdater. + /// registers subclass instance with ControllerUpdater Controller(); virtual ~Controller(){}; diff --git a/src/eventhandlergui.cxx b/src/eventhandlergui.cxx index 30b541e..0f56c16 100644 --- a/src/eventhandlergui.cxx +++ b/src/eventhandlergui.cxx @@ -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) ) { diff --git a/src/gridlogic.cxx b/src/gridlogic.cxx index f04c057..05a71de 100644 --- a/src/gridlogic.cxx +++ b/src/gridlogic.cxx @@ -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 } }