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

Used for background music settings. More...

List of all members.

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)

Detailed Description

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.

See also:
set
RPG::Sound

Constructor & Destructor Documentation

Simple constructor, creates an (OFF) music item which will stop the music when played.

Copy constructor.

Parameters:
refRPG::Music item to copy
See also:
set
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.

Parameters:
filenameFilename
fadeInTimeTime to fade in
volumeVolume
speedSpeed
panPan value

Destructor.


Member Function Documentation

static void RPG::Music::fadeOut ( int  time) [static]

Fades out the current music.

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

Stops the current music.


Member Data Documentation

Time to fade in (in milliseconds)

Filename.

Pan (0 to 100, 50 is normal)

Speed (100 is normal)

Volume (0 to 100)

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator