| 1283 | const int64_t totalBytes = _streaming.consumedBytes.load(std::memory_order_acquire) + |
| 1284 | static_cast<int64_t>(byteOffsetInBuffer); |
| 1285 | return static_cast<float>(totalBytes) / static_cast<float>(bytesPerSec); |
| 1286 | } |
| 1287 | |
| 1288 | // Non-streamed path (Phase 3c/3d single-buffer): live AL cursor |
| 1289 | // is accurate because there's only one buffer to position within. |
| 1290 | if (_alSource) |
| 1291 | { |
| 1292 | float secOffset = 0.f; |
| 1293 | alGetError(); |
| 1294 | alGetSourcef(_alSource, AL_SEC_OFFSET, &secOffset); |
| 1295 | if (alGetError() == AL_NO_ERROR) |
| 1296 | return secOffset; |
| 1297 | } |
| 1298 | if (_state.frequency <= 0 || _state.nChannel <= 0 || _state.sSize <= 0) |
| 1299 | return 0.f; |
| 1300 | int bytesPerSec = static_cast<int>(_state.frequency) * _state.nChannel * _state.sSize; |
| 1301 | return bytesPerSec > 0 ? static_cast<float>(_state.curPosition) / static_cast<float>(bytesPerSec) : 0.f; |
| 1302 | } |
| 1303 | |
| 1304 | void WaveOAL::Repeat(int repeat) |
| 1305 | { |
| 1306 | if (repeat < 2) |
| 1307 | { |
| 1308 | _state.looping = false; |
| 1309 | } |
| 1310 | else |
no outgoing calls
no test coverage detected