MCPcopy Create free account
hub / github.com/SFML/SFML / onRead

Function onRead

src/SFML/Audio/SoundFileReaderWav.cpp:44–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42namespace
43{
44ma_result onRead(ma_decoder* decoder, void* buffer, size_t bytesToRead, size_t* bytesRead)
45{
46 auto* stream = static_cast<sf::InputStream*>(decoder->pUserData);
47 const std::optional count = stream->read(buffer, bytesToRead);
48
49 if (!count.has_value())
50 return MA_ERROR;
51
52 *bytesRead = static_cast<std::size_t>(*count);
53 return MA_SUCCESS;
54}
55
56ma_result onSeek(ma_decoder* decoder, std::int64_t byteOffset, ma_seek_origin origin)
57{

Callers 1

drmp3_init_internalFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected