DynRPG v0.32 Unofficial
Plugin SDK
|
Used for background music settings. More...
#include <Music.h>
Public Member Functions | |
Music () | |
Simple constructor, creates an (OFF) music item which will stop the music when played. | |
Music (Music &ref) | |
Copy constructor. | |
Music (std::string filename, int fadeInTime, int volume, int speed, int pan) | |
Extended constructor, creates a music item based on the given settings. | |
~Music () | |
Destructor. | |
void | set (Music &ref) |
Sets a music item to the settings of another. | |
void | play () |
Plays the music. | |
Static Public Member Functions | |
static void | stop () |
Stops the current music. | |
static void | fadeOut (int time) |
Fades out the current music. | |
Public Attributes | |
DStringPtr | filename |
Filename. | |
int | fadeInTime |
Time to fade in (in milliseconds) | |
int | volume |
Volume (0 to 100 ) | |
int | speed |
Speed (100 is normal) | |
int | pan |
Pan (0 to 100 , 50 is normal) | |
Used for background music settings.
This class is used to store the settings of a background music "item". This class is one of the exceptions to the "do not instantiate" rule, because it may be created and destroyed like any other C++ object. However, RPG::Music pointers in RPG classes still shouldn't be assigned, you have to use the set method instead.
RPG::Music::Music | ( | Music & | ref | ) |
RPG::Music::Music | ( | std::string | filename, |
int | fadeInTime, | ||
int | volume, | ||
int | speed, | ||
int | pan ) |
Extended constructor, creates a music item based on the given settings.
filename | Filename |
fadeInTime | Time to fade in |
volume | Volume |
speed | Speed |
pan | Pan value |
|
static |
Fades out the current music.
time | Duration (in milliseconds) |
void RPG::Music::set | ( | Music & | ref | ) |
Sets a music item to the settings of another.
This method should be used to "assign" a music item to an RPG::Music pointer in an RPG class.
Example: