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

Method GetFrameLength

Source/SongView.cpp:100–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100unsigned CConstSongView::GetFrameLength(unsigned Frame) const {
101 if (show_skipped_) // // //
102 return GetSong().GetPatternLength();
103
104 const unsigned PatternLength = GetSong().GetPatternLength(); // default length
105 unsigned HaltPoint = PatternLength;
106
107 const auto trackLen = [Frame, PatternLength] (const CTrackData &track) {
108 const unsigned Columns = track.GetEffectColumnCount();
109 const auto &pat = track.GetPatternOnFrame(Frame);
110 for (unsigned j = 0; j < PatternLength - 1; ++j) {
111 const auto &Note = pat.GetNoteOn(j);
112 for (unsigned k = 0; k < Columns; ++k)
113 switch (Note.Effects[k].fx)
114 case effect_t::SKIP: case effect_t::JUMP: case effect_t::HALT:
115 return j + 1;
116 }
117 return PatternLength;
118 };
119
120 ForeachTrack([&] (const CTrackData &track) {
121 HaltPoint = std::min(HaltPoint, trackLen(track));
122 });
123
124 return HaltPoint;
125}
126
127void CSongView::PullUp(std::size_t index, unsigned Frame, unsigned Row) {
128 GetSong().PullUp(order_.TranslateChannel(index), Frame, Row);

Callers 9

IsBookmarkValidMethod · 0.80
MoveMethod · 0.80
PrepareCursorMethod · 0.80
OnEditSelectotherMethod · 0.80
WarpMethod · 0.80
CheckDestinationMethod · 0.80
IsMarkerValidMethod · 0.80
RetrieveMethod · 0.80

Calls 2

GetPatternLengthMethod · 0.80
GetEffectColumnCountMethod · 0.45

Tested by

no test coverage detected