MCPcopy Create free account
hub / github.com/LMMS/lmms / run

Method run

src/core/ProjectRenderer.cpp:161–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160
161void ProjectRenderer::run()
162{
163 MemoryManager::ThreadGuard mmThreadGuard; Q_UNUSED(mmThreadGuard);
164#if 0
165#if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_FREEBSD)
166#ifdef LMMS_HAVE_SCHED_H
167 cpu_set_t mask;
168 CPU_ZERO( &mask );
169 CPU_SET( 0, &mask );
170 sched_setaffinity( 0, sizeof( mask ), &mask );
171#endif
172#endif
173#endif
174
175 Engine::getSong()->startExport();
176 Engine::getSong()->updateLength();
177 //skip first empty buffer
178 Engine::mixer()->nextBuffer();
179
180 const Song::PlayPos & exportPos = Engine::getSong()->getPlayPos(
181 Song::Mode_PlaySong );
182 m_progress = 0;
183 std::pair<MidiTime, MidiTime> exportEndpoints = Engine::getSong()->getExportEndpoints();
184 tick_t startTick = exportEndpoints.first.getTicks();
185 tick_t endTick = exportEndpoints.second.getTicks();
186 tick_t lengthTicks = endTick - startTick;
187
188 // Now start processing
189 Engine::mixer()->startProcessing(false);
190
191 // Continually track and emit progress percentage to listeners
192 while( exportPos.getTicks() < endTick &&
193 Engine::getSong()->isExporting() == true
194 && !m_abort )
195 {
196 m_fileDev->processNextBuffer();
197 const int nprog = lengthTicks == 0 ? 100 : (exportPos.getTicks()-startTick) * 100 / lengthTicks;
198 if( m_progress != nprog )
199 {
200 m_progress = nprog;
201 emit progressChanged( m_progress );
202 }
203 }
204
205 // notify mixer of the end of processing
206 Engine::mixer()->stopProcessing();
207
208 Engine::getSong()->stopExport();
209
210 // if the user aborted export-process, the file has to be deleted
211 const QString f = m_fileDev->outputFile();
212 if( m_abort )
213 {
214 QFile( f ).remove();
215 }
216}
217
218

Callers

nothing calls this directly

Calls 12

getSongFunction · 0.85
mixerFunction · 0.85
getExportEndpointsMethod · 0.80
getTicksMethod · 0.80
stopExportMethod · 0.80
outputFileMethod · 0.80
startExportMethod · 0.45
updateLengthMethod · 0.45
startProcessingMethod · 0.45
processNextBufferMethod · 0.45
stopProcessingMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected