Planeshift
|
This object represents a planeshift Soundtrack. More...
#include <psmusic.h>
Public Types | |
enum | Accidental { NO_ACCIDENTAL, DOUBLE_FLAT, FLAT, NATURAL, SHARP, DOUBLE_SHARP } |
enum | Duration { SIXTEENTH_DURATION = 1, EIGHTH_DURATION = 2, DOTTED_EIGHTH_DURATION = 3, QUARTER_DURATION = 4, DOTTED_QUARTER_DURATION = 6, HALF_DURATION = 8, DOTTED_HALF_DURATION = 12, WHOLE_DURATION = 16, DOTTED_WHOLE_DURATION = 24 } |
The number associated to each duration is the number of quarter divisions as specified in DURATION_QUARTER_DIVISIONS. More... | |
Public Member Functions | |
bool | CheckTimeOfDay (int time) |
Check time of day. | |
bool | CheckType (const int _type) |
Compares soundstracks type against a given type. | |
void | DontLoop () |
Disable looping. | |
void | FadeDown () |
Fades this Soundtrack down. | |
void | FadeDownAndStop () |
Fades this Soundtrack down and stops it. | |
void | FadeUp () |
Fades this Soundtrack up. | |
void | Loop () |
Enable or resume looping. | |
bool | Play (bool loopToggle, SoundControl *&ctrl) |
Play this SoundTrack. | |
psMusic () | |
Constructor Sets active to false and handle to NULL. | |
void | SetManaged () |
Set Autoremove to false. | |
void | SetUnManaged () |
Sets Autoremove to true. | |
void | Stop () |
Stops this Soundtrack immediatly. | |
void | UpdateHandleCallback () |
Updates Handles Callback. | |
~psMusic () | |
Destructor Removes Handle callback if theres one. | |
Static Public Member Functions | |
static void | StopCallback (void *object) |
Callback function for Stop. | |
Public Attributes | |
bool | active |
is this soundtrack active? | |
int | fadedelay |
number of milliseconds fading should use | |
SoundHandle * | handle |
handle if this soundtrack is active | |
size_t | loopend |
frame when jumping back to loopstart (when looping) | |
size_t | loopstart |
frame to start at when looping | |
float | maxvol |
volume this track is playing at | |
float | minvol |
volume when fading in | |
csString | resource |
sound resource | |
int | timeofday |
time when this music starts playing | |
int | timeofdayrange |
time till this music is playing | |
int | type |
type can be anything i use it for weather checks and similar thhings |
This object represents a planeshift Soundtrack.
It maybe an ambient or a real soundtrack they are very similiar. it has methods to perform the most common operations.
enum psMusic::Accidental |
Definition at line 218 of file musicutil.h.
enum psMusic::Duration |
The number associated to each duration is the number of quarter divisions as specified in DURATION_QUARTER_DIVISIONS.
SIXTEENTH_DURATION | |
EIGHTH_DURATION | |
DOTTED_EIGHTH_DURATION | |
QUARTER_DURATION | |
DOTTED_QUARTER_DURATION | |
HALF_DURATION | |
DOTTED_HALF_DURATION | |
WHOLE_DURATION | |
DOTTED_WHOLE_DURATION |
Definition at line 240 of file musicutil.h.
psMusic::psMusic | ( | ) |
Constructor Sets active to false and handle to NULL.
psMusic::~psMusic | ( | ) |
Destructor Removes Handle callback if theres one.
bool psMusic::CheckTimeOfDay | ( | int | time | ) |
Check time of day.
Checks if time is within this soundtracks timewindow. Returns true if it is.
time | <24 && >0 is resonable but can be any valid int |
bool psMusic::CheckType | ( | const int | _type | ) |
Compares soundstracks type against a given type.
Returns true if they are both equal
_type | type to compare against |
void psMusic::DontLoop | ( | ) |
Disable looping.
void psMusic::FadeDown | ( | ) |
Fades this Soundtrack down.
void psMusic::FadeDownAndStop | ( | ) |
Fades this Soundtrack down and stops it.
void psMusic::FadeUp | ( | ) |
Fades this Soundtrack up.
void psMusic::Loop | ( | ) |
Enable or resume looping.
bool psMusic::Play | ( | bool | loopToggle, |
SoundControl *& | ctrl | ||
) |
Play this SoundTrack.
loopToggle | loop? maybe true or false |
ctrl | SoundControl for this sound |
void psMusic::SetManaged | ( | ) |
Set Autoremove to false.
The SoundHandle wont be removed even if paused.
void psMusic::SetUnManaged | ( | ) |
Sets Autoremove to true.
The SoundHandle will be removed when this sound has stopped playing. Warning: doesnt happen when looping!
void psMusic::Stop | ( | ) |
Stops this Soundtrack immediatly.
static void psMusic::StopCallback | ( | void * | object | ) | [static] |
Callback function for Stop.
SoundHandles callback will point to this and inform us if it gets destroyed. It sets active to false and Handle to NULL
void psMusic::UpdateHandleCallback | ( | ) |
Updates Handles Callback.
bool psMusic::active |
size_t psMusic::loopend |
size_t psMusic::loopstart |
csString psMusic::resource |