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:
Tobias Doerffel
2009-09-15 10:10:02 +02:00
parent 3c9dd294dc
commit f7da4a0f7e
8 changed files with 41 additions and 22 deletions

View File

@@ -117,6 +117,8 @@ public:
virtual bool isFromTrack( const track * _track ) const;
bool isMuted() const;
protected:
inline InstrumentTrack * instrumentTrack() const

View File

@@ -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