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

Method HandleInstrument

Source/ChannelHandler.cpp:422–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422bool CChannelHandler::HandleInstrument(bool Trigger, bool NewInstrument) // // //
423{
424 auto pManager = m_pSoundGen->GetInstrumentManager();
425 if (!pManager)
426 return false;
427 std::shared_ptr<CInstrument> pInstrument = pManager->GetInstrument(m_iInstrument);
428 if (!pInstrument)
429 return false;
430
431 // load instrument here
432 inst_type_t instType = pInstrument->GetType();
433 if (NewInstrument)
434 CreateInstHandler(instType);
435 m_iInstTypeCurrent = instType;
436
437 if (!m_pInstHandler)
438 return false;
439 if (NewInstrument)
440 m_pInstHandler->LoadInstrument(pInstrument);
441 if (Trigger || m_bForceReload)
442 m_pInstHandler->TriggerInstrument();
443
444 return true;
445}
446
447bool CChannelHandler::CreateInstHandler(inst_type_t Type)
448{

Callers

nothing calls this directly

Calls 5

GetInstrumentManagerMethod · 0.45
GetInstrumentMethod · 0.45
GetTypeMethod · 0.45
LoadInstrumentMethod · 0.45
TriggerInstrumentMethod · 0.45

Tested by

no test coverage detected