Browse Source

Tidied up, fixed arg parsing and reduced shed_fifo priority to 10

master
nebogeo 22 years ago
parent
commit
3bcf4560a2
1 changed files with 15 additions and 20 deletions
  1. +15
    -20
      main.cpp

+ 15
- 20
main.cpp View File

@@ -35,22 +35,18 @@ int pthread_create_realtime (pthread_t *new_thread,
void *(*start)(void *), void *arg,
int priority);

char flashy[] = {'|','/','-','\\'};

void audioloop(void* o)
{
int counter=0,flashy_counter=0;
while(1)
{
synth->Update();
if (counter==10000)
if (!synth->CallbackMode())
{
synth->Update();
}
else
{
cerr<<"\b"<<flashy[flashy_counter%4];
counter=0;
flashy_counter++;
usleep(1000000);
}
counter++;
}
}

@@ -69,13 +65,15 @@ int main(int argc, char **argv)
// parse the args
if (argc>1)
{
cmd_filename = argv[1];
cmd_specd = true;
for (int a=2; a<argc; a++)
for (int a=1; a<argc; a++)
{
if (!strcmp(argv[a],"--NoGUI")) GUI = false;
if (!strcmp(argv[a],"--SHED_FIFO")) FIFO = true;
else if (!strcmp(argv[a],"--SHED_FIFO")) FIFO = true;
else
{
cmd_filename = argv[1];
cmd_specd = true;
}
}
}
@@ -95,7 +93,7 @@ int main(int argc, char **argv)
// spawn the audio thread
int ret;
if (FIFO) ret=pthread_create_realtime(&loopthread,(void*(*)(void*))audioloop,NULL,50);
if (FIFO) ret=pthread_create_realtime(&loopthread,(void*(*)(void*))audioloop,NULL,10);
else ret=pthread_create(&loopthread,NULL,(void*(*)(void*))audioloop,NULL);

// do we need to load a patch on startup?
@@ -110,11 +108,8 @@ int main(int argc, char **argv)
for (;;)
{
if (!Fl::check()) break;
//if (!synth->CallbackMode()) synth->Update();
if (!Fl::check()) break;
synth->UpdatePluginGUIs(); // deletes any if necc
//else Fl::wait();
usleep(10000);
}


Loading…
Cancel
Save