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

Method CopySelection

Source/FrameEditorModel.cpp:138–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138CFrameClipData CFrameEditorModel::CopySelection(const CFrameSelection &sel) const {
139 auto [b, e] = CFrameIterator::FromSelection(sel, *view_->GetSongView());
140
141 CFrameClipData Data {sel.GetSelectedChanCount(), sel.GetSelectedFrameCount()};
142 Data.ClipInfo.FirstChannel = b.m_iChannel; // // //
143 Data.ClipInfo.OleInfo.SourceRowStart = b.m_iFrame;
144 Data.ClipInfo.OleInfo.SourceRowEnd = e.m_iFrame - 1;
145
146 int f = 0;
147 for (; b != e; ++f) {
148 for (int c = b.m_iChannel; c < e.m_iChannel; ++c)
149 Data.SetFrame(f, c - b.m_iChannel, b.Get(c));
150 ++b;
151 if (b.m_iFrame == 0)
152 break;
153 }
154
155 return Data;
156}
157
158void CFrameEditorModel::PasteSelection(const CFrameClipData &clipdata, const CFrameCursorPos &pos) {
159 CFrameIterator it {*view_->GetSongView(), pos};

Callers

nothing calls this directly

Calls 5

GetSongViewMethod · 0.80
GetSelectedChanCountMethod · 0.80
GetSelectedFrameCountMethod · 0.80
SetFrameMethod · 0.80
GetMethod · 0.80

Tested by

no test coverage detected