I am using this to set the position on a slider for playing of mp3’s
ret = FSOUND_Stream_SetPosition(streamHandle, PicPosValue(SlideIndex))
What is the equivalent for playing mods?
I can get the current postion by using FMUSIC_GetTime(songHandle) but there is no SetTime or SetPosition (well not that I can see). How do you set the playing position for a mod?
- tbe asked 14 years ago
STRM = FMUSIC_LoadSong(strFileName)
sng_NumChans = FMUSIC_GetNumChannels(STRM) NumChannels = sng_NumChans sng_NumOrders = FMUSIC_GetNumOrders(STRM) BPM = FMUSIC_GetBPM(STRM) speed = FMUSIC_GetSpeed(STRM) KBPS = ((BPM * 2) / 5) st = ((1 / KBPS) * 1000) * speed For i = 0 To (sng_NumOrders - 1) t = t + FMUSIC_GetPatternLength(STRM, i) Next i SongLenghtInBytes = t SongLenghtInMS = t * st
i has set slider bar max value by above caculation
and during play song, moved slider bar by FMUSIC_Gettime(STRM) with
when user moved slider bar by manualy, the position is slider.value
so FMUSIC_SetOrder(songhaldle,position) for moved song position
? i don’t know that above song total length is correct or not???
first off, your blowing away your channel handle. Should be:
Channel = FMUSIC_PlaySong(Music)
Your calculation methods could work for getting the play duration, but
you cannot, cannot, set the position by that value. You can only set it by
If you calculate it by seconds for example 200, and you try to set the order
to 175, it won’t work, cuz there are not that many orders. Unless you have
a huge mode
i try like this;
get OrderNumer and changed position within OrderNumer
i feel somthing changed song position.
but several times changed orderPosition, Sliderbar is Not move.
so i remembered GetTime is not real song position
Returns the time in milliseconds since the song was started
SDK say Gettime is only playing time(milliseconds)
is this no way get real position form song like FSOUND_Stream_GetPosition?
- vbbank answered 14 years ago
Please login first to submit.