DynRPG v0.32 Unofficial
Plugin SDK
|
Used for sound effect settings. More...
#include <Sound.h>
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.
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 |
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: