MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / TriggerInstrument

Method TriggerInstrument

Source/InstHandlerDPCM.cpp:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void CInstHandlerDPCM::TriggerInstrument()
38{
39 CChannelHandlerInterfaceDPCM *pInterface = dynamic_cast<CChannelHandlerInterfaceDPCM*>(m_pInterface);
40 if (pInterface == nullptr) return;
41 if (auto pDPCMInst = std::dynamic_pointer_cast<const CInstrument2A03>(m_pInstrument)) {
42 if (const int Val = m_pInterface->GetNote(); Val != -1) {
43 if (auto pSamp = pDPCMInst->GetDSample(Val)) {
44 pInterface->WriteDCOffset(pDPCMInst->GetSampleDeltaValue(Val));
45 pInterface->SetLoopOffset(pDPCMInst->GetSampleLoopOffset(Val));
46 pInterface->PlaySample(pSamp, pDPCMInst->GetSamplePitch(Val));
47 }
48 }
49 }
50}
51
52void CInstHandlerDPCM::ReleaseInstrument()
53{

Callers

nothing calls this directly

Calls 8

WriteDCOffsetMethod · 0.80
GetSampleDeltaValueMethod · 0.80
SetLoopOffsetMethod · 0.80
GetSampleLoopOffsetMethod · 0.80
PlaySampleMethod · 0.80
GetSamplePitchMethod · 0.80
GetNoteMethod · 0.45
GetDSampleMethod · 0.45

Tested by

no test coverage detected