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

Method OnModuleEstimateSongLength

Source/MainFrm.cpp:2168–2191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2166}
2167
2168void CMainFrame::OnModuleEstimateSongLength() // // //
2169{
2170 CSongLengthScanner scanner {*GetDoc().GetModule(), *GetTrackerView()->GetSongView()};
2171 auto [Intro, Loop] = scanner.GetSecondsCount();
2172 auto [IntroRows, LoopRows] = scanner.GetRowCount();
2173
2174 int Rate = GetDoc().GetModule()->GetFrameRate();
2175
2176 const LPCWSTR fmt = L"Estimated duration:\n"
2177 L"Intro: %lld:%02lld.%02lld (%d rows, %lld ticks)\n"
2178 L"Loop: %lld:%02lld.%02lld (%d rows, %lld ticks)\n"
2179 L"Tick counts are subject to rounding errors!";
2180 AfxMessageBox(FormattedW(fmt,
2181 static_cast<long long>(Intro + .5 / 6000) / 60,
2182 static_cast<long long>(Intro + .005) % 60,
2183 static_cast<long long>(Intro * 100 + .5) % 100,
2184 IntroRows,
2185 static_cast<long long>(Intro * Rate + .5),
2186 static_cast<long long>(Loop + .5 / 6000) / 60,
2187 static_cast<long long>(Loop + .005) % 60,
2188 static_cast<long long>(Loop * 100 + .5) % 100,
2189 LoopRows,
2190 static_cast<long long>(Loop * Rate + .5)));
2191}
2192
2193void CMainFrame::UpdateTrackBox()
2194{

Callers

nothing calls this directly

Calls 6

FormattedWFunction · 0.85
GetModuleMethod · 0.80
GetSongViewMethod · 0.80
GetSecondsCountMethod · 0.80
GetRowCountMethod · 0.80
GetFrameRateMethod · 0.45

Tested by

no test coverage detected