music_item class
#include <bn_music_item.h>
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
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_jingle(fixed volume) const
Plays the Direct Sound jingle specified by this item.
| Parameters | |
|---|---|
| volume | Volume level, in the range [0..1]. |