music namespace
#include <bn_music.h>
Music related functions.
Contents
- Reference
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_
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_
| 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_
| 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]. |