bn::dmg_music namespace

DMG music related functions.

Functions

auto playing() -> bool
Indicates if currently there's any DMG music playing or not.
auto playing_item() -> optional<dmg_music_item>
Returns the active dmg_music_item if there's any DMG music playing; bn::nullopt otherwise.
void play(const dmg_music_item& item)
Plays the DMG music specified by the given dmg_music_item with default settings.
void play(const dmg_music_item& item, int speed)
Plays the DMG music specified by the given dmg_music_item.
void play(const dmg_music_item& item, int speed, bool loop)
Plays the DMG music specified by the given dmg_music_item.
void stop()
Stops playback of the active DMG music.
auto paused() -> bool
Indicates if the active DMG music has been paused or not.
void pause()
Pauses playback of the active DMG music.
void resume()
Resumes playback of the paused DMG music.
auto position() -> const dmg_music_position&
Returns the sequence position of the active DMG music.
void set_position(int pattern, int row)
Sets the sequence position of the active DMG music.
void set_position(const dmg_music_position& position)
Sets the sequence position of the active DMG music.
auto left_volume() -> fixed
Returns the volume of the active DMG music for the left speaker.
auto right_volume() -> fixed
Returns the volume of the active DMG music for the right speaker.
void set_left_volume(fixed left_volume)
Sets the volume of the active DMG music for the left speaker.
void set_right_volume(fixed right_volume)
Sets the volume of the active DMG music for the right speaker.
void set_volume(fixed volume)
Sets the volume of the active DMG music for both speakers.
void set_volume(fixed left_volume, fixed right_volume)
Sets the volume of the active DMG music for both speakers.
auto master_volume() -> dmg_music_master_volume
Returns the master volume of all DMG music.
void set_master_volume(dmg_music_master_volume volume)
Sets the master volume of all DMG music.

Function documentation

void bn::dmg_music::play(const dmg_music_item& item)

Plays the DMG music specified by the given dmg_music_item with default settings.

Default settings are speed = 1 and loop enabled.

void bn::dmg_music::play(const dmg_music_item& item, int speed)

Plays the DMG music specified by the given dmg_music_item.

Parameters
item Specifies the DMG music to play.
speed Playback speed, in the range [1..256].

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

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

Plays the DMG music specified by the given dmg_music_item.

Parameters
item Specifies the DMG music to play.
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).

void bn::dmg_music::set_position(int pattern, int row)

Sets the sequence position of the active DMG music.

Parameters
pattern Pattern order.
row Row inside the pattern.

void bn::dmg_music::set_left_volume(fixed left_volume)

Sets the volume of the active DMG music for the left speaker.

Parameters
left_volume Left speaker volume level, in the range [0..1].

Volume change is not supported by the VGM player.

void bn::dmg_music::set_right_volume(fixed right_volume)

Sets the volume of the active DMG music for the right speaker.

Parameters
right_volume Right speaker volume level, in the range [0..1].

Volume change is not supported by the VGM player.

void bn::dmg_music::set_volume(fixed volume)

Sets the volume of the active DMG music for both speakers.

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

Volume change is not supported by the VGM player.

void bn::dmg_music::set_volume(fixed left_volume, fixed right_volume)

Sets the volume of the active DMG music for both speakers.

Parameters
left_volume Left speaker volume level, in the range [0..1].
right_volume Right speaker volume level, in the range [0..1].

Volume change is not supported by the VGM player.