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

Method EditSequence

Source/ModSequenceEditor.cpp:124–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void CModSequenceEditor::EditSequence(CPoint point)
125{
126 const int VALUES[] = {3, 2, 1, 0, 7, 6, 5, 4};
127
128 int index = std::clamp((point.x - 2) / (SIZE_X + 2), 0L, 31L); // // //
129 int value = VALUES[std::clamp((point.y - 3) / 7, 0L, 7L)];
130
131 CDC *pDC = GetDC();
132
133 if (pDC != NULL) {
134 int s = m_pInstrument->GetModulation(index);
135 FillItem(pDC, index, s, true);
136 if (m_pInstrument->GetModulation(index) != value) { // // //
137 m_pInstrument->SetModulation(index, value);
138 CFamiTrackerDoc::GetDoc()->ModifyIrreversible();
139 }
140 FillItem(pDC, index, value, false);
141 ReleaseDC(pDC);
142 }
143
144 // Notify parent that the sequence has changed
145 GetParent()->PostMessageW(WM_USER + 1);
146}

Callers

nothing calls this directly

Calls 5

clampFunction · 0.85
FillItemFunction · 0.85
GetModulationMethod · 0.80
SetModulationMethod · 0.80
ModifyIrreversibleMethod · 0.80

Tested by

no test coverage detected