From 1f806b8cac56e209d34df55d5e9e9b39e48afa3b Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Fri, 26 Jul 2013 01:45:40 +0100 Subject: [PATCH] -Sample loading now working per track: not yet per scene --- src/avtk/avtk_clip_selector.h | 31 +++++++++++++++++++------------ src/gtrack.hxx | 2 ++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/avtk/avtk_clip_selector.h b/src/avtk/avtk_clip_selector.h index 260fdca..ccd8e37 100644 --- a/src/avtk/avtk_clip_selector.h +++ b/src/avtk/avtk_clip_selector.h @@ -86,6 +86,11 @@ class ClipSelector : public Fl_Button mouseOver = false; } + void setID( int id ) + { + ID = id; + } + void setState( int clipNum, Looper::State s ) { switch(s) @@ -117,6 +122,8 @@ class ClipSelector : public Fl_Button redraw(); } + int ID; + static const int numClips = 10; ClipState clips[numClips]; @@ -299,32 +306,32 @@ class ClipSelector : public Fl_Button } else if ( strcmp(m->label(), "Load") == 0 ) { - clipSelectorLoad( 0 ); + clipSelectorLoad( ID ); clips[clipNum].state = ClipState::CLIP_LOADED; } else if ( strcmp(m->label(), "1") == 0 ) { - EventLooperLoopLength e = EventLooperLoopLength(0, 1); + EventLooperLoopLength e = EventLooperLoopLength(ID, 1); writeToDspRingbuffer( &e ); } else if ( strcmp(m->label(), "2") == 0 ) { - EventLooperLoopLength e = EventLooperLoopLength(0, 2); + EventLooperLoopLength e = EventLooperLoopLength(ID, 2); writeToDspRingbuffer( &e ); } else if ( strcmp(m->label(), "4") == 0 ) { - EventLooperLoopLength e = EventLooperLoopLength(0, 4); + EventLooperLoopLength e = EventLooperLoopLength(ID, 4); writeToDspRingbuffer( &e ); } else if ( strcmp(m->label(), "8") == 0 ) { - EventLooperLoopLength e = EventLooperLoopLength(0, 8); + EventLooperLoopLength e = EventLooperLoopLength(ID, 8); writeToDspRingbuffer( &e ); } else if ( strcmp(m->label(), "16") == 0 ) { - EventLooperLoopLength e = EventLooperLoopLength(0, 16); + EventLooperLoopLength e = EventLooperLoopLength(ID, 16); writeToDspRingbuffer( &e ); } else if ( strcmp(m->label(), "32") == 0 ) { - EventLooperLoopLength e = EventLooperLoopLength(0, 32); + EventLooperLoopLength e = EventLooperLoopLength(ID, 32); writeToDspRingbuffer( &e ); } else if ( strcmp(m->label(), "Record") == 0 ) { clips[clipNum].state = ClipState::CLIP_RECORDING; - EventLooperState e = EventLooperState( 0, 0, Looper::STATE_RECORD_QUEUED); + EventLooperState e = EventLooperState( ID, 0, Looper::STATE_RECORD_QUEUED); writeToDspRingbuffer( &e ); } } @@ -335,13 +342,13 @@ class ClipSelector : public Fl_Button case ClipState::CLIP_EMPTY: clips[clipNum].state = ClipState::CLIP_RECORDING; { - EventLooperState e = EventLooperState( 0, 0, Looper::STATE_RECORD_QUEUED); + EventLooperState e = EventLooperState( ID, 0, Looper::STATE_RECORD_QUEUED); writeToDspRingbuffer( &e ); } break; case ClipState::CLIP_LOADED: { - EventLooperState e = EventLooperState( 0, 0, Looper::STATE_PLAY_QUEUED); + EventLooperState e = EventLooperState( ID, 0, Looper::STATE_PLAY_QUEUED); writeToDspRingbuffer( &e ); clips[clipNum].state = ClipState::CLIP_QUEUED; } @@ -351,14 +358,14 @@ class ClipSelector : public Fl_Button break; case ClipState::CLIP_PLAYING: { - EventLooperState e = EventLooperState( 0, 0, Looper::STATE_STOP_QUEUED); + EventLooperState e = EventLooperState( ID, 0, Looper::STATE_STOP_QUEUED); writeToDspRingbuffer( &e ); clips[clipNum].state = ClipState::CLIP_QUEUED; } break; case ClipState::CLIP_RECORDING: { clips[clipNum].state = ClipState::CLIP_QUEUED; - EventLooperState e = EventLooperState( 0, 0, Looper::STATE_STOP_QUEUED); + EventLooperState e = EventLooperState( ID, 0, Looper::STATE_STOP_QUEUED); writeToDspRingbuffer( &e ); } break; case ClipState::CLIP_STOPPING: diff --git a/src/gtrack.hxx b/src/gtrack.hxx index a61d3f0..d918e20 100644 --- a/src/gtrack.hxx +++ b/src/gtrack.hxx @@ -53,6 +53,8 @@ class GTrack : public Fl_Group { ID = privateID++; + clipSel.setID( ID ); + volume.callback( gtrack_button_callback, 0 ); progress.maximum(1.0f);