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

Method BuildSampleList

Source/InstrumentEditorDPCM.cpp:249–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void 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
279bool CInstrumentEditorDPCM::LoadSample(const CStringW &FilePath, const CStringW &FileName)
280{

Callers

nothing calls this directly

Calls 9

to_wideFunction · 0.85
sv_from_intFunction · 0.85
FormattedWFunction · 0.85
AfxFormattedWFunction · 0.85
from_intFunction · 0.85
GetDSampleMethod · 0.45
dataMethod · 0.45
nameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected