| 420 | } |
| 421 | |
| 422 | bool 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 | |
| 447 | bool CChannelHandler::CreateInstHandler(inst_type_t Type) |
| 448 | { |
nothing calls this directly
no test coverage detected