bn::music_item class

Contains the required information to play music.

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

Supported module files have *.mod, *.xm, *.s3m or *.it extensions.

Constructors, destructors, conversion operators

music_item(int id) explicit constexpr
Constructor.

Public functions

auto id() const -> int constexpr
Returns the internal ID.
void play() const
Plays the music specified by this item with default settings.
void play(fixed volume) const
Plays the music specified by this item.
void play(fixed volume, bool loop) const
Plays the music specified by this item.

Friends

auto operator==(music_item a, music_item b) -> friend bool defaulted constexpr
Default equal operator.

Function documentation

bn::music_item::music_item(int id) explicit constexpr

Constructor.

Parameters
id Internal ID.

void bn::music_item::play() const

Plays the music specified by this item with default settings.

Default settings are volume = 1 and loop enabled.

void bn::music_item::play(fixed volume) const

Plays the music specified by this item.

Parameters
volume Volume level, in the range [0..1].

void bn::music_item::play(fixed volume, bool loop) const

Plays the music specified by this item.

Parameters
volume Volume level, in the range [0..1].
loop Indicates if it must be played until it is stopped manually or until end.