mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Clip loading shown properly in UI
This commit is contained in:
parent
5f64f7d914
commit
11851a78f5
2 changed files with 15 additions and 6 deletions
|
@ -114,13 +114,16 @@ class ClipSelector : public Fl_Button
|
|||
**/
|
||||
void setState( int clipNum, GridLogic::State s )
|
||||
{
|
||||
cout << "setState clipNum = " << clipNum << " state = " << s << endl;
|
||||
switch(s)
|
||||
{
|
||||
case GridLogic::STATE_RECORDING:
|
||||
clips[clipNum].setName();
|
||||
break;
|
||||
case GridLogic::STATE_EMPTY:
|
||||
case GridLogic::STATE_STOPPED:
|
||||
clips[clipNum].setName();
|
||||
break;
|
||||
case GridLogic::STATE_EMPTY:
|
||||
case GridLogic::STATE_PLAYING:
|
||||
case GridLogic::STATE_PLAY_QUEUED:
|
||||
case GridLogic::STATE_RECORD_QUEUED:
|
||||
|
@ -286,7 +289,7 @@ class ClipSelector : public Fl_Button
|
|||
{
|
||||
{ "Load" },
|
||||
{ "Bars", 0, 0, 0, FL_SUBMENU },
|
||||
{"1"},
|
||||
{"1 "},
|
||||
{"2"},
|
||||
{"4"},
|
||||
{"8"},
|
||||
|
@ -305,8 +308,12 @@ class ClipSelector : public Fl_Button
|
|||
}
|
||||
else if ( strcmp(m->label(), "Load") == 0 )
|
||||
{
|
||||
clipSelectorLoad( ID, clipNum );
|
||||
//loadClip( clipNum, "---" );
|
||||
int loadFail = clipSelectorLoad( ID, clipNum );
|
||||
if ( !loadFail )
|
||||
{
|
||||
clips[clipNum].setName();
|
||||
clips[clipNum].setState(GridLogic::STATE_STOPPED);
|
||||
}
|
||||
}
|
||||
else if ( strcmp(m->label(), "1") == 0 ) {
|
||||
EventLooperLoopLength e = EventLooperLoopLength(ID, clipNum ,1);
|
||||
|
|
|
@ -30,16 +30,18 @@ static string choose_file()
|
|||
return path;
|
||||
}
|
||||
|
||||
static void clipSelectorLoad(int track, int scene)
|
||||
static int clipSelectorLoad(int track, int scene)
|
||||
{
|
||||
string filePathName = choose_file();
|
||||
|
||||
if ( strcmp( filePathName.c_str(), "" ) == 0 )
|
||||
return;
|
||||
return -1;
|
||||
|
||||
AudioBuffer* ab = Worker::loadSample( filePathName );
|
||||
EventLooperLoad e = EventLooperLoad( track, scene, ab );
|
||||
writeToDspRingbuffer( &e );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // LUPPP_G_CLIP_SELECTOR_ACTION_H
|
||||
|
|
Loading…
Add table
Reference in a new issue