The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Mix_PlayMusic doesn't loop for mod files?
Mason Wheeler
Guest

OK, this is driving me nuts. I built SDL_Mixer against mikmod and played a .IT
file in it. At the end of the file is a B05 opcode, which means "loop music
beginning from Sequence pattern 05". It ignored this and looped back to the
start of the file. I figured it might be a glitch in mikmod, so I built
SDL_Mixer against libmodplug instead, but I got the same result. Looping to the
start of the song instead of the designated pattern.

They can't both be broken. This file was created in ModPlug, so it should play
right from libmodplug at least. So I have to wonder, is there something in
SDL_Mixer that's somehow interfering with looping for mod music? If so, how do
I disable it? Looping is the main reason I'm using mod format; if you're
writing a game it's *essential* to have looping working right.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Mix_PlayMusic doesn't loop for mod files?
Mike Shal
Guest

On Sun, Apr 10, 2011 at 4:41 PM, Mason Wheeler wrote:
Quote:
OK, this is driving me nuts. I built SDL_Mixer against mikmod and played a .IT
file in it.  At the end of the file is a B05 opcode, which means "loop music
beginning from Sequence pattern 05".  It ignored this and looped back to the
start of the file.  I figured it might be a glitch in mikmod, so I built
SDL_Mixer against libmodplug instead, but I got the same result.  Looping to the
start of the song instead of the designated pattern.

They can't both be broken.  This file was created in ModPlug, so it should play
right from libmodplug at least.  So I have to wonder, is there something in
SDL_Mixer that's somehow interfering with looping for mod music?  If so, how do
I disable it?  Looping is the main reason I'm using mod format; if you're
writing a game it's *essential* to have looping working right.

With MikMod you can try modifying the underlying MODULE structure:

#include <mikmod.h>
...
MODULE *mod;
...
Mix_PlayMusic(music, 0); /* Disable SDL looping */
mod = Player_GetModule();
mod->loop = 1;

(I don't know much about ModPlug - you might be able to do something
similar there). Basically you'd be skipping SDL_Mixer's looping (since
it doesn't really know/care about internal MOD looping details), and
use MikMod's looping directly (which does know/care).

-Mike
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org