OpenBarnyard
 
Loading...
Searching...
No Matches
ASoundBank.h
Go to the documentation of this file.
1#pragma once
2#include "ASoundLegacy.h"
3#include "ASound.h"
4
5#include <Toshi/T2DList.h>
6#include <Toshi/TPString8.h>
7
8class ASoundBank : public Toshi::T2DList<ASoundBank>::Node
9{
10public:
11 friend class ASoundManager;
12
13public:
14 constexpr ASoundBank( TINT a_iNumSounds )
15 : m_iNumSounds( a_iNumSounds ), m_pSoundsEx( TNULL ), m_pSounds( TNULL )
16 {}
17
19 {
20 if ( m_pSoundsEx )
21 delete[] m_pSoundsEx;
22
23 if ( m_pSounds )
24 delete[] m_pSounds;
25 }
26
27 void Load()
28 {
29 for ( TINT i = 0; i < m_iNumSounds; i++ )
30 {
31 for ( TINT k = 0; k < m_pSoundsEx[ i ].GetSamples().Size(); k++ )
32 {
33 ASound::Sample& rSample = m_pSoundsEx[ i ].GetSamples()[ k ];
34 rSample.iFrequency = TINT( rSample.pWaveBank->GetWaveFrequency( rSample.iId ) * rSample.fPitch );
35 }
36 }
37 }
38
39private:
40 TINT m_iNumSounds;
41 Toshi::TPString8 m_strName;
42 ASound* m_pSoundsEx;
43 ASoundLegacy* m_pSounds;
44};
#define TNULL
Definition Typedefs.h:23
int TINT
Definition Typedefs.h:7
TINT iFrequency
Definition ASound.h:27
AWaveBank * pWaveBank
Definition ASound.h:19
TFLOAT fPitch
Definition ASound.h:24
void Load()
Definition ASoundBank.h:27
friend class ASoundManager
Definition ASoundBank.h:11
constexpr ASoundBank(TINT a_iNumSounds)
Definition ASoundBank.h:14
TINT GetWaveFrequency(TINT a_iWaveIndex)
Definition AWaveBank.cpp:59