![]() |
DynRPG
v0.20
RM2k3 Plugin SDK
|
Used for sound effect settings. More...
Public Member Functions | |
Sound () | |
Simple constructor, creates an (OFF) sound item which will stop all sounds when played. | |
Sound (RPG::Sound &ref) | |
Copy constructor. | |
Sound (std::string filename, int volume, int speed, int pan) | |
Extended constructor, creates a sound item based on the given settings. | |
~Sound () | |
Destructor. | |
void | set (RPG::Sound &ref) |
Sets a sound item to the settings of another. | |
void | play () |
Plays the sound. | |
Static Public Member Functions | |
static void | stop () |
Stops all sounds. | |
Public Attributes | |
DStringPtr | filename |
Filename. | |
int | volume |
Volume (0 to 100 ) | |
int | speed |
Speed (100 is normal) | |
int | pan |
Pan (0 to 100 , 50 is normal) |
Used for sound effect settings.
This class is used to store the settings of a sound effect "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::Sound pointers in RPG classes still shouldn't be assigned, you have to use the set method instead.
Simple constructor, creates an (OFF) sound item which will stop all sounds when played.
RPG::Sound::Sound | ( | RPG::Sound & | ref | ) |
RPG::Sound::Sound | ( | std::string | filename, |
int | volume, | ||
int | speed, | ||
int | pan | ||
) |
Extended constructor, creates a sound item based on the given settings.
filename | Filename |
volume | Volume |
speed | Speed |
pan | Pan value |
Destructor.
void RPG::Sound::play | ( | ) |
Plays the sound.
void RPG::Sound::set | ( | RPG::Sound & | ref | ) |
Sets a sound item to the settings of another.
This method should be used to "assign" a sound item to an RPG::Sound pointer in an RPG class.
Example:
RPG::Sound newSound("Cursor2", 100, 100, 50); RPG::system->cursorSE->set(newSound);
static void RPG::Sound::stop | ( | ) | [static] |
Stops all sounds.
Filename.
int RPG::Sound::pan |
Pan (0
to 100
, 50
is normal)
Speed (100
is normal)
Volume (0
to 100
)