Public Member Functions |
| Sound (Context *context) |
| Construct.
|
virtual | ~Sound () |
| Destruct and free sound data.
|
virtual bool | Load (Deserializer &source) |
| Load resource. Return true if successful.
|
bool | LoadRaw (Deserializer &source) |
| Load raw sound data.
|
bool | LoadWav (Deserializer &source) |
| Load WAV format sound data.
|
bool | LoadOggVorbis (Deserializer &source) |
| Load Ogg Vorbis format sound data. Does not decode at load, but will rather be decoded while playing.
|
void | SetSize (unsigned dataSize) |
| Set sound size in bytes. Also resets the sound to be uncompressed and one-shot.
|
void | SetData (const void *data, unsigned dataSize) |
| Set uncompressed sound data.
|
void | SetFormat (unsigned frequency, bool sixteenBit, bool stereo) |
| Set uncompressed sound data format.
|
void | SetLooped (bool enable) |
| Set loop on/off. If loop is enabled, sets the full sound as loop range.
|
void | SetLoop (unsigned repeatOffset, unsigned endOffset) |
| Define loop.
|
void | FixInterpolation () |
| Fix interpolation by copying data from loop start to loop end (looped), or adding silence (oneshot.)
|
void * | AllocateDecoder () |
| Create and return a compressed audio decoder instance. Return null if fails.
|
unsigned | Decode (void *decoder, signed char *dest, unsigned bytes) |
| Decode compressed audio data. Return number of actually decoded bytes.
|
void | RewindDecoder (void *decoder) |
| Rewind the decoder to beginning of audio data.
|
void | FreeDecoder (void *decoder) |
| Free the decoder instance.
|
signed char * | GetStart () const |
| Return sound data start.
|
signed char * | GetRepeat () const |
| Return loop start.
|
signed char * | GetEnd () const |
| Return sound data end.
|
float | GetLength () const |
| Return length in seconds.
|
unsigned | GetDataSize () const |
| Return total sound data size.
|
unsigned | GetSampleSize () const |
| Return sample size.
|
float | GetFrequency () |
| Return default frequency as a float.
|
unsigned | GetIntFrequency () |
| Return default frequency as an integer.
|
bool | IsLooped () const |
| Return whether is looped.
|
bool | IsSixteenBit () const |
| Return whether data is sixteen bit.
|
bool | IsStereo () const |
| Return whether data is stereo.
|
bool | IsCompressed () const |
| Return whether is compressed in Ogg Vorbis format.
|
| Resource (Context *context) |
| Construct.
|
virtual bool | Save (Serializer &dest) |
| Save resource. Return true if successful.
|
void | SetName (const String &name) |
| Set name.
|
void | SetMemoryUse (unsigned size) |
| Set memory use in bytes, possibly approximate.
|
void | ResetUseTimer () |
| Reset last used timer.
|
const String & | GetName () const |
| Return name.
|
StringHash | GetNameHash () const |
| Return name hash.
|
unsigned | GetMemoryUse () const |
| Return memory use in bytes, possibly approximate.
|
unsigned | GetUseTimer () |
| Return time since last use in milliseconds. If referred to elsewhere than in the resource cache, returns always zero.
|
| Object (Context *context) |
| Construct.
|
virtual | ~Object () |
| Destruct. Clean up self from event sender & receiver structures.
|
virtual ShortStringHash | GetType () const =0 |
| Return type hash.
|
virtual const String & | GetTypeName () const =0 |
| Return type name.
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
void | UnsubscribeFromAllEventsExcept (const PODVector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events.)
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
Context * | GetContext () const |
| Return execution context.
|
Object * | GetSubsystem (ShortStringHash type) const |
| Return subsystem by type.
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
void | AddRef () |
| Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
|
void | ReleaseRef () |
| Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
|
int | Refs () const |
| Return reference count.
|
int | WeakRefs () const |
| Return weak reference count.
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|