| 1670 | } |
| 1671 | |
| 1672 | s32 ImSetSequence(ImPlayerData* data, u8* sndData, s32 seqIndex) |
| 1673 | { |
| 1674 | u8* chunk = midi_gotoHeader(sndData, "MTrk", seqIndex); |
| 1675 | if (!chunk) |
| 1676 | { |
| 1677 | IM_LOG_ERR("Sq couldn't find chunk %d", seqIndex + 1); |
| 1678 | return imFail; |
| 1679 | } |
| 1680 | |
| 1681 | // Skip the header and size to the data. |
| 1682 | u8* chunkData = &chunk[8]; |
| 1683 | data->seqIndex = seqIndex; |
| 1684 | // offset of the chunk data from the base sound data. |
| 1685 | data->chunkOffset = s32(chunkData - sndData); |
| 1686 | |
| 1687 | u32 dt = midi_getVariableLengthValue(&chunkData); |
| 1688 | data->curTick = ImFixupSoundTick(data, dt); |
| 1689 | data->nextTick = 0; |
| 1690 | data->chunkPtr = s32(chunkData - (sndData + data->chunkOffset)); |
| 1691 | return imSuccess; |
| 1692 | } |
| 1693 | |
| 1694 | // This gets called at a fixed rate, where each step = 'stepFixed' ticks. |
| 1695 | void ImAdvanceMidiPlayer(ImPlayerData* playerData) |
no test coverage detected