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

Method StoreChunks

Source/ChunkRenderText.cpp:105–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void CChunkRenderText::StoreChunks(const std::vector<std::shared_ptr<CChunk>> &Chunks) // // //
106{
107 // Generate strings
108 for (auto &pChunk : Chunks)
109 for (const auto &f : RENDER_FUNCTIONS)
110 if (pChunk->GetType() == f.type)
111 (this->*(f.function))(pChunk.get());
112
113 // Write strings to file
114 WriteFileString("; 0CC-FamiTracker exported music data: ");
115 WriteFileString(FTEnv.GetDocumentTitle()); // // //
116 WriteFileString("\n;\n\n");
117
118 // Module header
119 DumpStrings("; Module header\n", "\n", m_headerStrings);
120
121 // Instrument list
122 DumpStrings("; Instrument pointer list\n", "\n", m_instrumentListStrings);
123 DumpStrings("; Instruments\n", "", m_instrumentStrings);
124
125 // Sequences
126 DumpStrings("; Sequences\n", "\n", m_sequenceStrings);
127
128 // Waves (FDS & N163)
129 if (!m_wavetableStrings.empty())
130 DumpStrings("; FDS waves\n", "\n", m_wavetableStrings);
131
132 if (!m_wavesStrings.empty())
133 DumpStrings("; N163 waves\n", "\n", m_wavesStrings);
134
135 // Samples
136 DumpStrings("; DPCM instrument list (pitch, sample index)\n", "\n", m_sampleListStrings);
137 DumpStrings("; DPCM samples list (location, size, bank)\n", "\n", m_samplePointersStrings);
138
139 // // // Grooves
140 DumpStrings("; Groove list\n", "", m_grooveListStrings);
141 DumpStrings("; Grooves (size, terms)\n", "\n", m_grooveStrings);
142
143 // Songs
144 DumpStrings("; Song pointer list\n", "\n", m_songListStrings);
145 DumpStrings("; Song info\n", "\n", m_songStrings);
146
147 // Song data
148 DumpStrings(";\n; Pattern and frame data for all songs below\n;\n\n", "", m_songDataStrings);
149
150 // Actual DPCM samples are stored later
151}
152
153void CChunkRenderText::StoreSamples(const std::vector<std::shared_ptr<const ft0cc::doc::dpcm_sample>> &Samples) // // //
154{

Callers 3

ExportNSF_NSFEMethod · 0.45
ExportNES_PRGMethod · 0.45
ExportBIN_ASMMethod · 0.45

Calls 4

GetDocumentTitleMethod · 0.80
emptyMethod · 0.80
GetTypeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected