Defines a class for loading and storing music.
More...
#include <music.h>
|
| ~Music () override |
|
bool | play (int loops=-1, int fadeIn=0) |
| Plays the music.
|
|
| Resource ()=default |
|
void | incRef () |
| Increments the internal reference count.
|
|
void | decRef (OrphanPolicy orphanPolicy=DeleteLater) |
| Decrements the reference count.
|
|
const std::string & | getIdPath () const |
| Return the path identifying this resource.
|
|
|
static Music * | load (SDL_RWops *rw) |
| Loads a music from a buffer in memory.
|
|
Defines a class for loading and storing music.
Definition at line 31 of file music.h.
◆ ~Music()
◆ Music()
Music::Music |
( |
Mix_Music * |
music | ) |
|
|
protected |
◆ load()
Music * Music::load |
( |
SDL_RWops * |
rw | ) |
|
|
static |
Loads a music from a buffer in memory.
- Parameters
-
rw | The SDL_RWops to load the music data from. |
- Returns
nullptr
if the an error occurred, a valid pointer otherwise.
Definition at line 36 of file music.cpp.
◆ play()
bool Music::play |
( |
int |
loops = -1 , |
|
|
int |
fadeIn = 0 |
|
) |
| |
Plays the music.
- Parameters
-
loops | Number of times to repeat the playback (-1 means forever). |
fadeIn | Duration in milliseconds to fade in the music. |
- Returns
true
if the playback started properly false
otherwise.
Definition at line 47 of file music.cpp.
◆ mMusic
The documentation for this class was generated from the following files: