TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
iSoundFactory Struct Referenceabstract
Inheritance diagram for iSoundFactory:
iUnknown

Detailed Description

Sound factory interface.

Driver

virtual tU32 GetNumDrivers () const =0
 Get the number of sound drivers available. {Property}. More...
 
virtual iSoundDriverGetDriver (tU32 anIndex) const =0
 Get the driver at the specified index. {Property}. More...
 
virtual iHStringGetDriverName (tU32 anIndex) const =0
 Get the name of the sound driver at the specified index. {Property}. More...
 
virtual tSoundDriverCapFlags GetDriverCaps (tU32 anIndex) const =0
 Get the caps of the sound driver at the specified index. {Property}. More...
 
virtual tU32 GetDriverIndex (iHString *ahspName) const =0
 Get the index of the driver with the specified name. {Property}. More...
 
virtual tBool StartupDriver (tU32 anDriver, eSoundFormat aFormat, tU32 anFrequency, tIntPtr aWindowHandle)=0
 Initialize the specified sound driver. More...
 
virtual tBool ShutdownDriver ()=0
 Shutdown the current sound driver. More...
 
virtual tU32 GetActiveDriver () const =0
 Get the active driver. {Property}. More...
 
virtual iSoundDriverBufferGetBuffer () const =0
 Get the driver's sound buffer. {Property}. More...
 
virtual iSoundMixerGetMixer () const =0
 Get the sound mixer. {Property}. More...
 
virtual iSoundMixer3DGetMixer3D () const =0
 Get the 3d sound mixer. {Property}. More...
 
virtual tBool SwitchIn ()=0
 To call when the application is activated. More...
 
virtual tBool SwitchOut ()=0
 To call when the application is deactivated. More...
 

General

tU32 FindFreeChannel (eSoundMode aMode) const
 Find the first free channel. More...
 
tU32 FindFreeChannelPriority (eSoundMode aMode, tU32 anPriority) const
 Find the first free channel, possibily over a used channel with the specified priority. More...
 
virtual tBool Update (ni::tF32 afDeltaTime)=0
 Update the sounds. More...
 

Sound Data, Sound Buffer & Sound Source

virtual iSoundDataLoadSoundData (iFile *apFile)=0
 Load sound data from the specified file. More...
 
virtual iSoundBufferCreateSoundBufferEx (iSoundData *apData, tBool abStream, iHString *ahspName=NULL)=0
 Create a sound buffer from the specified sound data. More...
 
virtual iSoundBufferCreateSoundBuffer (iFile *apFile, tBool abStream, iHString *ahspName=NULL)=0
 Create a sound buffer from the specified file. More...
 
virtual ni::iSoundBufferCreateSoundBufferFromRes (ni::iHString *ahspName, ni::tBool abStream)=0
 Create a sound buffer from the specified resource. More...
 
virtual iSoundBufferGetSoundBuffer (iHString *ahspName)=0
 Get the sound buffer with the given name. {Property}. More...
 
virtual iSoundSourceCreateSoundSource (iSoundBuffer *apBuffer)=0
 Create a new sound source. More...
 

Listener

virtual void SetListenerPosition (const sVec3f &aV)=0
 Set the listener's position. {Property}. More...
 
virtual sVec3f GetListenerPosition () const =0
 Get the listener's position. {Property}. More...
 
virtual void SetListenerVelocity (const sVec3f &aV)=0
 Set the listener's velocity. {Property}. More...
 
virtual sVec3f GetListenerVelocity () const =0
 Get the listener's velocity. {Property}. More...
 
virtual void SetListenerForward (const sVec3f &aV)=0
 Set the listener's forward/looking direction. {Property}. More...
 
virtual sVec3f GetListenerForward () const =0
 Get the listener's forward/looking direction. {Property}. More...
 
virtual void SetListenerUp (const sVec3f &aV)=0
 Set the listener's up direction. {Property}. More...
 
virtual sVec3f GetListenerUp () const =0
 Get the listener's up direction. {Property}. More...
 
virtual void SetListenerDistanceScale (tF32 afScale)=0
 Set the listener's distance scale. {Property}. More...
 
virtual tF32 GetListenerDistanceScale () const =0
 Get the listener's distance scale. {Property}. More...
 
virtual void SetListenerRolloffScale (tF32 afScale)=0
 Set the listener's rolloff scale. {Property}. More...
 
virtual tF32 GetListenerRolloffScale () const =0
 Get the listener's rolloff scale. {Property}. More...
 
virtual void SetListenerDopplerScale (tF32 afScale)=0
 Set the listener's doppler scale. {Property}. More...
 
virtual tF32 GetListenerDopplerScale () const =0
 Get the listener's doppler scale. {Property}. More...
 

Music playback API

virtual ni::tBool MusicPlay (iSoundSource *apSoundSource, ni::tF32 afVolume, ni::tF32 afSpeed, ni::tF32 afBlendTime)=0
 Play a music. More...
 
virtual ni::tBool MusicStop (ni::tF32 afBlendTime)=0
 Stop the current music. More...
 
virtual ni::tBool MusicSpeed (ni::tF32 afSpeed, ni::tF32 afBlendTime)=0
 Set the new speed of the music. More...
 
virtual ni::tBool MusicVolume (ni::tF32 afVolume, ni::tF32 afBlendTime)=0
 Set the new volume of the music. More...
 

Additional Inherited Members

- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual tU32 GetNumDrivers ( ) const
pure virtual

Get the number of sound drivers available. {Property}.

virtual iSoundDriver* GetDriver ( tU32  anIndex) const
pure virtual

Get the driver at the specified index. {Property}.

virtual iHString* GetDriverName ( tU32  anIndex) const
pure virtual

Get the name of the sound driver at the specified index. {Property}.

virtual tSoundDriverCapFlags GetDriverCaps ( tU32  anIndex) const
pure virtual

Get the caps of the sound driver at the specified index. {Property}.

virtual tU32 GetDriverIndex ( iHString ahspName) const
pure virtual

Get the index of the driver with the specified name. {Property}.

virtual tBool StartupDriver ( tU32  anDriver,
eSoundFormat  aFormat,
tU32  anFrequency,
tIntPtr  aWindowHandle 
)
pure virtual

Initialize the specified sound driver.

Parameters
anDriveris the index of the driver to start. If eInvalidHandle the best driver available will be selected.
aFormatis the format to use in the driver.
anFrequencyis the frequency to use in the driver.
aWindowHandle,ifnot NULL specify the window handle to pass to the sound driver. This is ignored by some drivers, and is usefull only when using the sound module without the full SDK, since the SDK will already holds a proper window handle.
Remarks
The bits, channels and frequency parameters are used mostly by the software sound mixer, with a hardware accelerated mixer driver those parameters might be ignored.
virtual tBool ShutdownDriver ( )
pure virtual

Shutdown the current sound driver.

virtual tU32 GetActiveDriver ( ) const
pure virtual

Get the active driver. {Property}.

virtual iSoundDriverBuffer* GetBuffer ( ) const
pure virtual

Get the driver's sound buffer. {Property}.

virtual iSoundMixer* GetMixer ( ) const
pure virtual

Get the sound mixer. {Property}.

virtual iSoundMixer3D* GetMixer3D ( ) const
pure virtual

Get the 3d sound mixer. {Property}.

virtual tBool SwitchIn ( )
pure virtual

To call when the application is activated.

virtual tBool SwitchOut ( )
pure virtual

To call when the application is deactivated.

tU32 FindFreeChannel ( eSoundMode  aMode) const

Find the first free channel.

tU32 FindFreeChannelPriority ( eSoundMode  aMode,
tU32  anPriority 
) const

Find the first free channel, possibily over a used channel with the specified priority.

virtual tBool Update ( ni::tF32  afDeltaTime)
pure virtual

Update the sounds.

virtual iSoundData* LoadSoundData ( iFile apFile)
pure virtual

Load sound data from the specified file.

virtual iSoundBuffer* CreateSoundBufferEx ( iSoundData apData,
tBool  abStream,
iHString ahspName = NULL 
)
pure virtual

Create a sound buffer from the specified sound data.

virtual iSoundBuffer* CreateSoundBuffer ( iFile apFile,
tBool  abStream,
iHString ahspName = NULL 
)
pure virtual

Create a sound buffer from the specified file.

Remarks
This method will load sound data internally.
virtual ni::iSoundBuffer* CreateSoundBufferFromRes ( ni::iHString ahspName,
ni::tBool  abStream 
)
pure virtual

Create a sound buffer from the specified resource.

virtual iSoundBuffer* GetSoundBuffer ( iHString ahspName)
pure virtual

Get the sound buffer with the given name. {Property}.

virtual iSoundSource* CreateSoundSource ( iSoundBuffer apBuffer)
pure virtual

Create a new sound source.

virtual void SetListenerPosition ( const sVec3f aV)
pure virtual

Set the listener's position. {Property}.

virtual sVec3f GetListenerPosition ( ) const
pure virtual

Get the listener's position. {Property}.

virtual void SetListenerVelocity ( const sVec3f aV)
pure virtual

Set the listener's velocity. {Property}.

virtual sVec3f GetListenerVelocity ( ) const
pure virtual

Get the listener's velocity. {Property}.

virtual void SetListenerForward ( const sVec3f aV)
pure virtual

Set the listener's forward/looking direction. {Property}.

virtual sVec3f GetListenerForward ( ) const
pure virtual

Get the listener's forward/looking direction. {Property}.

virtual void SetListenerUp ( const sVec3f aV)
pure virtual

Set the listener's up direction. {Property}.

virtual sVec3f GetListenerUp ( ) const
pure virtual

Get the listener's up direction. {Property}.

virtual void SetListenerDistanceScale ( tF32  afScale)
pure virtual

Set the listener's distance scale. {Property}.

Remarks
By default 0.1 - aka the default unit system 10 units = 1 meter
virtual tF32 GetListenerDistanceScale ( ) const
pure virtual

Get the listener's distance scale. {Property}.

virtual void SetListenerRolloffScale ( tF32  afScale)
pure virtual

Set the listener's rolloff scale. {Property}.

virtual tF32 GetListenerRolloffScale ( ) const
pure virtual

Get the listener's rolloff scale. {Property}.

virtual void SetListenerDopplerScale ( tF32  afScale)
pure virtual

Set the listener's doppler scale. {Property}.

virtual tF32 GetListenerDopplerScale ( ) const
pure virtual

Get the listener's doppler scale. {Property}.

virtual ni::tBool MusicPlay ( iSoundSource apSoundSource,
ni::tF32  afVolume,
ni::tF32  afSpeed,
ni::tF32  afBlendTime 
)
pure virtual

Play a music.

virtual ni::tBool MusicStop ( ni::tF32  afBlendTime)
pure virtual

Stop the current music.

virtual ni::tBool MusicSpeed ( ni::tF32  afSpeed,
ni::tF32  afBlendTime 
)
pure virtual

Set the new speed of the music.

virtual ni::tBool MusicVolume ( ni::tF32  afVolume,
ni::tF32  afBlendTime 
)
pure virtual

Set the new volume of the music.