www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/03/08:02:17

From: "Geoff Thornburrow" <gst1 AT waikato DOT ac DOT nz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: MikMod tutorial?
Date: 3 Apr 1997 11:07:32 GMT
Organization: Wave Internet Services
Lines: 58
Message-ID: <01bc401e$a9267e40$0a00005a@bloodnok>
References: <01bc3f17$b658c580$94e437c0 AT system DOT usd DOT edu>
NNTP-Posting-Host: wh9008.wave.co.nz
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


Stefan Braunewell <wkitzler AT sunflowr DOT usd DOT edu> wrote in article
<01bc3f17$b658c580$94e437c0 AT system DOT usd DOT edu>...
> I have been looking at the MikMod library for DJGPP and could just not
> figure out how to put a _really_ simple xm-player routine in a program.
> Have I missed some kind of an explanation file for this library (I know
the
> mloader, mplayer, etc. text files) ?
> 
> I would be very thankful if somebody here could either tell me a place to
> find a tutorial or write down the source-code that I need to implement.
> 
> This is what I want to do:
> 
> - Load one specific file (I don't need any user-input, just a file that I
> specify in the code)
>   in xm-format (mod or uni would be all right too, but it shouldn't make
a
> difference anyway, should it?)
> 
> - Play it.
> 
> How do I do it?
> 
> 
> Greetings,
> 
> 
> Stefan Braunewell
> 

I had the same problem when I got MikMod for BC++ 3.1. What I did was to
get the example mod(/s3m/xm/etc..) player (I think it's called mikmod.c).

I ripped out all the code before the MP_playstart(); command and put it in
my init() function. I then took all the code after MP_playstop(); and put
it in my cleanup() function. bingo. it worked. So now my mikmod code looks
like this:

int main(void)
{
	init();
	mp_playstart();

	//blahblah - rest of program

	mp_playstop();
	cleanup();

	return 0;
}

NB: you also have to copy across the tick-handler functions and any global
variables. Just copy everything across into you own file and then take out
the irrelevant bits until it crashes :-)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019