Amuse
AudioGroupSampleDirectory.hpp
1 #ifndef __AMUSE_AUDIOGROUPSAMPLEDIR_HPP__
2 #define __AMUSE_AUDIOGROUPSAMPLEDIR_HPP__
3 
4 #include <unordered_map>
5 #include <stdint.h>
6 
7 namespace amuse
8 {
9 
12 {
13  friend class AudioGroup;
14 public:
15  struct Entry
16  {
17  uint16_t m_sfxId;
18  uint32_t m_sampleOff;
19  uint32_t m_unk;
20  uint8_t m_pitch;
21  uint16_t m_sampleRate;
22  uint32_t m_numSamples;
23  uint32_t m_loopStartSample;
24  uint32_t m_loopLengthSamples;
25  uint32_t m_adpcmParmOffset;
26  void swapBig();
27  };
28  struct ADPCMParms
29  {
30  uint16_t m_bytesPerFrame;
31  uint8_t m_ps;
32  uint8_t m_lps;
33  int16_t m_hist1;
34  int16_t m_hist2;
35  int16_t m_coefs[8][2];
36  void swapBig();
37  };
38 private:
39  std::unordered_map<uint16_t, std::pair<Entry, ADPCMParms>> m_entries;
40 public:
41  AudioGroupSampleDirectory(const unsigned char* data);
42 };
43 
44 }
45 
46 #endif // __AMUSE_AUDIOGROUPSAMPLEDIR_HPP__