|
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. More... | |
| bool | CheckType (const int _type) |
| Compares soundstracks type against a given type. More... | |
| void | DontLoop () |
| Disable looping. More... | |
| void | FadeDown () |
| Fades this Soundtrack down. More... | |
| void | FadeDownAndStop () |
| Fades this Soundtrack down and stops it. More... | |
| void | FadeUp () |
| Fades this Soundtrack up. More... | |
| void | Loop () |
| Enable or resume looping. More... | |
| bool | Play (bool loopToggle, SoundControl *&ctrl) |
| Play this SoundTrack. More... | |
| psMusic () | |
| Constructor Sets active to false and handle to NULL. More... | |
| void | SetManaged () |
| Set Autoremove to false. More... | |
| void | SetUnManaged () |
| Sets Autoremove to true. More... | |
| void | Stop () |
| Stops this Soundtrack immediatly. More... | |
| void | UpdateHandleCallback () |
| Updates Handles Callback. More... | |
| ~psMusic () | |
| Destructor Removes Handle callback if theres one. More... | |
Static Public Member Functions | |
| static void | StopCallback (void *object) |
| Callback function for Stop. More... | |
Public Attributes | |
| bool | active |
| is this soundtrack active? More... | |
| int | fadedelay |
| number of milliseconds fading should use More... | |
| SoundHandle * | handle |
| handle if this soundtrack is active More... | |
| size_t | loopend |
| frame when jumping back to loopstart (when looping) More... | |
| size_t | loopstart |
| frame to start at when looping More... | |
| float | maxvol |
| volume this track is playing at More... | |
| float | minvol |
| volume when fading in More... | |
| csString | resource |
| sound resource More... | |
| int | timeofday |
| time when this music starts playing More... | |
| int | timeofdayrange |
| time till this music is playing More... | |
| int | type |
| type can be anything i use it for weather checks and similar thhings More... | |
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 |
| Enumerator | |
|---|---|
| NO_ACCIDENTAL | |
| DOUBLE_FLAT | |
| FLAT | |
| NATURAL | |
| SHARP | |
| DOUBLE_SHARP | |
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.
| Enumerator | |
|---|---|
| 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 |
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.
| int psMusic::fadedelay |
| SoundHandle* psMusic::handle |
| size_t psMusic::loopend |
| int psMusic::timeofdayrange |
| int psMusic::type |