Skip to content
Snippets Groups Projects
Commit c8b3826f authored by slevy's avatar slevy
Browse files

Add usage message to parti_play().

Add "wait" option -- wait until end of "play".
parent 0fd2fc42
No related branches found
No related tags found
No related merge requests found
......@@ -1077,6 +1077,7 @@ void parti_play( const char *rate ) {
struct wfpath *path = &ppui.path;
int playnow = 1;
int awaitdone = 0;
if(rate != NULL) {
char *ep;
......@@ -1086,7 +1087,17 @@ void parti_play( const char *rate ) {
else if(strchr(ep, 'k')) ppui.playloop = -1; /* rock */
else if(strchr(ep, 'f') || strchr(ep, 'e')) ppui.playevery = 1;
else if(strchr(ep, 'r') || strchr(ep, 't')) ppui.playevery = 0;
if(ep != rate) {
if(strstr(rate, "wait"))
awaitdone = 1;
if(ep == rate) {
/* No leading number -- did we get just "-" or "-?" or "-help"? */
if(0==strcmp(rate, "-") || strchr(rate, '?') || strchr(rate, 'h')) {
msg("Usage: play [rate][s][l|k][f|r][wait] e.g. \"play\" or \"play 30\" or \"play 10kf wait\"");
msg(" rate frames/sec; [s]et speed, don't play now; [l]oop/roc[k]");
msg(" play every [f]rame/skip to maintain [r]ate; [wait] until done");
return;
}
if(sp == 0) playnow = 0;
else ppui.playspeed = sp;
}
......@@ -1117,6 +1128,14 @@ void parti_play( const char *rate ) {
ppui.play->value( ppui.playing );
ppui.play->redraw();
}
if(awaitdone) {
/* Don't let this command return until the "play" is finished, or at least stopped.
* But allow user input along the way.
*/
while(ppui.playing)
Fl::wait(0.1);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment