class
#include <bn_dmg_music_item.h>
dmg_music_item 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_
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_
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).