2016-05-03 01:16:26 +00:00
|
|
|
#include "amuse/AudioGroup.hpp"
|
|
|
|
#include "amuse/AudioGroupData.hpp"
|
|
|
|
|
|
|
|
namespace amuse
|
|
|
|
{
|
|
|
|
|
2016-05-28 02:28:59 +00:00
|
|
|
AudioGroup::AudioGroup(const AudioGroupData& data, GCNDataTag)
|
2016-07-14 04:54:46 +00:00
|
|
|
: m_proj(data.getProj(), GCNDataTag{})
|
|
|
|
, m_pool(data.getPool())
|
|
|
|
, m_sdir(data.getSdir(), GCNDataTag{})
|
|
|
|
, m_samp(data.getSamp())
|
|
|
|
, m_fmt(DataFormat::GCN)
|
|
|
|
{
|
|
|
|
}
|
2016-05-28 02:28:59 +00:00
|
|
|
|
2016-05-29 18:22:20 +00:00
|
|
|
AudioGroup::AudioGroup(const AudioGroupData& data, bool absOffs, N64DataTag)
|
2016-07-14 04:54:46 +00:00
|
|
|
: m_proj(data.getProj(), absOffs, N64DataTag{})
|
|
|
|
, m_pool(data.getPool())
|
|
|
|
, m_sdir(data.getSdir(), data.getSamp(), absOffs, N64DataTag{})
|
|
|
|
, m_samp(data.getSamp())
|
|
|
|
, m_fmt(DataFormat::N64)
|
|
|
|
{
|
|
|
|
}
|
2016-05-28 02:28:59 +00:00
|
|
|
|
2016-05-29 18:22:20 +00:00
|
|
|
AudioGroup::AudioGroup(const AudioGroupData& data, bool absOffs, PCDataTag)
|
2016-07-14 04:54:46 +00:00
|
|
|
: m_proj(data.getProj(), absOffs, PCDataTag{})
|
|
|
|
, m_pool(data.getPool(), PCDataTag{})
|
|
|
|
, m_sdir(data.getSdir(), absOffs, PCDataTag{})
|
|
|
|
, m_samp(data.getSamp())
|
|
|
|
, m_fmt(DataFormat::PC)
|
|
|
|
{
|
|
|
|
}
|
2016-05-03 01:16:26 +00:00
|
|
|
|
2016-05-11 04:48:08 +00:00
|
|
|
const Sample* AudioGroup::getSample(int sfxId) const
|
2016-05-03 01:16:26 +00:00
|
|
|
{
|
2016-05-14 22:38:37 +00:00
|
|
|
auto search = m_sdir.m_entries.find(sfxId);
|
|
|
|
if (search == m_sdir.m_entries.cend())
|
|
|
|
return nullptr;
|
|
|
|
return &search->second;
|
2016-05-03 01:16:26 +00:00
|
|
|
}
|
|
|
|
|
2016-07-14 04:54:46 +00:00
|
|
|
const unsigned char* AudioGroup::getSampleData(uint32_t offset) const { return m_samp + offset; }
|
2016-05-03 01:16:26 +00:00
|
|
|
}
|