DynRPG  v0.14a
RM2k3 Plugin SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions | Public Attributes
RPG::Sound Class Reference

Used for sound effect settings. More...

List of all members.

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)

Detailed Description

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.

See also:
set
RPG::Music

Constructor & Destructor Documentation

Simple constructor, creates an (OFF) sound item which will stop all sounds when played.

Copy constructor.

Parameters:
refRPG::Sound item to copy
See also:
set
RPG::Sound::Sound ( std::string  filename,
int  volume,
int  speed,
int  pan 
)

Extended constructor, creates a sound item based on the given settings.

Parameters:
filenameFilename
volumeVolume
speedSpeed
panPan value

Destructor.


Member Function Documentation

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);
See also:
Sound(RPG::Sound &)
static void RPG::Sound::stop ( ) [static]

Stops all sounds.


Member Data Documentation

Filename.

Pan (0 to 100, 50 is normal)

Speed (100 is normal)

Volume (0 to 100)

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator