|
Lines 176-181
Link Here
|
| 176 |
iVerbose = TRUE; |
176 |
iVerbose = TRUE; |
| 177 |
error = 1; |
177 |
error = 1; |
| 178 |
if (( strcmp(progname, "cdshuffle") == 0 ) || |
178 |
if (( strcmp(progname, "cdshuffle") == 0 ) || |
|
|
179 |
( strcmp(progname, "cdvolume") == 0 ) || |
| 179 |
( strcmp(progname, "cdplay") == 0 ) || |
180 |
( strcmp(progname, "cdplay") == 0 ) || |
| 180 |
( strcmp(progname, "cdstart") == 0 )) { |
181 |
( strcmp(progname, "cdstart") == 0 )) { |
| 181 |
error = 0; |
182 |
error = 0; |
|
Lines 235-241
Link Here
|
| 235 |
exit(0); |
236 |
exit(0); |
| 236 |
} |
237 |
} |
| 237 |
|
238 |
|
| 238 |
if ( (cdfile=open(cd_device, O_RDONLY)) == -1 ) |
239 |
if ( (cdfile=open(cd_device, O_RDONLY | O_NONBLOCK)) == -1 ) |
| 239 |
{ |
240 |
{ |
| 240 |
cdhw_t hw; |
241 |
cdhw_t hw; |
| 241 |
int iResult; |
242 |
int iResult; |
|
Lines 359-364
Link Here
|
| 359 |
do_shuffle(progname, cdfile, iCDNum, iTracks, |
360 |
do_shuffle(progname, cdfile, iCDNum, iTracks, |
| 360 |
iRepeat, iVerbose, cd_device, DOLF); |
361 |
iRepeat, iVerbose, cd_device, DOLF); |
| 361 |
} |
362 |
} |
|
|
363 |
if (strcmp(argv[optind],"volume") == 0) { |
| 364 |
if(++optind < argc) { |
| 365 |
int vol=atoi(argv[optind]); |
| 366 |
#ifdef DEBUG |
| 367 |
fprintf (stderr,"main: called as \"%s\", volume\n", |
| 368 |
progname); |
| 369 |
#endif |
| 370 |
exit( do_volume(progname, cdfile, vol, iVerbose) ); |
| 371 |
} |
| 372 |
} |
| 362 |
|
373 |
|
| 363 |
/* block to play a CD if it is an audio cd */ |
374 |
/* block to play a CD if it is an audio cd */ |
| 364 |
{ |
375 |
{ |
|
Lines 388-393
Link Here
|
| 388 |
} |
399 |
} |
| 389 |
else if ( strcmp(progname, "cdir") == 0 ) |
400 |
else if ( strcmp(progname, "cdir") == 0 ) |
| 390 |
do_dir(progname, cdfile, p_format, usedb, cd_device, DOLF); |
401 |
do_dir(progname, cdfile, p_format, usedb, cd_device, DOLF); |
|
|
402 |
else if ( strcmp(progname, "cdvolume") == 0 ) { |
| 403 |
if ( optind < argc ) { |
| 404 |
int vol=atoi(argv[optind]); |
| 405 |
exit( do_volume(progname, cdfile, vol, iVerbose) ); |
| 406 |
} |
| 407 |
else |
| 408 |
do_usage(progname); |
| 409 |
} |
| 391 |
else do_usage(progname); |
410 |
else do_usage(progname); |
| 392 |
|
411 |
|
| 393 |
close(cdfile); |
412 |
close(cdfile); |
|
Lines 445-450
Link Here
|
| 445 |
fprintf(stderr, "usage: cdstop [options]\n"); |
464 |
fprintf(stderr, "usage: cdstop [options]\n"); |
| 446 |
else if ( strcmp(progname, "cdeject") == 0 ) |
465 |
else if ( strcmp(progname, "cdeject") == 0 ) |
| 447 |
fprintf(stderr, "usage: cdeject [options]\n"); |
466 |
fprintf(stderr, "usage: cdeject [options]\n"); |
|
|
467 |
else if ( strcmp(progname, "cdvolume") == 0 ) |
| 468 |
fprintf(stderr, "usage: cdvolume [0-255]\n"); |
| 448 |
else if ( strcmp(progname, "cdpause") == 0 ) |
469 |
else if ( strcmp(progname, "cdpause") == 0 ) |
| 449 |
{ |
470 |
{ |
| 450 |
fprintf(stderr, "usage: cdpause [options]\n"); |
471 |
fprintf(stderr, "usage: cdpause [options]\n"); |
|
Lines 469-475
Link Here
|
| 469 |
} |
490 |
} |
| 470 |
else |
491 |
else |
| 471 |
fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, \n\ |
492 |
fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, \n\ |
| 472 |
cdpause, cdir, cdinfo, or cdshuffle\n"); |
493 |
cdvolume, cdpause, cdir, cdinfo, or cdshuffle\n"); |
| 473 |
|
494 |
|
| 474 |
/* standard options below here: */ |
495 |
/* standard options below here: */ |
| 475 |
fprintf(stderr, " -V build, version, and this help\n"); |
496 |
fprintf(stderr, " -V build, version, and this help\n"); |