Fix naming

This commit is contained in:
Christian Semmler 2024-12-18 14:12:40 -07:00
parent 9546ecbd9e
commit 53ad22c0b0
2 changed files with 14 additions and 14 deletions

View File

@ -94,10 +94,10 @@ class MxWavePresenter : public MxSoundPresenter {
// In (most) other cases, data is streamed through the ring buffer `m_rb`. // In (most) other cases, data is streamed through the ring buffer `m_rb`.
ma_pcm_rb m_rb; ma_pcm_rb m_rb;
struct { struct {
ma_audio_buffer buffer; ma_audio_buffer m_buffer;
MxU8* data; MxU8* m_data;
MxU32 length; MxU32 m_length;
MxU32 offset; MxU32 m_offset;
} m_ab; } m_ab;
ma_sound m_sound; ma_sound m_sound;

View File

@ -41,8 +41,8 @@ void MxWavePresenter::Destroy(MxBool p_fromDestructor)
{ {
ma_sound_uninit(&m_sound); ma_sound_uninit(&m_sound);
ma_pcm_rb_uninit(&m_rb); ma_pcm_rb_uninit(&m_rb);
ma_audio_buffer_uninit(&m_ab.buffer); ma_audio_buffer_uninit(&m_ab.m_buffer);
delete[] m_ab.data; delete[] m_ab.m_data;
if (m_waveFormat) { if (m_waveFormat) {
delete[] ((MxU8*) m_waveFormat); delete[] ((MxU8*) m_waveFormat);
@ -59,9 +59,9 @@ void MxWavePresenter::Destroy(MxBool p_fromDestructor)
MxBool MxWavePresenter::WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length) MxBool MxWavePresenter::WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length)
{ {
if (m_action->IsLooping()) { if (m_action->IsLooping()) {
assert(m_ab.offset + p_length <= m_ab.length); assert(m_ab.m_offset + p_length <= m_ab.m_length);
memcpy(m_ab.data + m_ab.offset, p_audioPtr, p_length); memcpy(m_ab.m_data + m_ab.m_offset, p_audioPtr, p_length);
m_ab.offset += p_length; m_ab.m_offset += p_length;
return TRUE; return TRUE;
} }
else { else {
@ -137,14 +137,14 @@ void MxWavePresenter::StartingTickle()
sampleRate sampleRate
); );
m_ab.length = ma_get_bytes_per_frame(format, channels) * sizeInFrames; m_ab.m_length = ma_get_bytes_per_frame(format, channels) * sizeInFrames;
m_ab.data = new MxU8[m_ab.length]; m_ab.m_data = new MxU8[m_ab.m_length];
ma_audio_buffer_config config = ma_audio_buffer_config config =
ma_audio_buffer_config_init(format, channels, sizeInFrames, m_ab.data, NULL); ma_audio_buffer_config_init(format, channels, sizeInFrames, m_ab.m_data, NULL);
config.sampleRate = sampleRate; config.sampleRate = sampleRate;
if (ma_audio_buffer_init(&config, &m_ab.buffer) != MA_SUCCESS) { if (ma_audio_buffer_init(&config, &m_ab.m_buffer) != MA_SUCCESS) {
goto done; goto done;
} }
} }
@ -165,7 +165,7 @@ void MxWavePresenter::StartingTickle()
if (ma_sound_init_from_data_source( if (ma_sound_init_from_data_source(
MSoundManager()->GetEngine(), MSoundManager()->GetEngine(),
m_action->IsLooping() ? (ma_data_source*) &m_ab.buffer : (ma_data_source*) &m_rb, m_action->IsLooping() ? (ma_data_source*) &m_ab.m_buffer : (ma_data_source*) &m_rb,
m_is3d ? 0 : MA_SOUND_FLAG_NO_SPATIALIZATION, m_is3d ? 0 : MA_SOUND_FLAG_NO_SPATIALIZATION,
NULL, NULL,
&m_sound &m_sound