diff --git a/include/song.h b/include/song.h index 6eafefa90..45c0a6f69 100644 --- a/include/song.h +++ b/include/song.h @@ -1,7 +1,7 @@ /* * song.h - class song - the root of the model-tree * - * Copyright (c) 2004-2011 Tobias Doerffel + * Copyright (c) 2004-2012 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -111,6 +111,11 @@ public: return m_exporting; } + inline void setExportLoop( bool exportLoop ) + { + m_exportLoop = exportLoop; + } + inline bool isRecording() const { return m_recording; @@ -120,8 +125,16 @@ public: inline bool isExportDone() const { - return m_exporting == true && - m_playPos[Mode_PlaySong].getTact() >= length() + 1; + if ( m_exportLoop ) + { + return m_exporting == true && + m_playPos[Mode_PlaySong].getTact() >= length(); + } + else + { + return m_exporting == true && + m_playPos[Mode_PlaySong].getTact() >= length() + 1; + } } inline PlayModes playMode() const @@ -283,6 +296,7 @@ private: volatile bool m_recording; volatile bool m_exporting; + volatile bool m_exportLoop; volatile bool m_playing; volatile bool m_paused; diff --git a/src/core/song.cpp b/src/core/song.cpp index d76f0383a..58a1e31a7 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -1,7 +1,7 @@ /* * song.cpp - root of the model tree * - * Copyright (c) 2004-2011 Tobias Doerffel + * Copyright (c) 2004-2012 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -80,6 +80,7 @@ song::song() : m_modified( false ), m_recording( false ), m_exporting( false ), + m_exportLoop( false ), m_playing( false ), m_paused( false ), m_loadingProject( false ), @@ -645,6 +646,7 @@ void song::stopExport() { stop(); m_exporting = false; + m_exportLoop = false; } diff --git a/src/gui/dialogs/export_project.ui b/src/gui/dialogs/export_project.ui index b0544ebc8..dae06e684 100644 --- a/src/gui/dialogs/export_project.ui +++ b/src/gui/dialogs/export_project.ui @@ -279,6 +279,13 @@ + + + + Export as loop (remove end silence) + + + diff --git a/src/gui/export_project_dialog.cpp b/src/gui/export_project_dialog.cpp index fd1a02bc5..1167df8f2 100644 --- a/src/gui/export_project_dialog.cpp +++ b/src/gui/export_project_dialog.cpp @@ -243,6 +243,8 @@ ProjectRenderer* exportProjectDialog::prepRender() bitrateCB->currentText().section(" ", 0, 0).toUInt(), static_cast( depthCB->currentIndex() ) ); + engine::getSong()->setExportLoop( exportLoopCB->isChecked() ); + ProjectRenderer* renderer = new ProjectRenderer( qs, os, m_ft, m_fileName ); m_renderers.push_back(renderer);