nCine::AudioReaderMpt class

Audio reader for tracker module formats, backed by libopenmpt.

Base classes

class IAudioReader
Interface for an audio reader.

Constructors, destructors, conversion operators

AudioReaderMpt(std::unique_ptr<Death::IO::Stream> fileHandle, std::int32_t frequency)
~AudioReaderMpt()
AudioReaderMpt(const AudioReaderMpt&) deleted

Public functions

auto operator=(const AudioReaderMpt&) -> AudioReaderMpt& deleted
auto Read(void* buffer, std::int32_t bufferSize) const -> std::int32_t override
Decodes audio data into the specified buffer.
void Rewind() const override
Rewinds the reader back to the beginning.
void SetLooping(bool value) override
Enables native stream looping if the format supports it.
auto GetDecodedFrames() const -> std::int64_t override
Returns the number of frames decoded so far, it keeps counting across rewinds.
auto GetModuleStateAt(std::int64_t frame, AudioModuleState& state) const -> bool override
Returns the state of the module at a frame already decoded, see GetDecodedFrames().
auto CanSetModulePosition() const -> bool override
Returns true if SetModulePosition() is supported.
auto SetModulePosition(std::int32_t order, std::int32_t row) -> bool override
Jumps to a row of a position in the order list.
auto SetModuleSpeed(std::int32_t speed) -> bool override
Sets the ticks per row until the module changes them.
auto SetModuleTempo(std::int32_t tempo) -> bool override
Sets the tempo until the module changes it.
auto SlideModuleChannelVolume(std::int32_t channel, float volume, std::int32_t milliseconds) -> bool override
Changes the volume of a channel gradually, from its current one to volume in 0.0 to 1.0.

Function documentation

std::int32_t nCine::AudioReaderMpt::Read(void* buffer, std::int32_t bufferSize) const override

Decodes audio data into the specified buffer.

Parameters
buffer Destination buffer
bufferSize Buffer size in bytes
Returns Number of bytes actually written