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

Method Make

Source/WaveRendererFactory.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "SongView.h"
28
29std::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}

Callers

nothing calls this directly

Calls 3

MakeSongViewMethod · 0.80
GetRowCountMethod · 0.80
GetFrameRateMethod · 0.45

Tested by

no test coverage detected