bn::music_item class

Contains the required information to play Direct Sound music.

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

Module files with *.mod, *.xm, *.s3m and *.it extensions are supported.

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 Direct Sound music specified by this item with default settings.
void play(fixed volume) const
Plays the Direct Sound music specified by this item.
void play(fixed volume, bool loop) const
Plays the Direct Sound music specified by this item.
void play_jingle() const
Plays the Direct Sound jingle specified by this item with volume = 1.
void play_jingle(fixed volume) const
Plays the Direct Sound jingle specified by this item.

Friends

auto operator==(music_item a, music_item b) -> 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 Direct Sound 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 Direct Sound 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 Direct Sound 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.

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

Plays the Direct Sound jingle specified by this item.

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