View previous topic - View next topic |
Author |
Message |
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Fri Jul 17, 2009 6:28 pm Post subject: SDL_mixer and libmodplug...how to make them get along? |
[quote] |
|
I've looked all over for this and have no idea how it can be done. It is said that SDL_mixer should be able to use libmodplug instead of the ultracrap libmikmod but it's not written in the docs on how to do it, nor can I find anything on google that helps. Anyone know how this can be done? I sincerely hope it doesn't rely on Mix_HookMusic... _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Fri Jul 17, 2009 8:09 pm Post subject: |
[quote] |
|
From what I was able to gather, I think that you will need to implement a custom player using the functions that the libmodplug library provides.
libmodplug only outputs the audio data to a memory buffer, not an audio device, so using SDL_audio to implement a player for SDL_mixer using libmodplug.
I don't have time to delve farther into it than that at this time.
Any particular reason that libmikmod will not suffice?
What about using DUMB? _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Fri Jul 17, 2009 8:19 pm Post subject: |
[quote] |
|
libmikmod tends to sound like crap, and DUMB has to be continuously called. I suppose I could always tweak the modules to work with libmikmod, but naturally, I'd rather just use libmodplug. :)
On another note...SDL_mixer has a great function called Mix_FadeInMusicPos. This is perfect for the project I'm on right now...it fades in a piece of music at a specified point of time (or, in the case of a MOD, at a pattern number). Only one problem...I don't see anything about getting the current position of a piece of music so it can be fade-resumed later. That lack of a function makes it useless for my project...I guess I would have to look into SDL_mixer's source code to find where it keeps this info.
EDIT: libmikmod has a variable called sngpos that appears to hold the pattern number currently playing. I'm not quite sure how to reference it though. _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Fri Jul 17, 2009 9:24 pm Post subject: |
[quote] |
|
in music.c from SDL_mixer source I found this that might point you in the right direction..
Code: |
/* Local low-level functions prototypes */
static void music_internal_initialize_volume(void);
static void music_internal_volume(int volume);
static int music_internal_play(Mix_Music *music, double position);
static int music_internal_position(double position);
static int music_internal_playing();
static void music_internal_halt(void);
|
Head over here _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Fri Jul 17, 2009 11:29 pm Post subject: |
[quote] |
|
Unfortunately, I would have to recompile SDL_mixer to utilize libmikmod's sngpos. Oh well, fsckit...I can just use a different technique. Thanks for looking that all up though. As for libmodplug...it doesn't support the function, so I will skip trying to figure it out. Next stop: figuring out GRX. :( _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Sat Jul 18, 2009 1:01 am Post subject: |
[quote] |
|
Nodtveidt wrote: | Unfortunately, I would have to recompile SDL_mixer to utilize libmikmod's sngpos. Oh well, fsckit...I can just use a different technique. Thanks for looking that all up though. As for libmodplug...it doesn't support the function, so I will skip trying to figure it out. Next stop: figuring out GRX. :( |
GRX as in the graphics library?
..why? _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Sat Jul 18, 2009 1:15 am Post subject: |
[quote] |
|
Because it's one of the only ones suited to regular C. Most graphics libraries are for C++. I suppose I could always just use opengl for 2D...haven't looked into it seriously just yet. _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Sat Jul 18, 2009 1:43 am Post subject: |
[quote] |
|
Nodtveidt wrote: | Because it's one of the only ones suited to regular C. Most graphics libraries are for C++. I suppose I could always just use opengl for 2D...haven't looked into it seriously just yet. |
Ahh.
What exactly are your requirements?
What platform, specs, etc? _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Sat Jul 18, 2009 2:20 am Post subject: |
[quote] |
|
My only requirement is a decent 2D graphics library that can be used with straight C. I had considered SVGAlib originally, but it requires root access to start up and it's rather flaky. So, I considered GRX, since it also has a DOS version...just in case I wanted this thing ported to DJGPP (what are the odds, really...). SDL doesn't seem to be glued to C++, and of course, opengl is always an option. I could just use X directly but I'd rather not. :) GRX seemed a viable option since it wraps SDL, and I'm already using the SDL sound libraries. But maybe it would be better to just use SDL directly. I am no fan of Allegro and its mess under the hood...
My development system is an Acer Aspire 3680, which is based on a Celeron 1.8 with 512MB RAM. The system is FreeBSD 7.2 STABLE with the latest xorg port, running KDE 3.5 (since KDE4 is unstable, bloated, and slow as a constipated shit). _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Sat Jul 18, 2009 3:56 am Post subject: |
[quote] |
|
Nodtveidt wrote: | My only requirement is a decent 2D graphics library that can be used with straight C. I had considered SVGAlib originally, but it requires root access to start up and it's rather flaky. So, I considered GRX, since it also has a DOS version...just in case I wanted this thing ported to DJGPP (what are the odds, really...). SDL doesn't seem to be glued to C++, and of course, opengl is always an option. I could just use X directly but I'd rather not. :) GRX seemed a viable option since it wraps SDL, and I'm already using the SDL sound libraries. But maybe it would be better to just use SDL directly. I am no fan of Allegro and its mess under the hood...
My development system is an Acer Aspire 3680, which is based on a Celeron 1.8 with 512MB RAM. The system is FreeBSD 7.2 STABLE with the latest xorg port, running KDE 3.5 (since KDE4 is unstable, bloated, and slow as a constipated shit). |
Avoid SVGAlib like the plague.
I cannot think of anyone besides maybe someone who has been under a rock and stuck in a closet for the past 10 years that would have a need for any DJGPP-compatible code.
No one uses it. Don't limit yourself to obsolete libraries by supporting platforms that are far outdated. (Well...that excludes if you are doing retro console kind of stuff of course)
Personally I would recommend using SDL, and if you need some kind of wrapper, either write it, or tell me what you need and I'll write it, in exchange for the rights to use it as I see fit. :)
Let me know what you want to do. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
RedSlash Mage
Joined: 12 May 2005 Posts: 331
|
Posted: Sat Jul 18, 2009 3:22 pm Post subject: |
[quote] |
|
SDL_Mixer is a high level sound library with format support built-in. If you need to work with direct buffers, you're looking at using SDL_Audio directly.
|
|
Back to top |
|
|
Nodtveidt Demon Hunter
Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Fri Jul 24, 2009 8:07 pm Post subject: |
[quote] |
|
RedSlash, to that, I am very well aware. That wasn't the question posed here. On the SDL_Mixer homepage itself, it states that it can use libmodplug as well as libmikmod. However, the documentation is mum as to the process.
Rich, I'll let you know what's up. _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
|
Back to top |
|
|