i'm about to start a PocketFrog article on Hekkus and wondered if you could give me any advice / examples of using the features of Hekkus (beyond the play this tune, play this sound level) including any insights into less obvious functionality. I am able to cover all the basic getting it going & loading & playing sound effects and tunes.
"If you want you can start the mod files at a specific position, the position is based on notes, .MOD internally are divided into patterns and every pattern have 64 notes. So if you want to start your mod at pattern 0x2 (the first pattern is numbered 0, like C arrays) you have to pass this value: 2*64."
Some code:
- Code:
m_music.load(...);
// play our mod paused and get the channel that will play it
int idx = m_sound.playMusic(&m;_music, HSS_PLAY_PAUSED);
// get the channel object
hssChannel *channel = m_sound.channel(idx);
if (channel) {
// set the position
channel->position(2*64); // start MOD at pattern 0x2
// resume our channel so it starts to play
channel->resume();
}
This code works perfectly and did exactly what I needed. Also, channel->length() will retrieve the song length in notes. This functionality of Hekkus is not well documented (at least not what I could find), so it may be useful to include in your Hekkus help pages.