bn::music namespace
#include <bn_music.h>

Music related functions.

Contents

Functions

auto playing() -> bool
Indicates if currently there's any music playing or not.
void play(music_item item)
Plays the music specified by the given music_item with default settings.
void play(music_item item, fixed volume)
Plays the music specified by the given music_item.
void play(music_item item, fixed volume, bool loop)
Plays the music specified by the given music_item.
void stop()
Stops playback of the active music.
auto paused() -> bool
Indicates if the active music has been paused or not.
void pause()
Pauses playback of the active music.
void resume()
Resumes playback of the paused music.
auto position() -> int
Returns the sequence position of the active music.
void set_position(int position)
Sets the sequence position of the active music.
auto volume() -> fixed
Returns the volume of the active music.
void set_volume(fixed volume)
Sets the volume of the active music.

Function documentation

void bn::music::play(music_item item)

Plays the music specified by the given music_item with default settings.

Default settings are volume = 1 and loop enabled.

void bn::music::play(music_item item, fixed volume)

Plays the music specified by the given music_item.

Parameters
item Specifies the music to play.
volume Volume level, in the range [0..1].

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

Plays the music specified by the given music_item.

Parameters
item Specifies the music to play.
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::set_volume(fixed volume)

Sets the volume of the active music.

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