namespace
#include <bn_music.h>
music Direct Sound music related functions.
Functions
- auto playing() -> bool
- Indicates if currently there's any Direct Sound music playing or not.
-
auto playing_item() -> optional<music_
item> - Returns the active music_
item if there's any Direct Sound music playing; bn:: nullopt otherwise. -
void play(music_
item item) - Plays the Direct Sound music specified by the given music_
item with default settings. -
void play(music_
item item, fixed volume) - Plays the Direct Sound music specified by the given music_
item. -
void play(music_
item item, fixed volume, bool loop) - Plays the Direct Sound music specified by the given music_
item. - void stop()
- Stops playback of the active Direct Sound music.
- auto paused() -> bool
- Indicates if the active Direct Sound music has been paused or not.
- void pause()
- Pauses playback of the active Direct Sound music.
- void resume()
- Resumes playback of the paused Direct Sound music.
- auto position() -> int
- Returns the sequence position of the active Direct Sound music.
- void set_position(int position)
- Sets the sequence position of the active Direct Sound music.
- auto volume() -> fixed
- Returns the volume of the active Direct Sound music.
- void set_volume(fixed volume)
- Sets the volume of the active Direct Sound music.
- auto tempo() -> fixed
- Returns the tempo of the active Direct Sound music.
- void set_tempo(fixed tempo)
- Sets the tempo of the active Direct Sound music.
- auto pitch() -> fixed
- Returns the pitch of the active Direct Sound music.
- void set_pitch(fixed pitch)
- Sets the pitch of the active Direct Sound music.
Function documentation
void bn:: music:: play(music_ item item)
Plays the Direct Sound 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 Direct Sound 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 Direct Sound 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 Direct Sound music.
Parameters | |
---|---|
volume | Volume level, in the range [0..1]. |