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

Method LoadBookmarks

Source/FamiTrackerDocIO.cpp:1396–1413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1394}
1395
1396void CFamiTrackerDocIO::LoadBookmarks(CFamiTrackerModule &modfile, int ver) {
1397 for (int i = 0, n = file_.GetBlockInt(); i < n; ++i) {
1398 auto pMark = std::make_unique<CBookmark>();
1399 unsigned int Track = AssertRange(
1400 static_cast<unsigned char>(file_.GetBlockChar()), 0, modfile.GetSongCount() - 1, "Bookmark song index");
1401 int Frame = static_cast<unsigned char>(file_.GetBlockChar());
1402 int Row = static_cast<unsigned char>(file_.GetBlockChar());
1403
1404 auto *pSong = modfile.GetSong(Track);
1405 pMark->m_iFrame = AssertRange(Frame, 0, static_cast<int>(pSong->GetFrameCount()) - 1, "Bookmark frame index");
1406 pMark->m_iRow = AssertRange(Row, 0, static_cast<int>(pSong->GetPatternLength()) - 1, "Bookmark row index");
1407 pMark->m_Highlight.First = file_.GetBlockInt();
1408 pMark->m_Highlight.Second = file_.GetBlockInt();
1409 pMark->m_bPersist = file_.GetBlockChar() != 0;
1410 pMark->m_sName = file_.ReadString();
1411 pSong->GetBookmarks().AddBookmark(std::move(pMark));
1412 }
1413}
1414
1415void CFamiTrackerDocIO::SaveBookmarks(const CFamiTrackerModule &modfile, int ver) {
1416 int Count = 0;

Callers

nothing calls this directly

Calls 8

GetBlockIntMethod · 0.80
GetBlockCharMethod · 0.80
GetSongCountMethod · 0.80
GetSongMethod · 0.80
GetPatternLengthMethod · 0.80
AddBookmarkMethod · 0.80
GetFrameCountMethod · 0.45
ReadStringMethod · 0.45

Tested by

no test coverage detected