| 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 | //-------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected