DynRPG v0.32 Unofficial
Plugin SDK
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
RPG::Sound Class Reference

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)
 

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

◆ Sound() [1/2]

RPG::Sound::Sound ( RPG::Sound & ref)

Copy constructor.

Parameters
refRPG::Sound item to copy
See also
set

◆ Sound() [2/2]

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

Member Function Documentation

◆ set()

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);
Used for sound effect settings.
Definition Sound.h:21
void set(RPG::Sound &ref)
Sets a sound item to the settings of another.
Sound * cursorSE
Current cursor sound (empty for default)
Definition System.h:69
System *& system
Object of "system" data, used for values which can be changed in-game.
Map *& map
The current map environment (camera, events, etc.)
See also
Sound(RPG::Sound &)

The documentation for this class was generated from the following file: