![]() |
DynRPG
v0.20
RM2k3 Plugin SDK
|
Used for background music settings. More...
Public Member Functions | |
Music () | |
Simple constructor, creates an (OFF) music item which will stop the music when played. | |
Music (RPG::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 (RPG::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.
Simple constructor, creates an (OFF) music item which will stop the music when played.
RPG::Music::Music | ( | RPG::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 |
Destructor.
static void RPG::Music::fadeOut | ( | int | time | ) | [static] |
Fades out the current music.
time | Duration (in milliseconds) |
void RPG::Music::play | ( | ) |
Plays the music.
void RPG::Music::set | ( | RPG::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:
RPG::Music newMusic("Boss1", 0, 100, 100, 50); RPG::system->battleBGM->set(newMusic);
static void RPG::Music::stop | ( | ) | [static] |
Stops the current music.
Time to fade in (in milliseconds)
Filename.
int RPG::Music::pan |
Pan (0
to 100
, 50
is normal)
Speed (100
is normal)
Volume (0
to 100
)