MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetSoundTrackNameAndPosition

Function GetSoundTrackNameAndPosition

TombEngine/Sound/sound.cpp:699–708  ·  view source on GitHub ↗

Returns specified soundtrack type's stem name and playhead position. To be used with savegames. To restore soundtrack, use PlaySoundtrack function with playhead position passed as 3rd argument.

Source from the content-addressed store, hash-verified

697// Returns specified soundtrack type's stem name and playhead position.
698// To be used with savegames. To restore soundtrack, use PlaySoundtrack function with playhead position passed as 3rd argument.
699std::pair<std::string, QWORD> GetSoundTrackNameAndPosition(SoundTrackType type)
700{
701 auto track = SoundtrackSlot[(int)type];
702
703 if (track.Track.empty() || !BASS_ChannelIsActive(track.Channel))
704 return std::pair<std::string, QWORD>();
705
706 std::filesystem::path path = track.Track;
707 return std::pair<std::string, QWORD>(path.string(), BASS_ChannelGetPosition(track.Channel, BASS_POS_BYTE));
708}
709
710static void CALLBACK Sound_FinishOneshotTrack(HSYNC handle, DWORD channel, DWORD data, void* userData)
711{

Callers 1

BuildMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected