home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / fish / audio / utils / med_424 / programmers / examples / example2.c < prev    next >
C/C++ Source or Header  |  1990-12-30  |  980b  |  35 lines

  1. /* This example loads two songs, the first one is the load music of the
  2.    second song. Compile with Lattice C V5.04 */
  3.  
  4. #include <libraries/dos.h>
  5. #include <proto/exec.h>
  6. #include <proto/dos.h>
  7. #include "modplayer.h"
  8.  
  9. void main(argc,argv)
  10. int argc;
  11. char *argv[];
  12. {
  13.     struct MMD0 *sng1,*sng2;
  14.     printf("---example2---\n");
  15.     if(argc < 3) {
  16.         printf("Usage: example2 <song1> <song2>\n");
  17.         return;
  18.     }
  19.     InitPlayer(); /* If this fails, no crash. Just no music. */
  20.     printf("Loading the first song...\n");
  21.     sng1 = LoadModule(argv[1]);
  22.     PlayModule(sng1); /* start the load music */
  23.     printf("Loading the second song...\n");
  24.     sng2 = LoadModule(argv[2]);
  25.     DimOffPlayer(35);    /* fade out the first tune */
  26.     Delay(250);        /* wait 5 seconds for fading */
  27.     PlayModule(sng2);
  28.     printf("Press Ctrl-C to quit.\n");
  29.     Wait(SIGBREAKF_CTRL_C);
  30.     RemPlayer();    /* will stop it automatically */
  31.     UnLoadModule(sng1); /* Even if LoadModule failed, this won't crash */
  32.     UnLoadModule(sng2);
  33.     printf("Bye!!!\n");
  34. }
  35.