The reason that it's not there is because in reality, it doesn't exist. The underlying library has no global volume control for the song. I've fixed this by letting bmod_set_volume(vol) change the volume of all channels individually. However the individual channel volumes can be set to different values, both in the module itself as in GM Bassmod, which means there cannot be one, single, global volume. I could take a mean value for it, but it wouldn't reflect the real volume of the module, especially not when you adjust the volume using that value. So instead, I added functions to set the volume by a delta value - the best way to reach fade-in and fade-out effects.
I really don't understand why there isn't an fmod_get_volume() parameter. I mean, you even have fmod_get_channelvolume() which I would imagine is harder to do.
And it's actually bmod_, not fmod_. FMOD has nothing to do with it.
I wonder what you mean by 'more robust'. I focused on module playback, but there are other differences - for example, for commercial projects this library is half the cost of full BASS implementations. And as far as I know no other module playback library can do this.
Overall, very good work though. GM BASS has more robust functions, but this works perfectly with saved files unlike GM BASS.
Oh my bad, I got those confused. By more robust, I mean that GM BASS has more functions that you don't have to code in yourself. For example, to fade, you can just call the fade function and it fades it automatically. Unless there is something I'm not getting, with bmod you have to manually fade the volume yourself by changing deltavolume every step or something, correct? GM BASS can also do what you showed in the link, although I have to admit that it would be much more difficult since yours is more precise.
And also, there is something I would like you to help me with. Everytime I restart the game, it freezes. What's going on? I'm using GM7, so I know I don't have to call bmod_close before restarting. Here's what happens:
I start the game
The game executes bmod_init() on startup
Adds a file and stores its index to global.gamesong
Plays the song at the title screen
When you press start, it stops the current music, goes to level one, where the game switches music and plays the new file.
Now, here's the problem. Since the game has all persistent rooms, I have to restart the game.
When you press Escape or you die, I have it so the game goes to a restart room, where it stops the music and restarts the game. But the game does not restart. It just freezes. It's still responding, and my computer is not lagging up. It just freezes. I can change resolutions and show the game information, but that's it. I know it's bmod that's doing it because when I take out bmod it runs fine.
What am I doing wrong here? Do I have to call bmod_close() or bmod_delete() or something?EDIT
: I just ran a little test and I think there might be a bug somewhere, because the exact same thing happens. I made a blank game, and added an object that plays music when you press a button, and restarts the game when you press another button. When you restart the game exactly
eight times, the game just freezes and won't restart.
Here's the test. Download test.gmk
You'll have to find an .it file and replace the one includedEDIT2
: After a lot of testing, I can pretty much say that either my computer is the problem, which I highly doubt (it runs Crysis), or your extension has a very serious bug that makes it pretty much unusable for games that require a game restart.
Edited by ultim8p00, 24 December 2008 - 08:00 PM.