home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 3 / FreeSoftwareCollection3pd199x-jp.img / pao / ms_dos / cdplay / src / cdp.c < prev    next >
Text File  |  1980-01-02  |  2KB  |  76 lines

  1. /** << MSC V5.1 >> ************************************************************
  2. **
  3. **    簡易CD演奏プログラム
  4. **
  5. **    ----- HISTORY -----
  6. **    1990.02.22 : CREATE
  7. **    1990.05.12 : リピート回数のバグ修正。==> CDR.C
  8. **    1990.07.03 : CDドライブのデバイスが登録されていない時のメッセージ追加。
  9. **                 ==> CDPLAY.C
  10. **
  11. **    Programed by Y.Hirata ( Nifty ID : NAB03321 )
  12. **
  13. ******************************************************************************/
  14. #include    <stdio.h>
  15. #include    <stdlib.h>
  16. #include    "cdr.h"
  17. #include    <dos.h>
  18.  
  19. extern CDplay() ;
  20.  
  21. void main( int ac, char *av[] )
  22. {
  23.     int        st, end, rep ;
  24.     char    key ;
  25.     
  26.     printf("簡易CD演奏プログラム (C)パオパオ 1990.    ") ;
  27.     printf("<< Copyright (C) Y.Hirata 1990. >>\n") ;
  28.     printf("\nCD-PLAY  Version 1.11\n") ;
  29.  
  30.     if ( ac>1 ) {
  31.         st = atoi( av[1] ) ;
  32.         if ( ac>2 ) {
  33.             end = atoi( av[2] ) ;
  34.             if ( ac>3 )
  35.                 rep = atoi( av[3] ) ;
  36.             else
  37.                 rep = 1 ;
  38.         } else {
  39.             end = 99 ;
  40.             rep = 1 ;
  41.         }
  42.     } else {
  43.         st = 1 ; 
  44.         end = 99 ;
  45.         rep = 1 ;
  46.     }
  47.  
  48.     if ( st > end )
  49.         printf("\x1b[31mParameter error !!!\x1b[m\n") ;
  50.     else {
  51.         if ( st < 0 ) {
  52.             printf("\x1b[36mCD演奏をSTOPします。\x1b[m\n") ;
  53.             CDR_mstop( 0 ) ;
  54.             goto close ;
  55.         }
  56.         if ( st < 1 || end > 99 )
  57.             printf("\x1b[33mWarning!! : PLAY No.( 1 ~ 99 )\x1b[m\n") ;
  58.         if ( rep < 1 ) {
  59.             printf("\x1b[33mWarning!! : ") ;
  60.             printf("( REPEAT = 1 ~ 255 ) : Set repeat = 1") ;
  61.             printf("\x1b[m\n") ;
  62.             rep = 1 ;
  63.         }
  64.         if ( rep > 255 ) {
  65.             printf("\x1b[33mWarning!! : ") ;
  66.             printf("( REPEAT = 1 ~ 255 ) : Set repeat = 255") ;
  67.             printf("\x1b[m\n") ;
  68.             rep = 255 ;
  69.         }
  70.         CDplay( 1,st,end,(unsigned char)rep ) ;
  71.     }
  72.  
  73. close: ;
  74.  
  75. }
  76.