ExportProjectDialog: added option for exporting song as loop (backport)
This patch adds the option to remove the extra silence at the end,
so that the exported song can be seamlessly looped.
This is a backport of commit 8f1657164a.
Closes #3588890.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* song.h - class song - the root of the model-tree
|
||||
*
|
||||
* Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* song.cpp - root of the model tree
|
||||
*
|
||||
* Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -279,6 +279,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="exportLoopCB">
|
||||
<property name="text">
|
||||
<string>Export as loop (remove end silence)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="aliasFreeOscillatorsCB" >
|
||||
<property name="text" >
|
||||
|
||||
@@ -243,6 +243,8 @@ ProjectRenderer* exportProjectDialog::prepRender()
|
||||
bitrateCB->currentText().section(" ", 0, 0).toUInt(),
|
||||
static_cast<ProjectRenderer::Depths>( depthCB->currentIndex() ) );
|
||||
|
||||
engine::getSong()->setExportLoop( exportLoopCB->isChecked() );
|
||||
|
||||
ProjectRenderer* renderer = new ProjectRenderer( qs, os, m_ft, m_fileName );
|
||||
|
||||
m_renderers.push_back(renderer);
|
||||
|
||||
Reference in New Issue
Block a user