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

Method Copy

Source/PatternEditor.cpp:2842–2868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2840}
2841
2842CPatternClipData CPatternEditor::Copy() const
2843{
2844 // Copy selection
2845 CPatternIterator it = GetIterators().first; // // //
2846 const int Channels = m_selection.GetChanEnd() - m_selection.GetChanStart() + 1;
2847 const int Rows = GetSelectionSize(GetSelection()); // // //
2848
2849 auto ClipData = CPatternClipData {Channels, Rows};
2850 ClipData.ClipInfo.Channels = Channels; // // //
2851 ClipData.ClipInfo.Rows = Rows;
2852 ClipData.ClipInfo.StartColumn = GetSelectColumn(m_selection.GetColStart()); // // //
2853 ClipData.ClipInfo.EndColumn = GetSelectColumn(m_selection.GetColEnd()); // // //
2854
2855 for (int r = 0; r < Rows; ++r) { // // //
2856 for (int i = 0; i < Channels; ++i) {
2857 stChanNote *Target = ClipData.GetPattern(i, r);
2858 /*CopyNoteSection(*Target, NoteData, paste_mode_t::DEFAULT,
2859 i == 0 ? ColStart : column_t::Note, i == Channels - 1 ? ColEnd : column_t::Effect4);*/
2860 *Target = it.Get(i + m_selection.GetChanStart());
2861 // the clip data should store the entire field;
2862 // other methods should check ClipInfo.StartColumn and ClipInfo.EndColumn before operating
2863 }
2864 ++it;
2865 }
2866
2867 return ClipData;
2868}
2869
2870CPatternClipData CPatternEditor::CopyRaw() const // // //
2871{

Callers 2

OnEditCopyMethod · 0.80
BeginDragDataMethod · 0.80

Calls 7

GetSelectColumnFunction · 0.85
GetColStartMethod · 0.80
GetColEndMethod · 0.80
GetPatternMethod · 0.80
GetMethod · 0.80
GetChanEndMethod · 0.45
GetChanStartMethod · 0.45

Tested by

no test coverage detected