| 27 | #include "SongView.h" |
| 28 | |
| 29 | std::unique_ptr<CWaveRenderer> CWaveRendererFactory::Make(const CFamiTrackerModule &modfile, unsigned track, render_type_t renderType, unsigned param) { |
| 30 | switch (renderType) { |
| 31 | case render_type_t::Loops: { |
| 32 | auto pSongView = modfile.MakeSongView(track, false); |
| 33 | CSongLengthScanner scanner {modfile, *pSongView}; |
| 34 | auto [FirstLoop, SecondLoop] = scanner.GetRowCount(); |
| 35 | auto rows = FirstLoop + SecondLoop * param; |
| 36 | return rows ? std::make_unique<CWaveRendererRow>(rows) : nullptr; |
| 37 | } |
| 38 | case render_type_t::Seconds: { |
| 39 | auto ticks = param * modfile.GetFrameRate(); |
| 40 | return ticks ? std::make_unique<CWaveRendererTick>(ticks, modfile.GetFrameRate()) : nullptr; |
| 41 | } |
| 42 | } |
| 43 | return nullptr; |
| 44 | } |
nothing calls this directly
no test coverage detected