| 773 | } |
| 774 | |
| 775 | int 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 |
no test coverage detected