| 247 | } |
| 248 | |
| 249 | void CInstrumentEditorDPCM::BuildSampleList() |
| 250 | { |
| 251 | m_cSampleListCtrl.DeleteAllItems(); |
| 252 | m_cComboSampleName.ResetContent(); |
| 253 | |
| 254 | unsigned int Size(0), Index(0); |
| 255 | |
| 256 | m_cComboSampleName.AddString(NO_SAMPLE_STR); |
| 257 | m_cComboSampleName.SetItemData(0, (unsigned)-1); |
| 258 | |
| 259 | for (int i = 0; i < MAX_DSAMPLES; ++i) { |
| 260 | if (auto pDSample = GetDSampleManager()->GetDSample(i)) { // // // |
| 261 | m_cSampleListCtrl.InsertItem(Index, conv::to_wide(conv::sv_from_int(i)).data()); |
| 262 | auto name = conv::to_wide(pDSample->name()); |
| 263 | m_cSampleListCtrl.SetItemText(Index, 1, name.data()); |
| 264 | m_cSampleListCtrl.SetItemText(Index, 2, FormattedW(L"%u", pDSample->size())); |
| 265 | m_cSampleListCtrl.SetItemData(Index, i); // // // |
| 266 | m_cComboSampleName.AddString(FormattedW(L"%02i - %.*s", i, name.size(), name.data())); |
| 267 | m_cComboSampleName.SetItemData(Index + 1, i); // // // |
| 268 | Size += pDSample->size(); |
| 269 | ++Index; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | SetDlgItemTextW(IDC_SPACE, AfxFormattedW(IDS_DPCM_SPACE_FORMAT, |
| 274 | conv::to_wide(conv::from_int(Size / 0x400)).data(), // // // |
| 275 | conv::to_wide(conv::from_int((MAX_SAMPLE_SPACE - Size) / 0x400)).data(), |
| 276 | conv::to_wide(conv::from_int(MAX_SAMPLE_SPACE / 0x400)).data())); // // // |
| 277 | } |
| 278 | |
| 279 | bool CInstrumentEditorDPCM::LoadSample(const CStringW &FilePath, const CStringW &FileName) |
| 280 | { |
nothing calls this directly
no test coverage detected