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

Function Sound_TrackIsPlaying

TombEngine/Sound/sound.cpp:775–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773}
774
775int Sound_TrackIsPlaying(const std::string& fileName, std::optional<SoundTrackType> type)
776{
777 for (int i = 0; i < (int)SoundTrackType::Count; i++)
778 {
779 const auto& slot = SoundtrackSlot[i];
780
781 if (!BASS_ChannelIsActive(slot.Channel))
782 continue;
783
784 auto name1 = TEN::Utils::ToLower(slot.Track);
785 auto name2 = TEN::Utils::ToLower(fileName);
786
787 if (name1.compare(name2) == 0 && (!type.has_value() || (SoundTrackType)i == type.value()))
788 return true;
789 }
790
791 return false;
792}
793
794// Returns slot ID in which effect is playing, if found. If not found, returns -1.
795// We use origin position as a reference, because in original TRs it's not possible to clearly

Callers 1

IsAudioTrackPlayingFunction · 0.85

Calls 4

ToLowerFunction · 0.85
compareMethod · 0.80
has_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected