Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Static Public Member Functions | List of all members
Sound Class Referenceabstract
Inheritance diagram for Sound:
Inheritance graph
[legend]
Collaboration diagram for Sound:
Collaboration graph
[legend]

Public Member Functions

virtual void play (float vol=1.0, int32 offsetX=0, float pitch=0.0, ms_time fromMs=0, ms_delta lenMs=-1)=0
 plays sound immediately
 
virtual void start ()=0
 starts playing sound immediately
 
virtual void stop ()=0
 stops playing sound immediately
 
virtual void pause ()=0
 pauses playback
 
virtual void resume ()=0
 resumes playback after pausing
 
virtual bool isPaused ()
 tells if sound is paused
 
virtual SoundsetLooping (bool loopingOn)
 
virtual bool isLooping ()
 tells if sound is looping
 
virtual SoundsetVolume (float level)=0
 returns this sound for chaining calls
 
virtual float getVolume ()
 get current volume level for this sound only
 
virtual SoundsetPitch (float pitchOffset)=0
 returns this sound for chaining calls
 
virtual void changePitch (float targetOffset, ms_delta msDuration, EasingFunc easing=easeInOutQuad)=0
 change the pitch level over time
 
virtual SoundsetOffsetX (int32 offsetX)=0
 returns this sound for chaining calls
 
virtual void changeOffsetX (int32 targetOffset, ms_delta msDuration, EasingFunc easing=linearTween)=0
 change the X offset from the center of the screen over time //! returns this sound for chaining calls
 
virtual void fadeOut (ms_delta fadeMs, EasingFunc easing=linearTween)=0
 Fade to zero volume and stop over the course of fadeMs milliseconds.
 
virtual void fadeIn (ms_delta fadeMs, EasingFunc easing=linearTween)=0
 Fade in to full volume over fadeMs milliseconds. If the sound was not already playing, start it.
 
virtual void changeVolume (float level, ms_delta fadeMs, EasingFunc easing=linearTween)=0
 Fade up or down to reach a new volume level over fadeMs milliseconds. If the sound was not already playing, start it.
 
virtual Soundskip (ms_delta skipMilliseconds)=0
 
virtual SoundskipTo (ms_time timeMs)=0
 returns this sound for chaining calls
 
- Public Member Functions inherited from EventEmitter
virtual void addHandler (IEventHandler *inHandler, long inType=all_events)
 add a new handler for some event type, or for all events if no type specified
 
virtual void removeHandler (IEventHandler *inHandler, long inType=all_events)
 Remove a handler for some event type, or for all events if no type specified.
 
virtual void clear (bool doRelease=true)
 remove all handlers
 
virtual void blockEvent (long inEventType)
 temporarily ignore all events of a particular type, just drop them on the floor
 
virtual void unblockEvent (long inEventType)
 stop ignoring events of a particular type, no recovery of previously ignored events
 
 EventEmitter ()
 constructor for new event emitter
 
virtual bool postEvent (long inEventType, void *inEventData, EventEmitter *fromEmitter=0)
 post an event for immediate handling locally, or relay it to the EventManger
 
- Public Member Functions inherited from RefCountedObj
virtual void addRef () const throw ()
 
virtual void release () const throw ()
 

Static Public Member Functions

static SoundcreateSoundFromData (const char *soundName, char *soundData, long soundDataLen)
 
static SoundcreateSoundFromFile (const char *soundFileName)
 

Detailed Description

Sound A simple sound that can be played over your speakers

Member Function Documentation

virtual void changeOffsetX ( int32  targetOffset,
ms_delta  msDuration,
EasingFunc  easing = linearTween 
)
pure virtual

change the X offset from the center of the screen over time //! returns this sound for chaining calls

virtual void changePitch ( float  targetOffset,
ms_delta  msDuration,
EasingFunc  easing = easeInOutQuad 
)
pure virtual

change the pitch level over time

virtual void changeVolume ( float  level,
ms_delta  fadeMs,
EasingFunc  easing = linearTween 
)
pure virtual

Fade up or down to reach a new volume level over fadeMs milliseconds. If the sound was not already playing, start it.

static Sound* createSoundFromData ( const char *  soundName,
char *  soundData,
long  soundDataLen 
)
static
static Sound* createSoundFromFile ( const char *  soundFileName)
static
virtual void fadeIn ( ms_delta  fadeMs,
EasingFunc  easing = linearTween 
)
pure virtual

Fade in to full volume over fadeMs milliseconds. If the sound was not already playing, start it.

virtual void fadeOut ( ms_delta  fadeMs,
EasingFunc  easing = linearTween 
)
pure virtual

Fade to zero volume and stop over the course of fadeMs milliseconds.

virtual float getVolume ( )
inlinevirtual

get current volume level for this sound only

virtual bool isLooping ( )
inlinevirtual

tells if sound is looping

virtual bool isPaused ( )
inlinevirtual

tells if sound is paused

virtual void pause ( )
pure virtual

pauses playback

virtual void play ( float  vol = 1.0,
int32  offsetX = 0,
float  pitch = 0.0,
ms_time  fromMs = 0,
ms_delta  lenMs = -1 
)
pure virtual

plays sound immediately

virtual void resume ( )
pure virtual

resumes playback after pausing

virtual Sound& setLooping ( bool  loopingOn)
inlinevirtual

Turns on/off looping of sound returns this sound for chaining calls

virtual Sound& setOffsetX ( int32  offsetX)
pure virtual

returns this sound for chaining calls

set the X offset from the center of the screen for this sound only

virtual Sound& setPitch ( float  pitchOffset)
pure virtual

returns this sound for chaining calls

set pitch for this sound only

virtual Sound& setVolume ( float  level)
pure virtual

returns this sound for chaining calls

set volume level for this sound only 1.0 is max, 0.0 is silent

virtual Sound& skip ( ms_delta  skipMilliseconds)
pure virtual

skip forward (positive value) or backward (negative value) by skipMilliseconds returns this sound for chaining calls

virtual Sound& skipTo ( ms_time  timeMs)
pure virtual

returns this sound for chaining calls

skip to a specific point in the sound

virtual void start ( )
pure virtual

starts playing sound immediately

virtual void stop ( )
pure virtual

stops playing sound immediately