From 06e4033cb98dfb95b5fe986b9b4b3f12c1226c6d Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Wed, 1 Mar 2017 07:27:43 +0100 Subject: [PATCH] Don't count muted tracks in track length (#3390) * Don't count muted tracks to length on render * Don't count muted TCO's to length on render --- src/core/ProjectRenderer.cpp | 2 +- src/core/Song.cpp | 6 ++++++ src/core/Track.cpp | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index afa61c812..7e18a67b6 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -167,8 +167,8 @@ void ProjectRenderer::run() #endif #endif - Engine::getSong()->startExport(); + Engine::getSong()->updateLength(); //skip first empty buffer Engine::mixer()->nextBuffer(); diff --git a/src/core/Song.cpp b/src/core/Song.cpp index e49eb6287..dc61dc063 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -555,6 +555,12 @@ void Song::updateLength() for( TrackList::const_iterator it = tracks().begin(); it != tracks().end(); ++it ) { + if( Engine::getSong()->isExporting() && + ( *it )->isMuted() ) + { + continue; + } + const tact_t cur = ( *it )->length(); if( cur > m_length ) { diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 7acaa28f0..6ce4445e5 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -2421,6 +2421,12 @@ tact_t Track::length() const for( tcoVector::const_iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { + if( Engine::getSong()->isExporting() && + ( *it )->isMuted() ) + { + continue; + } + const tick_t cur = ( *it )->endPosition(); if( cur > last ) {