home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
audio
/
utils
/
med_424
/
programmers
/
examples
/
example3.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-30
|
720b
|
32 lines
/* This example uses medplayer.library. Use Lattice C V5.04 */
#include <libraries/dos.h>
#include "libproto.h"
#include <proto/exec.h>
struct Library *MEDPlayerBase;
struct MMD0 *mod;
void main(int argc,char *argv[])
{
LONG gp;
if(argc < 2) {
printf("Usage: example3 song\n");
return;
}
MEDPlayerBase = OpenLibrary("medplayer.library",0);
if(!MEDPlayerBase) {
printf("Can't open medplayer.library\n");
return;
}
gp = GetPlayer(0);
printf("Player allocation %s.\n",gp ? "failed" : "succeeded");
mod = LoadModule(argv[1]);
printf("Module address = %lx\n",mod);
PlayModule(mod);
printf("Press Ctrl-C...\n");
Wait(SIGBREAKF_CTRL_C);
FreePlayer();
UnLoadModule(mod);
CloseLibrary(MEDPlayerBase);
}