MCPcopy Create free account
hub / github.com/ddnet/ddnet / IsPlaying

Method IsPlaying

src/engine/client/sound.cpp:1016–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1014}
1015
1016bool CSound::IsPlaying(int SampleId)
1017{
1018 dbg_assert(SampleId >= 0 && SampleId < NUM_SAMPLES, "SampleId invalid");
1019 const CLockScope LockScope(m_SoundLock);
1020 const CSample *pSample = &m_aSamples[SampleId];
1021 dbg_assert(m_aSamples[SampleId].IsLoaded(), "Sample not loaded");
1022 return std::any_of(std::begin(m_aVoices), std::end(m_aVoices), [pSample](const auto &Voice) { return Voice.m_pSample == pSample; });
1023}
1024
1025void CSound::PauseAudioDevice()
1026{

Callers 3

UpdateMethod · 0.45
DemoSliceMethod · 0.45
Con_DemoPlayMethod · 0.45

Calls 1

IsLoadedMethod · 0.45

Tested by

no test coverage detected