mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
Reorganize sources and files (#414)
* Reorganize sources * Refactor * Remove relative paths * Renames * Fix gitignore * Remove stuff * Try fixing format script * Fix format * Fix format * Fix naming script * Test format * Fix format
This commit is contained in:
committed by
GitHub
parent
6a85e62406
commit
c47206617d
50
LEGO1/omni/src/audio/mxloopingmidipresenter.cpp
Normal file
50
LEGO1/omni/src/audio/mxloopingmidipresenter.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
#include "mxloopingmidipresenter.h"
|
||||
|
||||
#include "decomp.h"
|
||||
#include "mxdssound.h"
|
||||
#include "mxmusicmanager.h"
|
||||
#include "mxomni.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxLoopingMIDIPresenter, 0x58);
|
||||
|
||||
// FUNCTION: LEGO1 0x100c2a80
|
||||
void MxLoopingMIDIPresenter::StreamingTickle()
|
||||
{
|
||||
if (m_action->GetLoopCount()) {
|
||||
MxMIDIPresenter::StreamingTickle();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_chunk) {
|
||||
m_chunk = NextChunk();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_chunk->GetTime() + m_action->GetDuration() <= m_action->GetElapsedTime()) {
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Done;
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100c2ae0
|
||||
void MxLoopingMIDIPresenter::DoneTickle()
|
||||
{
|
||||
if (m_action->GetLoopCount())
|
||||
MxMIDIPresenter::DoneTickle();
|
||||
else
|
||||
EndAction();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100c2b00
|
||||
MxResult MxLoopingMIDIPresenter::PutData()
|
||||
{
|
||||
m_criticalSection.Enter();
|
||||
|
||||
if (m_currentTickleState == TickleState_Streaming && m_chunk && !MusicManager()->GetMIDIInitialized()) {
|
||||
SetVolume(((MxDSSound*) m_action)->GetVolume());
|
||||
MusicManager()->FUN_100c09c0(m_chunk->GetData(), !m_action->GetLoopCount() ? -1 : m_action->GetLoopCount());
|
||||
}
|
||||
|
||||
m_criticalSection.Leave();
|
||||
return SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user