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

Method PlaySample

Source/Channels2A03.cpp:672–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672void CDPCMChan::PlaySample(std::shared_ptr<const ft0cc::doc::dpcm_sample> pSamp, int Pitch) // // //
673{
674 int SampleSize = pSamp->size();
675 if (auto *p2A03 = dynamic_cast<C2A03 *>(m_pAPU->GetSoundChip(sound_chip_t::APU)))
676 p2A03->WriteSample(std::move(pSamp)); // // //
677 m_iPeriod = m_iCustomPitch != -1 ? m_iCustomPitch : Pitch;
678 m_iSampleLength = (SampleSize >> 4) - (m_iOffset << 2);
679 m_iLoopLength = SampleSize - m_iLoopOffset;
680 m_bEnabled = true;
681 m_bRetrigger = true;
682 m_iLoop = (Pitch & 0x80) >> 1;
683 m_iRetriggerCntr = m_iRetrigger;
684}
685
686void CDPCMChan::ClearRegisters()
687{

Callers 1

TriggerInstrumentMethod · 0.80

Calls 3

sizeMethod · 0.45
GetSoundChipMethod · 0.45
WriteSampleMethod · 0.45

Tested by

no test coverage detected