That would work but I think you /can/ read the song and pattern positions
directly from mikmod’s data structure. You’d have to add some code to
music.c to do it though.
Look at music.c, at line 74 (v.1.1.0, anyway):
static Mix_Music * volatile music_playing = NULL;
That’s the music data. You want music_playing->data which is a union of
pointers, one of them being UNIMOD *. (same as MODULE *)
So, I think
music_playing->data.module->patpos
and
music_playing->data.module->sngpos
are what you want.
Hm, I have a question for others, though. Should I expect to have any
difficuly modifying SDL_mixer to play multiple mp3 streams at once? It
doesn’t look that way but who knows. Has anyone done this before?
Greg V. (hmaon)
"It's today!" said Piglet.
"My favorite day," said Pooh.On Tue, 6 Mar 2001, Olivier Dagenais wrote:
What I’ve done (in the past) is this:
1 - Write a program that plays an XM and outputs (to a file) the number of
milliseconds elapsed (since the start) whenever the row (and pattern/order)
changes. (bonus points if you output this info as a two-dimensional array
that you can compile into your code)
2 - In your main application, after you start playing the music file, start
your point of reference and render based on elapsed milliseconds. (this is
where you can use your pre-generated array from step one)
I’m working on a “player” that will do this automatically and call the
appropriate functions at the appropriate times, so in the end you could use
an editor to put your demo together and the only code you’ll have to worry
about are the effects. If you’re willing to help, shoot me an e-mail.
–
Olivier A. Dagenais - Software Architect and Developer
“Tomasz M?ka” wrote in message
news:20010306220300.218f6067.tmaka at ll.pl…
hello list,
I’m newbie in SDL and I’ve one question:
Is it possible to synchronize my video fx with xm module by using
sdl_mixer ?
I can’t find any functions in SDL_mixer.h for reading song and pattern
position actually playing xm… (btw, it’s very important function to me).
thanks,
tomasz.