InstrumentPlayHandle: do not process if InstrumentTrack is muted
While regular instruments were excluded from processing when muted
this did not happen for InstrumentPlayHandle-based instruments. Muting
for exampling tracks with VSTi's inside did not decrease CPU usage.
Checking whether related InstrumentTrack is muted before calling
Instrument::play() fixes this issue.
Closes #2857426.
(cherry picked from commit 6940d19969)
This commit is contained in:
@@ -117,6 +117,8 @@ public:
|
||||
|
||||
virtual bool isFromTrack( const track * _track ) const;
|
||||
|
||||
bool isMuted() const;
|
||||
|
||||
|
||||
protected:
|
||||
inline InstrumentTrack * instrumentTrack() const
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* instrument_play_handle.h - play-handle for playing an instrument
|
||||
* InstrumentPlayHandle.h - play-handle for driving an instrument
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _INSTRUMENT_PLAY_HANDLE_H
|
||||
#define _INSTRUMENT_PLAY_HANDLE_H
|
||||
|
||||
@@ -46,7 +45,10 @@ public:
|
||||
|
||||
virtual void play( sampleFrame * _working_buffer )
|
||||
{
|
||||
m_instrument->play( _working_buffer );
|
||||
if( !m_instrument->isMuted() )
|
||||
{
|
||||
m_instrument->play( _working_buffer );
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool done() const
|
||||
Reference in New Issue
Block a user