diff --git a/src/avtk/avtk_clip_selector.h b/src/avtk/avtk_clip_selector.h index 3fe5476..2048e56 100644 --- a/src/avtk/avtk_clip_selector.h +++ b/src/avtk/avtk_clip_selector.h @@ -55,13 +55,9 @@ class ClipState ClipState() { state = CLIP_EMPTY; + loaded = false; name = ""; } - ClipState(std::string n) - { - state = CLIP_EMPTY; - name = n; - } State state; bool loaded; @@ -96,7 +92,9 @@ class ClipSelector : public Fl_Button // parameter. Recording won't provide a name, or "..." or something void loadClip( int clip, std::string name = "" ) { - + clips[clip].loaded = true; + clips[clip].name = name; + clips[clip].state = ClipState::CLIP_LOADED; } // this function converts the Looper::State into the UI represnted @@ -319,7 +317,7 @@ class ClipSelector : public Fl_Button else if ( strcmp(m->label(), "Load") == 0 ) { clipSelectorLoad( ID, clipNum ); - clips[clipNum].state = ClipState::CLIP_LOADED; + loadClip( clipNum, "loaded" ); } else if ( strcmp(m->label(), "1") == 0 ) { EventLooperLoopLength e = EventLooperLoopLength(ID, 1); diff --git a/src/gclipselectoraction.hxx b/src/gclipselectoraction.hxx index f5f8e7c..4c2aba4 100644 --- a/src/gclipselectoraction.hxx +++ b/src/gclipselectoraction.hxx @@ -32,7 +32,8 @@ static string choose_file() static void clipSelectorLoad(int track, int scene) { - AudioBuffer* ab = Worker::loadSample( choose_file() ); + string filePathName = choose_file(); + AudioBuffer* ab = Worker::loadSample( filePathName ); EventLooperLoad e = EventLooperLoad( track, scene, ab ); writeToDspRingbuffer( &e ); }