OpenBarnyard
 
Loading...
Searching...
No Matches
ASoundManager::Cue Class Reference

#include <ASoundManager.h>

Inheritance diagram for ASoundManager::Cue:

Public Member Functions

 Cue ()
 
 ~Cue ()
 
void Reset ()
 
TBOOL HasEventOfType (SOUNDEVENT a_eEventType) const
 
TBOOL IsUsed () const
 

Public Attributes

TBOOL bUsed
 
TFLOAT fStartTime
 
ASoundpSound
 
TFLOAT fStartTime2
 
Toshi::TVector4 vecPosition
 
TFLOAT fVolume
 
TFLOAT fFrequency
 
TINT iNumChannelRefs
 
Toshi::T2DList< ChannelRefoChannelRefs
 
SoundEventList oEventList
 
Toshi::T2DList< ChannelRefLegacyaChannelRefsLegacy [2]
 
Toshi::T2Vector< TINT, 15 > vecLoopStarts
 

Detailed Description

Definition at line 174 of file ASoundManager.h.

Constructor & Destructor Documentation

◆ Cue()

ASoundManager::Cue::Cue ( )

Definition at line 1654 of file ASoundManager.cpp.

1655{
1656
1657 bUsed = TFALSE;
1658 pSound = TNULL;
1659 fStartTime = 0.0f;
1660 fStartTime2 = 0.0f;
1662 fVolume = 1.0f;
1663 fFrequency = 1.0f;
1664 oEventList = new ( AMemory::GetMemBlock( AMemory::POOL_Sound ) ) SoundEventList::Type();
1665}
#define TNULL
Definition Typedefs.h:23
#define TFALSE
Definition Typedefs.h:24
static const constinit TVector4 VEC_ZERO
Definition TVector4.h:358
@ POOL_Sound
Definition AMemory.h:37
static Toshi::TMemory::MemBlock * GetMemBlock(POOL a_ePool)
Definition AMemory.cpp:38
Toshi::TVector4 vecPosition
SoundEventList oEventList

◆ ~Cue()

ASoundManager::Cue::~Cue ( )

Definition at line 1667 of file ASoundManager.cpp.

1668{
1669 if ( oEventList.GetNodeValue() )
1670 delete oEventList.GetNodeValue();
1671}

Member Function Documentation

◆ HasEventOfType()

TBOOL ASoundManager::Cue::HasEventOfType ( SOUNDEVENT a_eEventType) const

Definition at line 1727 of file ASoundManager.cpp.

1728{
1729 T2_FOREACH( *oEventList.GetNodeValue(), it )
1730 {
1731 if ( it->eEventType == a_eEventType )
1732 return TTRUE;
1733 }
1734
1735 return TFALSE;
1736}
#define T2_FOREACH(vecName, iteratorName)
Definition T2Iterator.h:4
#define TTRUE
Definition Typedefs.h:25

◆ IsUsed()

TBOOL ASoundManager::Cue::IsUsed ( ) const
inline

Definition at line 184 of file ASoundManager.h.

184{ return fStartTime > 0.0f; }

◆ Reset()

void ASoundManager::Cue::Reset ( )

Definition at line 1673 of file ASoundManager.cpp.

1674{
1675 ASoundManager* pSoundManager = ASoundManager::GetSingleton();
1676
1677 T2_FOREACH( aChannelRefsLegacy[ 1 ], it )
1678 {
1679 it->fnCallback( 1, GetCueIndex( this ), it->pUserData );
1680 }
1681
1682 bUsed = TFALSE;
1683 fStartTime = -1.0f;
1684 fStartTime2 = -1.0f;
1685 pSound = TNULL;
1686
1687 // Reset waves used by the channel refs
1688 T2_FOREACH( oChannelRefs, channelRef )
1689 {
1690 channelRef->pSample->pWaveBank->ResetWave( channelRef->pSample->iId );
1691 }
1692
1693 // Delete allocated sound events
1694 while ( !oEventList->IsEmpty() )
1695 {
1696 SoundEvent* pSoundEvent = oEventList->PopFront();
1697 pSoundManager->m_SoundEventPool.FreeObject( pSoundEvent );
1698 }
1699
1700 if ( oEventList.IsLinked() )
1701 oEventList.Remove();
1702
1703 // Delete all channel refs of Type2
1704 for ( TINT i = 0; i < TARRAYSIZE( aChannelRefsLegacy ); i++ )
1705 {
1706 while ( !aChannelRefsLegacy[ i ].IsEmpty() )
1707 {
1708 ChannelRefLegacy* pChannelRef = aChannelRefsLegacy[ i ].PopFront();
1709 pSoundManager->m_ChannelRefLegacyPool.DeleteObject( pChannelRef );
1710 }
1711 }
1712
1713 iNumChannelRefs = 0;
1714
1715 while ( !oChannelRefs.IsEmpty() )
1716 {
1717 ChannelRef* pChannelRef = oChannelRefs.PopFront();
1718 pSoundManager->m_ChannelRefPool.DeleteObject( pChannelRef );
1719 }
1720
1721 vecLoopStarts.Clear();
1722
1723 if ( IsLinked() )
1724 Remove();
1725}
#define TARRAYSIZE(ARRAY)
Definition Defines.h:70
int TINT
Definition Typedefs.h:7
Toshi::T2DList< ChannelRef > oChannelRefs
Toshi::T2DList< ChannelRefLegacy > aChannelRefsLegacy[2]
Toshi::T2Vector< TINT, 15 > vecLoopStarts

Member Data Documentation

◆ aChannelRefsLegacy

Toshi::T2DList<ChannelRefLegacy> ASoundManager::Cue::aChannelRefsLegacy[2]

Definition at line 197 of file ASoundManager.h.

◆ bUsed

TBOOL ASoundManager::Cue::bUsed

Definition at line 187 of file ASoundManager.h.

◆ fFrequency

TFLOAT ASoundManager::Cue::fFrequency

Definition at line 193 of file ASoundManager.h.

◆ fStartTime

TFLOAT ASoundManager::Cue::fStartTime

Definition at line 188 of file ASoundManager.h.

◆ fStartTime2

TFLOAT ASoundManager::Cue::fStartTime2

Definition at line 190 of file ASoundManager.h.

◆ fVolume

TFLOAT ASoundManager::Cue::fVolume

Definition at line 192 of file ASoundManager.h.

◆ iNumChannelRefs

TINT ASoundManager::Cue::iNumChannelRefs

Definition at line 194 of file ASoundManager.h.

◆ oChannelRefs

Toshi::T2DList<ChannelRef> ASoundManager::Cue::oChannelRefs

Definition at line 195 of file ASoundManager.h.

◆ oEventList

SoundEventList ASoundManager::Cue::oEventList

Definition at line 196 of file ASoundManager.h.

◆ pSound

ASound* ASoundManager::Cue::pSound

Definition at line 189 of file ASoundManager.h.

◆ vecLoopStarts

Toshi::T2Vector<TINT, 15> ASoundManager::Cue::vecLoopStarts

Definition at line 198 of file ASoundManager.h.

◆ vecPosition

Toshi::TVector4 ASoundManager::Cue::vecPosition

Definition at line 191 of file ASoundManager.h.


The documentation for this class was generated from the following files: