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

Method UpdateKey

Source/InstrumentEditorDPCM.cpp:227–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void CInstrumentEditorDPCM::UpdateKey(int Index)
228{
229 CStringW NameStr = NO_SAMPLE_STR;
230 CStringW PitchStr = L"-";
231
232 if (m_pInstrument->GetSampleIndex(Index) != CInstrument2A03::NO_DPCM) {
233 int Pitch = m_pInstrument->GetSamplePitch(Index);
234 auto pSample = m_pInstrument->GetDSample(Index); // // //
235 NameStr = !pSample ? L"(n/a)" : conv::to_wide(pSample->name()).data();
236 PitchStr = FormattedW(L"%i %s", Pitch & 0x0F, (Pitch & 0x80) ? L"L" : L"");
237 }
238
239 m_cTableListCtrl.SetItemText(Index, 1, PitchStr);
240 m_cTableListCtrl.SetItemText(Index, 2, NameStr);
241}
242
243int CInstrumentEditorDPCM::GetSelectedSampleIndex() const { // // //
244 if (int Index = m_cSampleListCtrl.GetSelectionMark(); Index != -1)

Callers

nothing calls this directly

Calls 7

to_wideFunction · 0.85
FormattedWFunction · 0.85
GetSamplePitchMethod · 0.80
GetSampleIndexMethod · 0.45
GetDSampleMethod · 0.45
dataMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected