isle/LEGO1/mxaudiomanager.cpp

79 lines
1.3 KiB
C++
Raw Normal View History

#include "mxaudiomanager.h"
DECOMP_SIZE_ASSERT(MxAudioManager, 0x30);
// GLOBAL: LEGO1 0x10102108
MxS32 MxAudioManager::g_unkCount = 0;
// OFFSET: LEGO1 0x100b8d00
MxAudioManager::MxAudioManager()
{
2023-10-24 19:38:27 -04:00
Init();
}
// OFFSET: LEGO1 0x100b8d90
MxAudioManager::~MxAudioManager()
{
2023-10-24 19:38:27 -04:00
Destroy(TRUE);
}
// OFFSET: LEGO1 0x100b8df0
void MxAudioManager::Init()
{
2023-10-24 19:38:27 -04:00
this->m_volume = 100;
}
// OFFSET: LEGO1 0x10029910
MxS32 MxAudioManager::GetVolume()
{
2023-10-24 19:38:27 -04:00
return this->m_volume;
}
// OFFSET: LEGO1 0x100b8ea0
void MxAudioManager::SetVolume(MxS32 p_volume)
{
2023-10-24 19:38:27 -04:00
this->m_criticalSection.Enter();
this->m_volume = p_volume;
this->m_criticalSection.Leave();
}
// OFFSET: LEGO1 0x100b8e00
void MxAudioManager::Destroy(MxBool p_fromDestructor)
{
2023-10-24 19:38:27 -04:00
this->m_criticalSection.Enter();
g_unkCount--;
Init();
this->m_criticalSection.Leave();
2023-10-24 19:38:27 -04:00
if (!p_fromDestructor)
MxMediaManager::Destroy();
}
// OFFSET: LEGO1 0x100b8e40
MxResult MxAudioManager::InitPresenters()
{
2023-10-24 19:38:27 -04:00
MxResult result = FAILURE;
MxBool success = FALSE;
2023-10-24 19:38:27 -04:00
if (MxMediaManager::InitPresenters() == SUCCESS) {
this->m_criticalSection.Enter();
success = TRUE;
result = SUCCESS;
g_unkCount++;
}
2023-10-24 19:38:27 -04:00
if (result)
Destroy();
2023-10-24 19:38:27 -04:00
if (success)
this->m_criticalSection.Leave();
2023-10-24 19:38:27 -04:00
return result;
}
// OFFSET: LEGO1 0x100b8e90
void MxAudioManager::Destroy()
{
2023-10-24 19:38:27 -04:00
Destroy(FALSE);
}