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

Used for background music settings. More...

#include <Music.h>

Public Member Functions

 Music ()
 Simple constructor, creates an (OFF) music item which will stop the music when played.
 
 Music (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 (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

◆ Music() [1/2]

RPG::Music::Music ( Music & ref)

Copy constructor.

Parameters
refRPG::Music item to copy
See also
set

◆ Music() [2/2]

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

Member Function Documentation

◆ fadeOut()

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

Fades out the current music.

Parameters
timeDuration (in milliseconds)

◆ set()

void RPG::Music::set ( 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);
Used for background music settings.
Definition Music.h:21
void set(Music &ref)
Sets a music item to the settings of another.
Music * battleBGM
Current battle music (empty for default)
Definition System.h:62
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
Music(Music &)

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