| 294 | } |
| 295 | |
| 296 | bool CInstrumentEditorDPCM::InsertSample(std::shared_ptr<ft0cc::doc::dpcm_sample> pNewSample) // // // |
| 297 | { |
| 298 | auto *pManager = GetDSampleManager(); |
| 299 | int FreeSlot = pManager->GetFirstFree(); |
| 300 | |
| 301 | // Out of sample slots |
| 302 | if (FreeSlot == -1) |
| 303 | return false; |
| 304 | |
| 305 | int Size = pManager->GetTotalSize(); |
| 306 | |
| 307 | if ((Size + pNewSample->size()) > MAX_SAMPLE_SPACE) |
| 308 | AfxMessageBox(AfxFormattedW(IDS_OUT_OF_SAMPLEMEM_FORMAT, conv::to_wide(conv::sv_from_int(MAX_SAMPLE_SPACE / 1024)).data()), MB_ICONERROR); // // // |
| 309 | else if (pManager->SetDSample(FreeSlot, std::move(pNewSample))) // // // |
| 310 | GetDocument()->ModifyIrreversible(); |
| 311 | |
| 312 | return true; |
| 313 | } |
| 314 | |
| 315 | void CInstrumentEditorDPCM::OnBnClickedLoad() |
| 316 | { |
nothing calls this directly
no test coverage detected