| 114 | } |
| 115 | |
| 116 | bool CInstrumentManager::DeepCloneInstrument(unsigned OldIndex, unsigned NewIndex) { // // // |
| 117 | if (CloneInstrument(OldIndex, NewIndex)) { |
| 118 | if (auto pInstrument = std::dynamic_pointer_cast<CSeqInstrument>(GetInstrument(NewIndex))) { |
| 119 | const inst_type_t it = pInstrument->GetType(); |
| 120 | for (auto i : enum_values<sequence_t>()) { |
| 121 | int freeSeq = GetFreeSequenceIndex(it, i, pInstrument.get()); |
| 122 | if (freeSeq != -1) { |
| 123 | if (pInstrument->GetSeqEnable(i)) |
| 124 | *GetSequence(it, i, unsigned(freeSeq)) = *pInstrument->GetSequence(i); // // // |
| 125 | pInstrument->SetSeqIndex(i, freeSeq); |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | return true; |
| 130 | } |
| 131 | |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | void CInstrumentManager::SwapInstruments(unsigned int IndexA, unsigned int IndexB) { |
| 136 | std::lock_guard<std::mutex> lock(m_InstrumentLock); |
no test coverage detected