Skip to content

Commit

Permalink
Ignore release frames for single-streamed instruments (LMMS#3900)
Browse files Browse the repository at this point in the history
Let InstrumentSoundShaping::releaseFrames() ignore release frames for single-streamed instruments. And make it return 0 if m_instrumentTrack->instrument() is NULL.
  • Loading branch information
PhysSong authored Oct 23, 2017
1 parent 8b35478 commit a2c6532
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/core/InstrumentSoundShaping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,22 @@ f_cnt_t InstrumentSoundShaping::envFrames( const bool _only_vol ) const

f_cnt_t InstrumentSoundShaping::releaseFrames() const
{
if( !m_instrumentTrack->instrument() )
{
return 0;
}

f_cnt_t ret_val = m_instrumentTrack->instrument()->desiredReleaseFrames();

if( m_instrumentTrack->instrument()->flags().testFlag( Instrument::IsSingleStreamed ) )
{
return ret_val;
}

if( m_envLfoParameters[Volume]->isUsed() )
{
return m_envLfoParameters[Volume]->releaseFrames();
}
f_cnt_t ret_val = m_instrumentTrack->instrument()
? m_instrumentTrack->instrument()->desiredReleaseFrames()
: 0;

for( int i = Volume+1; i < NumTargets; ++i )
{
Expand Down

0 comments on commit a2c6532

Please sign in to comment.