"L. Spiro Engine"
|
Classes | |
class | CSoundLib |
struct | oggpack_buffer |
struct | ogg_page |
struct | ogg_stream_state |
struct | ogg_packet |
struct | ogg_sync_state |
class | COggWindow |
Ogg window functions. More... | |
struct | vorbis_info_floor0 |
struct | vorbis_info_floor1 |
struct | vorbis_func_residue |
struct | vorbis_info_residue0 |
struct | vorbis_func_mapping |
class | CVorbisBitrate |
Bitrate tracking and management. More... | |
class | CVorbisCodeBook |
Basic shared codebook operations. More... | |
class | CVorbisCodec |
The vorbis codec. More... | |
struct | private_state |
struct | codec_setup_info |
struct | vorbis_look_floor1 |
class | CVorbisConstants |
A few helper functions. More... | |
class | CVorbisEnvelope |
Vorbis PCM data envelope analysis and manipulation. More... | |
class | CVorbisFile |
Convenience library for opening/seeking/decoding. More... | |
class | CVorbisFloor0 |
Floor backend 0 implementation. More... | |
class | CVorbisFloor1 |
Floor backend 1 implementation. More... | |
class | CVorbisHighLevel |
High-level Vorbis structures. More... | |
class | CVorbisLpc |
LPC low level routines. More... | |
class | CVorbisLsp |
LSP (also called LSF) conversion routines. More... | |
class | CVorbisMapping0 |
Channel mapping 0 implementation. More... | |
class | CVorbisMasking |
Masking curve data for psychoacoustics. More... | |
class | CVorbisMdct |
Modified discrete cosine transform prototypes. More... | |
class | CVorbisMisc |
Miscellaneous prototypes. More... | |
class | CVorbisOs |
Functions/types that change per compiler/operating system. More... | |
class | CVorbisPsy |
Random psychoacoustics (not including pre-echo). More... | |
class | CVorbisRegistry |
Registry for time, floor, res backends and channel mappings. More... | |
class | CVorbisRes0 |
Residue backend 0, 1, and 2 implementation. More... | |
class | CVorbisSmallFt |
Fast Fourier transform. More... | |
class | CVorbisStructs |
Various structures from the Vorbis library that can't be placed anywhere else. More... | |
class | CSoundBuffer |
Shared raw sound data. More... | |
class | CSoundListener |
The listener hears all the sounds in the world. More... | |
class | CSoundSource |
Base functionality for sound sources. More... | |
struct | LSS_SOUND_SOURCE_LOAD_PARMS |
class | CStaticSoundSource3d |
class | CStreamingSoundSource |
A source used with streaming audio data. More... | |
class | IStreamingSoundSourceStreamer |
An interface for the retrieval of sound data for use by the CStreamingSoundSource class. More... | |
class | CSoundBufferEx |
Extending the sound buffer with the ability to load files. More... | |
struct | LSE_CORE_SFX_DATA |
class | CWaveLoader |
class | CWaveStreamingSoundSourceStreamer |
A way to stream audio data from .wav files. More... | |
Typedefs | |
typedef ALfloat | LSSREAL |
typedef struct lss::oggpack_buffer * | LPoggpack_buffer |
typedef struct lss::oggpack_buffer | LPCoggpack_buffer |
typedef struct lss::ogg_page * | LPogg_page |
typedef struct lss::ogg_page | LPCogg_page |
typedef struct lss::ogg_stream_state * | LPogg_stream_state |
typedef struct lss::ogg_stream_state | LPCogg_stream_state |
typedef struct lss::ogg_packet * | LPogg_packet |
typedef struct lss::ogg_packet | LPCogg_packet |
typedef struct lss::ogg_sync_state * | LPogg_sync_state |
typedef struct lss::ogg_sync_state | LPCogg_sync_state |
typedef IStreamingSoundSourceStreamer | Parent |
typedef struct lss::vorbis_info_floor0 * | LPvorbis_info_floor0 |
typedef struct lss::vorbis_info_floor0 | LPCvorbis_info_floor0 |
typedef struct lss::vorbis_info_floor1 * | LPvorbis_info_floor1 |
typedef struct lss::vorbis_info_floor1 | LPCvorbis_info_floor1 |
typedef struct lss::vorbis_func_residue * | LPvorbis_func_residue |
typedef struct lss::vorbis_func_residue | LPCvorbis_func_residue |
typedef struct lss::vorbis_info_residue0 * | LPvorbis_info_residue0 |
typedef struct lss::vorbis_info_residue0 | LPCvorbis_info_residue0 |
typedef struct lss::vorbis_func_mapping * | LPvorbis_func_mapping |
typedef struct lss::vorbis_func_mapping | LPCvorbis_func_mapping |
typedef struct lss::private_state | private_state |
typedef struct lss::codec_setup_info | codec_setup_info |
typedef struct lss::vorbis_look_floor1 * | LPvorbis_look_floor1 |
typedef struct lss::vorbis_look_floor1 | LPCvorbis_look_floor1 |
typedef struct lss::LSS_SOUND_SOURCE_LOAD_PARMS * | LPLSS_SOUND_SOURCE_LOAD_PARMS |
typedef struct lss::LSS_SOUND_SOURCE_LOAD_PARMS | LPCLSS_SOUND_SOURCE_LOAD_PARMS |
typedef LSVOID(LSE_CALL * | PfSoundEventHandler )(LSUINTPTR _uiptrUserPtr, CSoundSource *_pssSource, LSUINT32 _ui32EventType, CSoundManager *_psmManager) |
typedef struct lss::LSE_CORE_SFX_DATA * | LPLSE_CORE_SFX_DATA |
typedef struct lss::LSE_CORE_SFX_DATA * | LPCLSE_CORE_SFX_DATA |
Enumerations | |
enum | LSS_VORBIS_ERRORS { OV_FALSE = -1, OV_EOF = -2, OV_HOLE = -3, OV_EREAD = -128, OV_EFAULT = -129, OV_EIMPL = -130, OV_EINVAL = -131, OV_ENOTVORBIS = -132, OV_EBADHEADER = -133, OV_EVERSION = -134, OV_ENOTAUDIO = -135, OV_EBADPACKET = -136, OV_EBADLINK = -137, OV_ENOSEEK = -138, LSS_VE_FORCEDWORD = 0x7FFFFFFF } |
enum | { NOTOPEN = 0, PARTOPEN = 1, OPENED = 2, STREAMSET = 3, INITSET = 4, CHUNKSIZE = 65536, READSIZE = 2048 } |
enum | { VE_PRE = 16, VE_WIN = 4, VE_POST = 2, VE_AMP = (VE_PRE + VE_POST - 1), VE_BANDS = 7, VE_NEARDC = 15, VE_MINSTRETCH = 2, VE_MAXSTRETCH = 12 } |
enum | LSS_VORBIS_BLOCK_SETTINGS { BLOCKTYPE_IMPULSE = 0, BLOCKTYPE_PADDING = 1, BLOCKTYPE_TRANSITION = 0, BLOCKTYPE_LONG = 1 } |
enum | LSS_VORBIS_PACKET { PACKETBLOBS = 15 } |
enum | LSS_VORBIS_BACKEND { VIF_POSIT = 63, VIF_CLASS = 16, VIF_PARTS = 31 } |
enum | LSS_VORBIS_MASKING { MAX_ATH = 88, EHMER_OFFSET = 16, EHMER_MAX = 56 } |
enum | LSS_CODE_BOOK { VQ_FEXP = 10, VQ_FMAN = 21, VQ_FEXP_BIAS = 768 } |
enum | LSS_BLOCKS { WORD_ALIGN = 8 } |
enum | LSS_REGISTRY { VI_TRANSFORMB = 1, VI_WINDOWB = 1, VI_TIMEB = 1, VI_FLOORB = 2, VI_RESB = 3, VI_MAPB = 1 } |
enum | LSS_SOUND_SOURCE { LSS_SS_STATIC = 0x08000000, LSS_SS_3DSTATIC = 0x00000001, LSS_SS_2DSTATIC = 0x00000002, LSS_SS_1DSTATIC = 0x00000003, LSS_SS_STREAMING = 0x01000000, LSS_SS_3DSTREAMING = 0x00000004, LSS_SS_2DSTREAMING = 0x00000005, LSS_SS_1DSTREAMING = 0x00000006, LSS_SS_MASK = 0x00FFFFFF } |
enum | LSS_DATA_SOURCE_STREAMERS { LSS_DSS_BASE = (1UL << 0UL) } |
enum | LSS_STREAMERTYPES { LSS_ST_WAVEFILE = (1UL << 1UL), LSS_ST_OGGFILE = (1UL << 2UL) } |
enum | LSS_ERRORS { LSS_E_INVALID_BUFFER = 0 } |
enum | LSS_EVENT_TYPES { LSS_ET_SOUND_JUST_STARTED, LSS_ET_SOUND_JUST_ENDED } |
Functions | |
virtual LSBOOL LSE_CALL | GetData (LSUINT64 _ui64From, LSUINT64 &_ui64Length, LSUINT8 *&_pui8Data, CAllocator *_paAllocator) const |
virtual LSUINT32 LSE_CALL | GetType () const |
virtual const LSCHAR *LSE_CALL | GetName () const |
virtual LSUINT32 LSE_CALL | GetFrequency () const |
virtual LSUINT32 LSE_CALL | GetBits () const |
virtual LSUINT32 LSE_CALL | GetChannels () const |
virtual LSUINT64 LSE_CALL | GetAudioLength () const |
LSUINT32 LSE_CALL | GetBufferId () const |
virtual LSBOOL LSE_CALL | Play (LSUINT32 _ui32LoopCount=1) |
virtual LSBOOL LSE_CALL | Pause () |
virtual LSBOOL LSE_CALL | Stop () |
virtual LSBOOL LSE_CALL | Static () const |
virtual LSVOID LSE_CALL | SetBuffer (const CSoundBuffer *_psbBuffer) |
virtual LSVOID LSE_CALL | Tick (LSUINT64 _ui64TimeSinceLastUpdate) |
virtual LSBOOL LSE_CALL | DeviceActivated () |
virtual LSVOID LSE_CALL | UpdatePlayState () |
virtual LSVOID LSE_CALL | ApplyStates () |
LSE_CALLCTOR | CSoundManager () |
virtual LSVOID LSE_CALL | SetAllocator (CAllocator *_paAllocator) |
CAllocator *LSE_CALL | GetAllocator () |
virtual LSBOOL LSE_CALL | SetDevice (const LSCHAR *_pcDevice, CString *_pstrError=NULL) |
LSVOID LSE_CALL | Run () |
LSVOID LSE_CALL | Tick () |
LSVOID LSE_CALL | SynchronousUpdate (LSUINTPTR _uiptrUserPtr, PfSoundEventHandler _pfHandler) |
virtual LSVOID LSE_CALL | ResetAllSounds () |
virtual LSVOID LSE_CALL | SoftReset () |
LSUINT32 LSE_CALL | AddBuffer (const LSUINT8 *_pui8Data, LSUINT32 _ui32Length, LSUINT32 _ui32Freq, LSUINT32 _ui32Bits, LSUINT32 _ui32Channels, LSBOOL _bRetain=true, LSUINTPTR _uiptrUserData=0, CString *_pstrError=NULL) |
LSVOID LSE_CALL | RemBuffer (LSUINT32 _ui32Id) |
LSUINT32 LSE_CALL | RemAllUnreferencedBuffers () |
LSBOOL LSE_CALL | AllReferencesToBufferAreStreaming (LSUINT32 _ui32BufferId) const |
const CSoundBuffer *LSE_CALL | FindBufferById (LSUINT32 _ui32Id) const |
const CSoundBuffer *LSE_CALL | FindBufferByIdAndLock (LSUINT32 _ui32Id) const |
LSVOID LSE_CALL | Lock () const |
LSVOID LSE_CALL | UnLock () const |
CSoundListener &LSE_CALL | GetListener () |
CSoundSource *LSE_CALL | AddSourceAndLock (LSS_SOUND_SOURCE _ssType, const LSS_SOUND_SOURCE_LOAD_PARMS &_sslpParms, CString *_pstrError=NULL) |
LSVOID LSE_CALL | RemSource (LSUINT32 _ui32Id) |
CSoundSource *LSE_CALL | FindSourceById (LSUINT32 _ui32Id) |
CSoundSource *LSE_CALL | FindSourceByIdAndLock (LSUINT32 _ui32Id) |
LSBOOL LSE_CALL | AttachBufferToStaticSource (LSUINT32 _ui32SrcId, LSUINT32 _ui32BufferId) |
LSBOOL LSE_CALL | AttachBufferToStaticSource (CSoundSource *_pssSource, LSUINT32 _ui32BufferId) |
LSVOID LSE_CALL | StopAndDeleteAllStaticSources () |
LSVOID LSE_CALL | SetListenerPos (const CVector3 &_svPos) |
LSVOID LSE_CALL | SetListenerVel (const CVector3 &_svVel) |
LSVOID LSE_CALL | SetListenerPosAndVel (const CVector3 &_svPos, const CVector3 &_svVel) |
LSVOID LSE_CALL | SetMasterVolume (LSSREAL _fVolume) |
const CSoundListener &LSE_CALL | GetListenerAndLock () const |
virtual LSVOID LSE_CALL | ResetDevice () |
virtual LSVOID LSE_CALL | ShutDown () |
virtual CSoundBuffer *LSE_CALL | NewBuffer (const LSUINT8 *_pui8Data, LSUINT32 _ui32Length, LSUINT32 _ui32Freq, LSUINT32 _ui32Bits, LSUINT32 _ui32Channels, LSBOOL _bRetain, LSUINTPTR _uiptrUserData) const |
virtual LSVOID LSE_CALL | DeleteBuffer (CSoundBuffer *&_psbBuffer) const |
virtual CSoundSource *LSE_CALL | NewSoundSource (LSS_SOUND_SOURCE _ssType, LSUINT32 _ui32Id) const |
virtual LSVOID LSE_CALL | DeleteSource (CSoundSource *&_pssSource) const |
virtual LSBOOL LSE_CALL | AddStreamer (IStreamingSoundSourceStreamer *_pssssSteamer) |
LSUINT32 LSE_CALL | GetStreamerIndex (const LSCHAR *_pcStreamerName) const |
LSUINT32 LSE_CALL | FindStreamerByName (const LSCHAR *_pcStreamerName) const |
virtual LSVOID LSE_CALL | DeleteStreamer (IStreamingSoundSourceStreamer *_pssssSteamer)=0 |
LSVOID LSE_CALL | FindUniqueSourceId (CSoundSource *&_pssSource) const |
LSUINT32 LSE_CALL | CreateBuffer (const LSCHAR *_pcFile) |
LSUINT32 LSE_CALL | FindBufferByPath (const LSCHAR *_pwcPath) const |
LSCHAR *LSE_CALL | GetBufferPathById (LSUINT32 _ui32Id, LSCHAR *_pcRet) const |
CStaticSoundSource3d *LSE_CALL | Create3dStaticSoundSourceAndLock (const CVector3 &_vPos, LSREAL _fGain=LSM_ONE, LSREAL _fMaxDistance=static_cast< LSREAL >(256.0), const LSCHAR *_pcFile=NULL, LSUINT32 _ui32Id=0UL) |
CStaticSoundSource2d *LSE_CALL | Create2dStaticSoundSourceAndLock (const CVector2 &_vPos, LSREAL _fGain=LSM_ONE, const LSCHAR *_pcFile=NULL) |
LSBOOL LSE_CALL | RegisterWaveForStream (const LSCHAR *_pcFile) |
LSBOOL LSE_CALL | RegisterOggForStream (const LSCHAR *_pcFile) |
LSBOOL LSE_CALL | RegisterSoundForStream (const LSCHAR *_pcFile) |
CStreamingSoundSource *LSE_CALL | Create2dStreamSoundSourceAndLock (const LSCHAR *_pcName, const CVector2 &_vPos, LSREAL _fGain=LSM_ONE) |
LSUINT32 LSE_CALL | Play2dStreamEx (const LSCHAR *_pcName, const CVector2 &_vPos=CVector2(LSM_ZERO, LSM_ZERO), LSREAL _fGain=LSM_ONE, LSUINT32 _ui32Loop=CSoundSource::LSS_LM_INFINITE, LSBOOL _bOnlyPlayIfNotPlaying=true, LSBOOL _bClearAllStreamsIfPlayed=true) |
LSUINT32 LSE_CALL | SoundIsStreaming (const LSCHAR *_pcName) const |
LSVOID LSE_CALL | ClearAllStreamsExcept (LSUINT32 _ui32Id) |
Variables | |
F | __pad0__ |
LSUINTPTR | iov_len |
* | LPogg_iovec_t |
*const | LPCogg_iovec_t |
F CAllocator * | _paAllocator |
CVorbisFile::LSS_OV_FILE | m_ovfFile |
LSCHAR * | m_pcPath |
CAllocator * | m_paAllocator |
LSUINT64 | m_ui64SoundTime |
LSUINT64 | m_ui64Pcms |
CVorbisCodec::vorbis_info * | m_pviInfo |
F COgg::oggpack_buffer *CVorbisStructs::vorbis_info_floor(* | unpack )(CVorbisCodec::vorbis_info *, COgg::oggpack_buffer *) |
CVorbisStructs::vorbis_look_floor *(* | look )(CVorbisCodec::vorbis_dsp_state *, CVorbisStructs::vorbis_info_floor *) |
LSVOID(* | free_info )(CVorbisStructs::vorbis_info_floor *) |
LSVOID(* | free_look )(CVorbisStructs::vorbis_look_floor *) |
LSVOID *(* | inverse1 )(CVorbisCodec::vorbis_block *, CVorbisStructs::vorbis_look_floor *) |
LSINT32(* | inverse2 )(CVorbisCodec::vorbis_block *, CVorbisStructs::vorbis_look_floor *, LSVOID *buffer, LSFLOAT *) |
* | LPvorbis_func_floor |
*const | LPCvorbis_func_floor |
LSFLOAT | ampmax |
LSINT32 | blocktype |
COgg::oggpack_buffer * | packetblob [PACKETBLOBS] |
* | LPvorbis_block_internal |
*const | LPCvorbis_block_internal |
const CSoundBuffer * | m_psbBuffer |
LSBOOL | m_bPlayStateDirty |
CCriticalSection | m_csCriticalSection |
LSBOOL | m_bAllocatorIsPrivate |
LSINT32 | m_i32LockCount |
CTime | m_tTime |
volatile LSBOOL | m_bRun |
LSH_THREAD | m_hThread |
ALCdevice * | m_pdDevice |
ALCcontext * | m_pcContext |
CVectorPoD< CSoundBuffer *, LSUINT32 > | m_psbBuffers |
CMap< LSUINT32, CSoundSource * > | m_pssSources |
CVectorPoD < IStreamingSoundSourceStreamer * > | m_pssssStreamers |
CSoundListener | m_slListener |
CVectorPoD< LSE_CORE_SFX_DATA > | m_csdSfxData |
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Uses the IStreamingSoundSourceStreamer interface to provide a way to stream audio data from an Ogg file into a CStreamingSoundSource object.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: The Vorbis and Ogg libraries are extremely messy. The locations of certain structures is fairly illogical, functions that are declared in a single header are defined in multiple translation units, and #include's are thrown around everywhere, not just at the tops of files. Circular dependencies are created all over the place when the code is restructured properly. To eliminate this, we place some structures that do not rely on any other structures in this class/file.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Buffers are the shared sound data. Load a WAV or OGG (etc.) file and its raw PCM data will be held in a buffer which sound sources (CSoundSource) can use to play. This is shared data, following exactly the same concept as with 3D models, which are loaded once and then instanced. This class forms the shared sound data and CSoundSource forms the instances of the sound data played at various locations in the game world. This class cannot be instanced directly. Use CSoundManager to create instances of these.
There are 2 possible system states when these objects are created: One where there is a valid device already set and one without a valid device. Additionally, these buffers must support changing devices during run-time. Normally we could impose a restriction that requires a device to be set when buffers are created, but the fact is, because we need a system that allows changing devices anyway, it becomes very simple to modify the class just slightly so that it can handle both cases instead of only one. This allows us to impose no restrictions on the device state with no extra development time. Nice!
When the buffer is created it will be given a pointer to data which it will copy and store. The buffer can be set to keep the copy for forever or to free it once it has sent the copy to the hardware. Creating a buffer does not automatically make it try to send anything to hardware. The sound manager will, as soon as a device is ready (which will be immediately if there is already a device) notify the buffer that there is a device, and the buffer will then upload its contents. If set to free its copy it will do so then. The same notification is used to tell the buffer that a new device has been set, and the buffer will react the same way by uploading and optionally freeing its copy.
When the buffer needs to upload its copy to the hardware, it may have a NULL copy as a result of having uploaded and freed it previously. In this case the buffer calls the virtual function GetOriginalData(). the default implementation returns failure and the re-upload will fail. Therefore, if this class is not subclassed, and the user has the ability to change devices, the buffers must never be set to automatically free their copies. If the device can be changed, in order to save RAM this class should be subclassed so that the buffers may be flushed after being sent to the sound system.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: The listener hears all the sounds in the world. There is only one listener in the game at a time. The gain property controls the master volume of all sound in the game.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Base functionality for sound sources. Sources are like instances of 3D models. The shared data is part of the CSoundBuffer class and this class maintains references to them. This class is just the base class for sound sources. There are 2 types of sources: static and streaming. They connect to buffers differently (actually streaming uses its own buffers), but share all of the same properties. This class provides all of the similar properties and the CStaticSoundSource and CStreamingSoundSource inherit from this and add their own methods for connecting to buffers.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Parameters passed when creating a sound source. This is easier to extend and pass than a bunch of parameters.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: DESCRIPTION.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: A static sound emenating from somewhere in the world. The world positions are not defined here. Does not use streaming.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: A static sound emenating from somewhere in a 3D world. Does not use streaming. The source is not relative to the listener.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: A 2D streaming sound source. Typically used for background music. All streaming sounds default to resisting soft resets, so this stream is prepared to continue playing across state changes, until manually stopped.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: A streaming sound source needs an abstract way to stream data from a source (file/memory/ network/etc.) This class provides an interface for the retrieval of sound data for use by the CStreamingSoundSource class.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Adding the ability to load data from files to the sound engine. We use the user parameter passed to the constructor (_uiptrUserData) as a LSCHAR * indicating the file to load. The name of the file is copied locally.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Add more streamer types, because the core sound engine only defines the base streaming type which cannot even be instanciated.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: The basic manager for sound throughout the engine. This is the hotspot that organizes and manages all sound resources, sound objects, and sound devices.
Run() and Stop() should be called from the same thread.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Add our own functionality to the sound library. We extend it to support loading of files and a few special effects. We also make it easy to play sounds and include the ability to delay-load sounds and perform automatic unloading of sounds.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Loads a wave file to RAM using the given allocator. Returns information regarding the loaded file.
Copyright L. Spiro 2011 All rights reserved.
Written by: Shawn (L. Spiro) Wilcoxen
This code may not be sold or traded for any personal gain without express written consent. You may use this code in your own projects and modify it to suit your needs as long as this disclaimer remains intact. You may not take credit for having written this code.
Description: Uses the IStreamingSoundSourceStreamer interface to provide a way to stream audio data from a wave file into a CStreamingSoundSource object.
typedef struct lss::codec_setup_info lss::codec_setup_info |
Setup information.
typedef struct lss::LSS_SOUND_SOURCE_LOAD_PARMS * lss::LPLSS_SOUND_SOURCE_LOAD_PARMS |
Parameters passed when creating a sound source. This is easier to extend and pass than a bunch of parameters.
typedef struct lss::ogg_packet * lss::LPogg_packet |
Ogg packet. Used to encapsulate the data and metadata belonging to a single raw Ogg/Vorbis packet.
typedef struct lss::ogg_page * lss::LPogg_page |
Ogg page. Used to encapsulate the data in one Ogg bitstream page.
typedef struct lss::ogg_sync_state * lss::LPogg_sync_state |
Ogg sync state.
typedef struct lss::oggpack_buffer * lss::LPoggpack_buffer |
Ogg pack buffer.
typedef struct lss::vorbis_func_mapping * lss::LPvorbis_func_mapping |
Undocumented Vorbis structure.
typedef struct lss::vorbis_func_residue * lss::LPvorbis_func_residue |
Undocumented Vorbis structure.
typedef struct lss::vorbis_info_floor0 * lss::LPvorbis_info_floor0 |
Undocumented Vorbis structure.
typedef struct lss::vorbis_info_floor1 * lss::LPvorbis_info_floor1 |
Undocumented Vorbis structure.
typedef struct lss::vorbis_info_residue0 * lss::LPvorbis_info_residue0 |
Undocumented Vorbis structure.
typedef struct lss::vorbis_look_floor1 * lss::LPvorbis_look_floor1 |
Undocumented Vorbis library structure.
typedef LSVOID(LSE_CALL * lss::PfSoundEventHandler)(LSUINTPTR _uiptrUserPtr, CSoundSource *_pssSource, LSUINT32 _ui32EventType, CSoundManager *_psmManager) |
Callback function prototype to handle sound events synchronously.
_uiptrUserPtr | User data passed to the synchronous update routine in the sound manager. |
_pssSource | The sound source that raised the event. |
_ui32EventType | The type of event raised. |
_psmManager | A pointer to the sound manager that owns the sound. |
typedef struct lss::private_state lss::private_state |
Private state.
anonymous enum |
File library values.
anonymous enum |
Envelope settings.
enum lss::LSS_BLOCKS |
Blocks.
enum lss::LSS_CODE_BOOK |
Codebook.
Types of data-source streamers. Extend this to add custom ones.
enum lss::LSS_ERRORS |
Error conditions.
enum lss::LSS_EVENT_TYPES |
Event types.
enum lss::LSS_REGISTRY |
Registry.
The types of sound sources there are.
Add more streamer types, because the core sound engine only defines the base streaming type which cannot even be instanciated.
Backend settings.
Block settings.
Vorbis error codes.
Masking.
Packet settings.
LSUINT32 LSE_CALL lss::AddBuffer | ( | const LSUINT8 * | _pui8Data, |
LSUINT32 | _ui32Length, | ||
LSUINT32 | _ui32Freq, | ||
LSUINT32 | _ui32Bits, | ||
LSUINT32 | _ui32Channels, | ||
LSBOOL | _bRetain = true , |
||
LSUINTPTR | _uiptrUserData = 0 , |
||
CString * | _pstrError = NULL |
||
) |
Add a buffer with the given data. No device needs to be set. The data will be uploaded to the hardware when a device is available. Returns the ID of the buffer or CSoundBuffer::LSS_E_INVALID_BUFFER. _uiptrUserData is user data to be supplied to the created buffer. It has no meaning in the context of this library. Use it to pass special application-specific data to a custom (subclassed) CSoundBuffer object such as a file name etc. ** Must not be locked.
_pui8Data | The buffer data. |
_ui32Length | Number of bytes in the buffer. |
_ui32Freq | Frquency of the buffer. |
_ui32Bits | Buffer bit count. |
_ui32Channels | Number of channels in the buffer. |
_bRetain | If true, the buffer will keep a copy of the buffer even after it has sent it to the hardware. This uses more RAM, but if the device is lost the buffer can reset its data on its own. |
_uiptrUserData | User data. |
_pstrError | Holds the optional returned error string if an error occurs. |
CSoundSource* LSE_CALL lss::AddSourceAndLock | ( | LSS_SOUND_SOURCE | _ssType, |
const LSS_SOUND_SOURCE_LOAD_PARMS & | _sslpParms, | ||
CString * | _pstrError = NULL |
||
) |
Add a source with the given data. No buffer is attached to the source at this point, and the source cannot yet be used to play sounds. Returns the pointer to the created source. If the returned pointer is not NULL, you must call UnLock() when you are done with the returned pointer.
_ssType | The type of the source to create. Can be LSS_SS_3DSTATIC, LSS_SS_2DSTATIC, LSS_SS_1DSTATIC LSS_SS_3DSTREAMING, LSS_SS_2DSTREAMING, or LSS_SS_1DSTREAMING. |
_sslpParms | Parameters to apply to the loaded source. |
_pstrError | If not NULL and there is an error creating the source, this will be filled with the error text. |
virtual LSBOOL LSE_CALL lss::AddStreamer | ( | IStreamingSoundSourceStreamer * | _pssssSteamer | ) | [protected, virtual] |
Add a streamer to our internal list of streamers. If the streamer does not have a unique name, the results are unpredictable when later referencing this streamer by name.
The streamer to add. Must have been created externally.
LSBOOL LSE_CALL lss::AllReferencesToBufferAreStreaming | ( | LSUINT32 | _ui32BufferId | ) | const |
Determine if all references to a buffer are from streaming sources.
_ui32BufferId | The buffer ID to check. |
LSVOID LSE_CALL lss::ApplyStates | ( | ) | [protected, virtual] |
Apply states to the hardware or sound system (OpenAL for example). Does not clear the dirty flag.
LSBOOL LSE_CALL lss::AttachBufferToStaticSource | ( | LSUINT32 | _ui32SrcId, |
LSUINT32 | _ui32BufferId | ||
) |
Attach a buffer to a static source. Does not need to be locked. Returns false if the attachment was not made for any reason (source or buffer ID's are invalid).
_ui32SrcId | ID of the source. |
_ui32BufferId | ID of the buffer to attach to the source. |
LSBOOL LSE_CALL lss::AttachBufferToStaticSource | ( | CSoundSource * | _pssSource, |
LSUINT32 | _ui32BufferId | ||
) |
Attach a buffer to a static source. Returns false if the attachment was not made for any reason (source is not static or buffer ID is invalid). ** Must be locked.
_pssSource | Source to which to attach the buffer. |
_ui32BufferId | ID of the buffer to attach to the source. |
LSVOID LSE_CALL lss::ClearAllStreamsExcept | ( | LSUINT32 | _ui32Id | ) |
Clear all straming sounds whose ID's do not match the given ID.
_ui32Id | ID of the sound not to clear. |
CStaticSoundSource2d* LSE_CALL lss::Create2dStaticSoundSourceAndLock | ( | const CVector2 & | _vPos, |
LSREAL | _fGain = LSM_ONE , |
||
const LSCHAR * | _pcFile = NULL |
||
) |
Load (but do not play) a sound at a specified 2D location. The loaded sound is returned and UnLock() must be called when the sound pointer is no longer needed (after all settings have been applied to it). If the given file has not been loaded, it is loaded. The buffer to be associated with the source is optional; if provided the file will automatically be loaded (if not already) and added as a buffer. Common parameters for 2D sounds are provided here. Others can be set via the returned pointer.
_vPos | The 2D position of the source. |
_fGain | The volume of the source from 0 to 1 inclusive. |
_pcFile | The file containing the sound for this source. If already loaded, the existing buffer is used. |
CStreamingSoundSource* LSE_CALL lss::Create2dStreamSoundSourceAndLock | ( | const LSCHAR * | _pcName, |
const CVector2 & | _vPos, | ||
LSREAL | _fGain = LSM_ONE |
||
) |
Stream a 2D sound. The sound is referenced by name. If registered with Register*ForStream(), the name is the file path. ** Must not be locked.
_pcName | Name of the registered stream to begin playing. |
CStaticSoundSource3d* LSE_CALL lss::Create3dStaticSoundSourceAndLock | ( | const CVector3 & | _vPos, |
LSREAL | _fGain = LSM_ONE , |
||
LSREAL | _fMaxDistance = static_cast< LSREAL >(256.0) , |
||
const LSCHAR * | _pcFile = NULL , |
||
LSUINT32 | _ui32Id = 0UL |
||
) |
Load (but do not play) a sound at a specified 3D location. The loaded sound is returned and UnLock() must be called when the sound pointer is no longer needed (after all settings have been applied to it). If the given file has not been loaded, it is loaded. The buffer to be associated with the source is optional; if provided the file will automatically be loaded (if not already) and added as a buffer. Common parameters for 3D sounds are provided here. Others can be set via the returned pointer.
_vPos | The 3D position of the source. |
_fGain | The volume of the source from 0 to 1 inclusive. |
_fMaxDistance | Maximum distance at which the source can be heard. |
_pcFile | The file containing the sound for this source. If already loaded, the existing buffer is used. |
_ui32Id | The unique ID for this sound source or 0 to have a new ID generated. Unique ID's begin at LSS_UNIQUE_ID. If a sound source with the given unique ID exists it will be stopped and deleted, unless NULL is returned. |
LSUINT32 LSE_CALL lss::CreateBuffer | ( | const LSCHAR * | _pcFile | ) |
Create a buffer from a file. If the buffer has already been created, no operation is performed. ** Must not be locked.
_pcFile | Sound file to load. |
LSVOID LSE_CALL lss::DeleteBuffer | ( | CSoundBuffer *& | _psbBuffer | ) | const [protected, virtual] |
Destroy a buffer the same way it was created.
_psbBuffer | The buffer to destroy. |
LSVOID LSE_CALL lss::DeleteSource | ( | CSoundSource *& | _pssSource | ) | const [protected, virtual] |
Destroy a sound source the same way it was created.Destroy a sound source the same way it was created.
_pssSource | The sound source to destroy. |
Destroy a sound source the same way it was created.
_pssSource | The sound source to delete. |
LSVOID LSE_CALL lss::DeleteStreamer | ( | IStreamingSoundSourceStreamer * | _pssssSteamer | ) | [protected, pure virtual] |
Creation of the streamers is done by the overriding class. Thus deletion must also be handled by them.
_pssssSteamer | The streamer to be deleted. |
LSBOOL LSE_CALL lss::DeviceActivated | ( | ) | [protected, virtual] |
Notifies us that the given device has become active and we should send our buffer to it. A return of false from this function indicates the buffer could not be uploaded. This is considered a critical error by the engine.
A device has been created. We can register with the hardware. The sound manager notifies us of this event after the device has been changed. If there is a device already when we are created, we are notified via this function immediately after being created.
const CSoundBuffer* LSE_CALL lss::FindBufferById | ( | LSUINT32 | _ui32Id | ) | const |
Find a buffer given its ID. Uses a binary search. ** Must be locked.
_ui32Id | The ID of the buffer to be found. |
const CSoundBuffer* LSE_CALL lss::FindBufferByIdAndLock | ( | LSUINT32 | _ui32Id | ) | const |
Find a buffer given its ID. Uses a binary search. If the buffer pointer is returned, this object remains locked. When done with the returned pointer, call UnLock(). The returned pointer must not be used after calling UnLock().
_ui32Id | The ID of the buffer to be found. |
LSUINT32 LSE_CALL lss::FindBufferByPath | ( | const LSCHAR * | _pwcPath | ) | const |
Find a buffer by path.
_pwcPath | The path for which to search the loaded buffers. |
CSoundSource* LSE_CALL lss::FindSourceById | ( | LSUINT32 | _ui32Id | ) |
Get a source by ID. If found, returns a pointer to the source. If not found, NULL is returned. ** Must be locked.
_ui32Id | ID of the source to find. |
CSoundSource* LSE_CALL lss::FindSourceByIdAndLock | ( | LSUINT32 | _ui32Id | ) |
Same as FindSourceById(), except that it automatically locks the sound manager. If NULL is returned, the sound manager is unlocked. If a pointer is returned, the sound manager must be unlocked as soon as the pointer is done being used.
_ui32Id | ID of the source to find. |
LSUINT32 LSE_CALL lss::FindStreamerByName | ( | const LSCHAR * | _pcStreamerName | ) | const [protected] |
Find a streamer by name. Performs a binary search
_pcName | the name of the streamer to find. |
LSVOID LSE_CALL lss::FindUniqueSourceId | ( | CSoundSource *& | _pssSource | ) | const [protected] |
Find a unique ID and assign it to the given sound source. If no ID could be found, the sound source is deleted.
_pssSource | The sound source for which to find a unique ID. |
CAllocator* LSE_CALL lss::GetAllocator | ( | ) |
Get our allocator.
Gets our allocator.
Get our allocator.
virtual LSUINT64 LSE_CALL lss::GetAudioLength | ( | ) | const [virtual] |
Get the length of the data in microseconds.
virtual LSUINT32 LSE_CALL lss::GetBits | ( | ) | const [virtual] |
Get the number of bits per channel of the data.
LSUINT32 LSE_CALL lss::GetBufferId | ( | ) | const |
Get the ID of the buffer we reference, if any.
LSCHAR* LSE_CALL lss::GetBufferPathById | ( | LSUINT32 | _ui32Id, |
LSCHAR * | _pcRet | ||
) | const |
Get a buffer path by buffer ID. _pcRet must be at least LSF_MAX_PATH characters long.
_ui32Id | ID of the buffer whose path is to be returned. |
_pcRet | The string to be filled with the returned path, if any. |
virtual LSUINT32 LSE_CALL lss::GetChannels | ( | ) | const [virtual] |
Get the number of channels of the data.
virtual LSBOOL LSE_CALL lss::GetData | ( | LSUINT64 | _ui64From, |
LSUINT64 & | _ui64Length, | ||
LSUINT8 *& | _pui8Data, | ||
CAllocator * | _paAllocator | ||
) | const [virtual] |
Retrieve sound data for use by the CStreamingSoundSource class.
_ui64From | The offset within the data source to get the data, in microseconds. |
_ui64Length | The length of the data to get, in microseconds. If the function succeeds, this holds the returned length of the data in bytes. |
_pui8Data | The returned data. |
_paAllocator | The allocator to be used to allocate the data to which _pui8Data will point on a successful return. |
virtual LSUINT32 LSE_CALL lss::GetFrequency | ( | ) | const [virtual] |
Get the frequency of the data.
CSoundListener& LSE_CALL lss::GetListener | ( | ) |
Get the listener. This allows reading and writing, so you can set its position/volume/etc. directly. Changes will take place on the next tick of the sound manager. ** Must be locked.
CSoundListener &LSE_CALL lss::GetListenerAndLock | ( | ) | const |
virtual const LSCHAR* LSE_CALL lss::GetName | ( | ) | const [virtual] |
Get the name of the streamer. Here it is the file path.
LSUINT32 LSE_CALL lss::GetStreamerIndex | ( | const LSCHAR * | _pcStreamerName | ) | const [protected] |
Get the index in the streamer list where a streamer with the given name should be added.
_pcStreamerName | Name of the streamer whose index is to be located. |
LSS_SOUND_SOURCE LSE_CALL lss::GetType | ( | ) | const [virtual] |
Get the type of this streamer. Returns LSS_ST_OGGFILE along with the parent type.
Get the type of this source.
LSVOID LSE_CALL lss::Lock | ( | ) | const |
Lock this object for thread-safe access to its contents. Accessing buffers, sources, and the listener while not locked will result in failure.
CSoundBuffer *LSE_CALL lss::NewBuffer | ( | const LSUINT8 * | _pui8Data, |
LSUINT32 | _ui32Length, | ||
LSUINT32 | _ui32Freq, | ||
LSUINT32 | _ui32Bits, | ||
LSUINT32 | _ui32Channels, | ||
LSBOOL | _bRetain, | ||
LSUINTPTR | _uiptrUserData | ||
) | const [protected, virtual] |
Create a new buffer. If you subclass CSoundBuffer, you must override this to create the class of your new type. This function's job is only to create instances of buffer objects. This function does not link them to the list of buffers, etc.
_pui8Data | The buffer data. |
_ui32Length | Number of bytes in the buffer. |
_ui32Freq | Frquency of the buffer. |
_ui32Bits | Buffer bit count. |
_ui32Channels | Number of channels in the buffer. |
_bRetain | If true, the buffer will keep a copy of the buffer even after it has sent it to the hardware. This uses more RAM, but if the device is lost the buffer can reset its data on its own. |
_uiptrUserData | User data. |
Use extended buffers we have the ability to get data from files when needed (when the device changes).
_pui8Data | Sound data to pass to the buffer. |
_ui32Length | Length, in bytes, of the data passed to the buffer. |
_ui32Freq | Frequency of the data passed to the sound buffer. |
_ui32Bits | Bits per channel of the data passed to the sound buffer. |
_ui32Channels | Channels in the data passed to the sound buffer. |
_bRetain | If true, the buffer will keep a local copy of the data. Otherwise it will dump it after sending it to the hardware to save memory. |
_uiptrUserData | A character pointer to a string indicating the path from which the buffer was created. |
CSoundSource *LSE_CALL lss::NewSoundSource | ( | LSS_SOUND_SOURCE | _ssType, |
LSUINT32 | _ui32Id | ||
) | const [protected, virtual] |
Create a new source. There are a few types of sources. If you want to add more, override this function in a subclass and add them. This function's only job is to create the instances. It does not link them to the master list etc.
_ssType | Type of source to create. |
_ui32Id | Id of the sound to create. 0 is used to generate a unique ID. |
Create extended sound sources not available in the case sound manager.
_ssType | The type of sound source to create. |
_ui32Id | Id of the sound to create. 0 is used to generate a unique ID. |
virtual LSBOOL LSE_CALL lss::Pause | ( | ) | [virtual] |
Pause the sound. If there is no buffer, returns false.
virtual LSBOOL LSE_CALL lss::Play | ( | LSUINT32 | _ui32LoopCount = 1 | ) | [virtual] |
Begin playing the sound. If there is no buffer, returns false. The sound plays regardless of whether or not there is a sound device. If there is no sound device, the sound will begin playing at the correct position when a device becomes active. The sound begins playing on the next tick event.
_ui32LoopCount | Number of times to loop the sound. |
LSUINT32 LSE_CALL lss::Play2dStreamEx | ( | const LSCHAR * | _pcName, |
const CVector2 & | _vPos = CVector2(LSM_ZERO, LSM_ZERO) , |
||
LSREAL | _fGain = LSM_ONE , |
||
LSUINT32 | _ui32Loop = CSoundSource::LSS_LM_INFINITE , |
||
LSBOOL | _bOnlyPlayIfNotPlaying = true , |
||
LSBOOL | _bClearAllStreamsIfPlayed = true |
||
) |
Play a registered stream at a given 2D position. Returns the ID of the created sound source which can be used to make modifications to the sound after loading. ** Must not be locked.
_pcName | Name of the stream, previously registered with a call to Register*ForStream() to play. |
_vPos | Position where to play the stream. |
_fGain | The volume of the source from 0 to 1 inclusive. |
_ui32Loop | The number of times to loop the sound. |
_bOnlyPlayIfNotPlaying | If true, the sound will not play if already being played. |
_bClearAllStreamsIfPlayed | If true, and the sound is actually played, all other streaming sounds will be stopped. |
LSBOOL LSE_CALL lss::RegisterOggForStream | ( | const LSCHAR * | _pcFile | ) |
Register a streaming sound in an Ogg file. The file must be a valid .ogg file.
_pcFile | The UTF-8 path to the file. |
LSBOOL LSE_CALL lss::RegisterSoundForStream | ( | const LSCHAR * | _pcFile | ) |
Register a streaming sound in a supported sound file. The file must be a valid sound file.
_pcFile | The UTF-8 path to the file. |
LSBOOL LSE_CALL lss::RegisterWaveForStream | ( | const LSCHAR * | _pcFile | ) |
Play a sound effect at a given 3D position using a returned ID from a registered LSE_SFX_DATA structure. Buffer is loaded if not loaded already. Loop count and expiration dates are set according to the data registered with the system.
_ui32SfxId | The ID of the registered sound effect containing the parameters for playing the sound. |
_vPos | The 3D position of the source. |
_fGain | The volume of the source from 0 to 1 inclusive. |
_fMaxDistance | Maximum distance at which the source can be heard. |
_ui32SfxId | The ID of the registered sound effect containing the parameters for playing the sound. |
_vPos | The 2D position of the source. |
_fGain | The volume of the source from 0 to 1 inclusive. |
_sdData | An LSE_SFX_DATA structure containing the parameters for the sound effect. |
_ui32SfxId | The ID of the registered sound effect to unregister. |
_pcFile | The UTF-8 path to the file. |
LSUINT32 LSE_CALL lss::RemAllUnreferencedBuffers | ( | ) |
Remove all unreferenced buffers. ** Must not be locked.
LSVOID LSE_CALL lss::RemBuffer | ( | LSUINT32 | _ui32Id | ) |
Remove a buffer by ID. ** Must not be locked.
_ui32Id | ID of teh buffer to remove. |
LSVOID LSE_CALL lss::RemSource | ( | LSUINT32 | _ui32Id | ) |
Remove a source by ID. ** Must not be locked.
_ui32Id | ID of the source to remove. |
LSVOID LSE_CALL lss::ResetAllSounds | ( | ) | [virtual] |
Stop and remove all sources and buffers, and apply default parameters to the listener.
virtual LSVOID LSE_CALL lss::ResetDevice | ( | ) | [protected, virtual] |
Close the current device, if any. All buffers and sources are destroyed. But sound resources are not lost. Only their connections to the hardware are.
LSVOID LSE_CALL lss::Run | ( | ) |
Runs the sound manager loop. The loop is run on a new thread. This causes the sound manager to tick repeatedly, updating sources and the listener until requested to stop. During a single tick, sources and the listener may not be accessed. The loop rests for 16 milliseconds between ticks, making spins/waits unlikely.
LSVOID LSE_CALL lss::SetAllocator | ( | CAllocator * | _paAllocator | ) | [virtual] |
Set the allocator used by the sound system. This causes all resources to be reset and lost. This should be done only once at start-up, before any resources are created. _paAllocator may be NULL.
_paAllocator | The allocator to be used by this class or NULL to use the global heap. |
Set the allocator used by the sound system. This causes all resources to be reset and lost. This should be done only once at start-up, before any resources are created. _paAllocator may be NULL.
_paAllocator | The allocator to be used by the sound engine. |
virtual LSVOID LSE_CALL lss::SetBuffer | ( | const CSoundBuffer * | _psbBuffer | ) | [virtual] |
Set the buffer. Does not cause playing. NULL is valid.
_psbBuffer | The possibly shared buffer to be used by this source. |
virtual LSBOOL LSE_CALL lss::SetDevice | ( | const LSCHAR * | _pcDevice, |
CString * | _pstrError = NULL |
||
) | [virtual] |
Set the current device. Causes all existing resources to be reloaded automatically. Only one device may be set at a time. If _pcDevice is NULL or an empty string, the default device is used.
_pcDevice | The device to set. |
_pstrError | Returned error if any. |
LSVOID LSE_CALL lss::SetListenerPos | ( | const CVector3 & | _svPos | ) |
The most common function performed on the listener is to set its position. This function makes doing so easy. Does not need to be locked.
_svPos | New listener position. |
LSVOID LSE_CALL lss::SetListenerPosAndVel | ( | const CVector3 & | _svPos, |
const CVector3 & | _svVel | ||
) |
This function allows setting both position and velocity at the same time on the listener. Does not need to be locked.
_svPos | New listener position. |
_svVel | New listener velocity. |
LSVOID LSE_CALL lss::SetListenerVel | ( | const CVector3 & | _svVel | ) |
Setting the listener velocity is common. Does not need to be locked.
_svVel | New listener velocity. |
LSVOID LSE_CALL lss::SetMasterVolume | ( | LSSREAL | _fVolume | ) |
Set the master volume. Ths sets the gain on the listener internally. Does not need to be locked.
_fVolume | New master volume. |
virtual LSVOID LSE_CALL lss::ShutDown | ( | ) | [protected, virtual] |
Reset the whole sound engine. Releases all resources.
LSVOID LSE_CALL lss::SoftReset | ( | ) | [virtual] |
Perform a soft reset. This removes unreferenced data and stops sounds that are not soft-reset-safe.
LSUINT32 LSE_CALL lss::SoundIsStreaming | ( | const LSCHAR * | _pcName | ) | const |
Determine if the given sound is already streaming.
_pcName | name of the stream to check. This name must match one of the names provided in a call to one of the Register*ForStream() functions. |
virtual LSBOOL LSE_CALL lss::Static | ( | ) | const [virtual] |
Is this source static (non-streaming)?
LSVOID LSE_CALL lss::Stop | ( | ) | [virtual] |
Stop the sound. Sets the position back to 0 and waits for a play command.
Stops the sound thread. Does not return until the thread as been fully stopped and closed.
LSVOID LSE_CALL lss::StopAndDeleteAllStaticSources | ( | ) |
Stop and delete all static sources. ** Must not be locked.
LSVOID LSE_CALL lss::SynchronousUpdate | ( | LSUINTPTR | _uiptrUserPtr, |
PfSoundEventHandler | _pfHandler | ||
) |
Perform a synchronous update of all sound sources. This is always executed on the main game thread and is used for issuing synchronous game events such as the beginning/ending of sounds.
_uiptrUserPtr | User data passed during the update on the main thread. |
_pfHandler | Pointer to a function used to handle events synchronously. |
virtual LSVOID LSE_CALL lss::Tick | ( | LSUINT64 | _ui64TimeSinceLastUpdate | ) | [virtual] |
Update the source. This usually entails checking the dirty flag and updating the hardware accordingly. Time is given in microseconds.
_ui64TimeSinceLastUpdate | Microseconds by which to update. |
LSVOID LSE_CALL lss::Tick | ( | ) |
Tick once. Updates time and all objects.
LSVOID LSE_CALL lss::UnLock | ( | ) | const |
Unlock its contents. Items cannot be added while locked.
virtual LSVOID LSE_CALL lss::UpdatePlayState | ( | ) | [protected, virtual] |
Update the play state.
LSBOOL lss::m_bPlayStateDirty |
Is our play state dirty?
The Ogg file.
CAllocator * lss::m_paAllocator |
The allocator we use.
LSCHAR* lss::m_pcPath |
The path to this wave file in UTF-8 format. This also serves as the name of the object.
const CSoundBuffer* lss::m_psbBuffer |
The buffer to which we are attached.
File information.
LSUINT64 lss::m_ui64Pcms |
Number of PCM's.
LSUINT64 lss::m_ui64SoundTime |
Length of the sound in microseconds.