home *** CD-ROM | disk | FTP | other *** search
- /* This example loads two songs, the first one is the load music of the
- second song. Compile with Lattice/SAS C V5.xx */
-
- #include <exec/types.h>
- #include <libraries/dos.h>
- #include <proto/exec.h>
- #include <proto/dos.h>
- #include "libproto.h"
-
- void main(argc,argv)
- int argc;
- char *argv[];
- {
- struct MMD0 *sng1,*sng2;
- register struct Library *MEDPlayerBase = OpenLibrary("medplayer.library",0);
- if(!MEDPlayerBase) return;
- printf("---example2---\n");
- if(argc < 3) {
- printf("Usage: example2 <song1> <song2>\n");
- return;
- }
- GetPlayer(0); /* If this fails, no crash. Just no music. */
- printf("Loading the first song...\n");
- sng1 = LoadModule(argv[1]);
- PlayModule(sng1); /* start the load music */
- printf("Loading the second song...\n");
- sng2 = LoadModule(argv[2]);
- printf("Press Ctrl-C to play next song.\n");
- Wait(SIGBREAKF_CTRL_C);
- DimOffPlayer(35); /* fade out the first tune */
- Delay(250); /* wait 5 seconds for fading */
- PlayModule(sng2);
- printf("Press Ctrl-C to quit.\n");
- Wait(SIGBREAKF_CTRL_C);
- UnLoadModule(sng1); /* Even if LoadModule failed, this won't crash */
- UnLoadModule(sng2);
- FreePlayer();
- CloseLibrary(MEDPlayerBase);
- printf("Bye!!!\n");
- }
-