From 43b8eb9393ab2edffdcb3aca367ee8ba0541b81c Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 16 Jul 2008 22:10:15 +0000 Subject: [PATCH] fixed behaviour of automation-tracks in BB-editor (closes #2014486) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1311 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 3 +++ src/tracks/automation_track.cpp | 20 +++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 904d3487b..c1c892d22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-16 Tobias Doerffel + * src/tracks/automation_track.cpp: + fixed behaviour of automation-tracks in BB-editor (closes #2014486) + * include/track.h: * src/core/track.cpp: fixed "Cut"-action on TCOs (closes #2016731) diff --git a/src/tracks/automation_track.cpp b/src/tracks/automation_track.cpp index 806fe773e..d8a8833e7 100644 --- a/src/tracks/automation_track.cpp +++ b/src/tracks/automation_track.cpp @@ -61,8 +61,17 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames, } tcoVector tcos; - getTCOsInRange( tcos, _start, _start + static_cast( - _frames / engine::framesPerTick() ) ); + if( _tco_num >= 0 ) + { + trackContentObject * tco = getTCO( _tco_num ); + tcos.push_back( tco ); + } + else + { + getTCOsInRange( tcos, _start, _start + static_cast( + _frames / engine::framesPerTick()) ); + } + for( tcoVector::iterator it = tcos.begin(); it != tcos.end(); ++it ) { automationPattern * p = @@ -71,7 +80,12 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames, { continue; } - p->processMidiTime( _start - p->startPosition() ); + midiTime cur_start = _start; + if( _tco_num < 0 ) + { + cur_start -= p->startPosition(); + } + p->processMidiTime( cur_start ); } return( FALSE ); }