mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Reworked clip loading in ClipSelector
This commit is contained in:
parent
864cd1637f
commit
9347dcd215
2 changed files with 7 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue