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

Method OnBookmarksToggle

Source/FamiTrackerView.cpp:1494–1520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1492// // // TODO: move these to CMainFrame?
1493
1494void CFamiTrackerView::OnBookmarksToggle()
1495{
1496 if ((FTEnv.GetSoundGenerator()->IsPlaying() && m_bFollowMode) || !m_bEditEnable)
1497 return;
1498
1499 const int Frame = GetSelectedFrame();
1500 const int Row = GetSelectedRow();
1501
1502 CBookmarkCollection &Col = static_cast<CMainFrame *>(GetParentFrame())->GetCurrentSong()->GetBookmarks();
1503 if (Col.FindAt(Frame, Row) != nullptr)
1504 Col.RemoveAt(Frame, Row);
1505 else {
1506 auto pMark = std::make_unique<CBookmark>(Frame, Row);
1507 pMark->m_Highlight.First = pMark->m_Highlight.Second = -1;
1508 pMark->m_bPersist = false;
1509 pMark->m_sName = "Bookmark " + std::to_string(Col.GetCount() + 1);
1510 Col.AddBookmark(std::move(pMark));
1511 }
1512
1513 static_cast<CMainFrame*>(GetParentFrame())->UpdateBookmarkList();
1514 SetFocus();
1515 GetDocument()->ModifyIrreversible();
1516 m_pPatternEditor->InvalidatePatternData();
1517 RedrawPatternEditor();
1518 GetFrameEditor()->InvalidateFrameData();
1519 RedrawFrameEditor();
1520}
1521
1522void CFamiTrackerView::OnBookmarksNext()
1523{

Callers

nothing calls this directly

Calls 11

FindAtMethod · 0.80
RemoveAtMethod · 0.80
AddBookmarkMethod · 0.80
ModifyIrreversibleMethod · 0.80
InvalidatePatternDataMethod · 0.80
InvalidateFrameDataMethod · 0.80
IsPlayingMethod · 0.45
GetSoundGeneratorMethod · 0.45
GetCurrentSongMethod · 0.45
GetCountMethod · 0.45
UpdateBookmarkListMethod · 0.45

Tested by

no test coverage detected