MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getPosition

Method getPosition

Engine/source/sfx/sfxInternal.h:198–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196 : mVoice( voice ), mLastPos( 0 ) {}
197
198 U32 getPosition() const
199 {
200 U32 samplePos = mVoice->_tell();
201
202 // The device playback cursor may snap back to an undefined value as soon
203 // as all the data has been consumed. However, for us to be a reliable
204 // time source, we can't let that happen so as soon as the device play cursor
205 // goes back to a sample position we have already passed, we start reporting an
206 // end-of-stream position.
207
208 if( samplePos < mLastPos && mVoice->mBuffer != NULL )
209 samplePos = mVoice->mBuffer->getNumSamples();
210 else
211 mLastPos = samplePos;
212
213 return samplePos;
214 }
215};
216
217//--------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

getNumSamplesMethod · 0.80
_tellMethod · 0.45

Tested by

no test coverage detected