bn::dmg_music_item class

Contains the required information to play DMG music.

The assets conversion tools generate an object of this type in the build folder for each module file.

Module files with *.mod and *.s3m extensions are supported.

Constructors, destructors, conversion operators

dmg_music_item(const uint8_t& data_ref) explicit constexpr
Constructor.
dmg_music_item(const uint8_t& data_ref, dmg_music_type type) explicit constexpr
Constructor.

Public functions

auto data_ptr() const -> const uint8_t* constexpr
Returns a pointer to the referenced song data.
auto data_ref() const -> const uint8_t& constexpr
Returns the referenced song data.
auto type() const -> dmg_music_type constexpr
Returns the referenced song type.
void play() const
Plays the DMG music specified by this item with default settings.
void play(int speed) const
Plays the DMG music specified by this item.
void play(int speed, bool loop) const
Plays the DMG music specified by this item.

Friends

auto operator==(const dmg_music_item& a, const dmg_music_item& b) -> bool defaulted constexpr
Default equal operator.

Function documentation

bn::dmg_music_item::dmg_music_item(const uint8_t& data_ref) explicit constexpr

Constructor.

Parameters
data_ref Reference to the song data.

Song data is not copied but referenced, so it should outlive the dmg_music_item to avoid dangling references.

bn::dmg_music_item::dmg_music_item(const uint8_t& data_ref, dmg_music_type type) explicit constexpr

Constructor.

Parameters
data_ref Reference to the song data.
type Referenced song type.

Song data is not copied but referenced, so it should outlive the dmg_music_item to avoid dangling references.

void bn::dmg_music_item::play() const

Plays the DMG music specified by this item with default settings.

Default settings are speed = 1 and loop enabled.

void bn::dmg_music_item::play(int speed) const

Plays the DMG music specified by this item.

Parameters
speed Playback speed, in the range [1..256].

VGM player only supports the default playback speed (1).

void bn::dmg_music_item::play(int speed, bool loop) const

Plays the DMG music specified by this item.

Parameters
speed Playback speed, in the range [1..256].
loop Indicates if it must be played until it is stopped manually or until end.

VGM player only supports the default playback speed (1).