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.
| 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. |
| 699 | std::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 | |
| 710 | static void CALLBACK Sound_FinishOneshotTrack(HSYNC handle, DWORD channel, DWORD data, void* userData) |
| 711 | { |