| 35 | } |
| 36 | |
| 37 | void 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 | |
| 52 | void CInstHandlerDPCM::ReleaseInstrument() |
| 53 | { |
nothing calls this directly
no test coverage detected