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

Method ParseString

Source/InstrumentEditorN163Wave.cpp:232–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void CInstrumentEditorN163Wave::ParseString(std::string_view sv)
233{
234 int i = 0;
235 int im = WaveSizeAvailable();
236 for (auto x : re::tokens(sv)) { // // //
237 int value = CSequenceInstrumentEditPanel::ReadStringValue(re::sv_from_submatch(x[0]));
238 m_pInstrument->SetSample(m_iWaveIndex, i, std::clamp(value, 0, 15)); // // //
239 if (++i >= im)
240 break;
241 }
242
243 int size = std::clamp(i & 0xFC, 4, im);
244 m_pInstrument->SetWaveSize(size);
245
246 static_cast<CComboBox*>(GetDlgItem(IDC_WAVE_SIZE))->SelectString(0, conv::to_wide(conv::sv_from_int(size)).data());
247
248 FillPosBox(size);
249
250 GetDocument()->ModifyIrreversible(); // // //
251 m_pWaveEditor->SetLength(size);
252 m_pWaveEditor->WaveChanged();
253}
254
255LRESULT CInstrumentEditorN163Wave::OnWaveChanged(WPARAM wParam, LPARAM lParam)
256{

Callers

nothing calls this directly

Calls 11

tokensFunction · 0.85
sv_from_submatchFunction · 0.85
clampFunction · 0.85
to_wideFunction · 0.85
sv_from_intFunction · 0.85
SetWaveSizeMethod · 0.80
ModifyIrreversibleMethod · 0.80
SetLengthMethod · 0.80
SetSampleMethod · 0.45
dataMethod · 0.45
WaveChangedMethod · 0.45

Tested by

no test coverage detected