2023-09-19 10:42:39 -04:00
|
|
|
#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();
|
2023-09-19 10:42:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b8d90
|
|
|
|
MxAudioManager::~MxAudioManager()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
Destroy(TRUE);
|
2023-09-19 10:42:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b8df0
|
|
|
|
void MxAudioManager::Init()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
this->m_volume = 100;
|
2023-10-05 16:06:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x10029910
|
|
|
|
MxS32 MxAudioManager::GetVolume()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
return this->m_volume;
|
2023-10-05 16:06:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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();
|
2023-09-19 10:42:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b8e00
|
2023-10-13 12:43:45 -04:00
|
|
|
void MxAudioManager::Destroy(MxBool p_fromDestructor)
|
2023-09-19 10:42:39 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
this->m_criticalSection.Enter();
|
|
|
|
g_unkCount--;
|
|
|
|
Init();
|
|
|
|
this->m_criticalSection.Leave();
|
2023-09-19 10:42:39 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!p_fromDestructor)
|
|
|
|
MxMediaManager::Destroy();
|
2023-09-19 10:42:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b8e40
|
|
|
|
MxResult MxAudioManager::InitPresenters()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
MxResult result = FAILURE;
|
|
|
|
MxBool success = FALSE;
|
2023-09-19 10:42:39 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (MxMediaManager::InitPresenters() == SUCCESS) {
|
|
|
|
this->m_criticalSection.Enter();
|
|
|
|
success = TRUE;
|
|
|
|
result = SUCCESS;
|
|
|
|
g_unkCount++;
|
|
|
|
}
|
2023-09-19 10:42:39 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (result)
|
|
|
|
Destroy();
|
2023-09-19 10:42:39 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (success)
|
|
|
|
this->m_criticalSection.Leave();
|
2023-09-19 10:42:39 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return result;
|
2023-09-19 10:42:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b8e90
|
|
|
|
void MxAudioManager::Destroy()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
Destroy(FALSE);
|
2023-09-19 10:42:39 -04:00
|
|
|
}
|