added bbTrack reference to check whether it's muted
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@288 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "play_handle.h"
|
||||
#include "basic_filters.h"
|
||||
#include "bb_track.h"
|
||||
#include "note.h"
|
||||
|
||||
|
||||
@@ -171,6 +172,15 @@ public:
|
||||
// return whether given note-play-handle is equal to *this
|
||||
bool operator==( const notePlayHandle & _nph ) const;
|
||||
|
||||
bool bbTrackMuted( void )
|
||||
{
|
||||
return( m_bbTrack && m_bbTrack->muted() );
|
||||
}
|
||||
void setBBTrack( bbTrack * _bb_track )
|
||||
{
|
||||
m_bbTrack = _bb_track;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
instrumentTrack * m_instrumentTrack; // needed for calling
|
||||
@@ -195,6 +205,7 @@ private:
|
||||
// an arpeggio (either base-note or
|
||||
// sub-note)
|
||||
bool m_muted; // indicates whether note is muted
|
||||
bbTrack * m_bbTrack; // related BB track
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -57,7 +57,8 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
|
||||
m_released( FALSE ),
|
||||
m_baseNote( TRUE ),
|
||||
m_arpNote( _arp_note ),
|
||||
m_muted( FALSE )
|
||||
m_muted( FALSE ),
|
||||
m_bbTrack( NULL )
|
||||
{
|
||||
setDetuning( _n.detuning() );
|
||||
if( detuning() )
|
||||
|
||||
@@ -544,7 +544,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
notePlayHandle * _n )
|
||||
{
|
||||
// we must not play the sound if this instrumentTrack is muted...
|
||||
if( muted() )
|
||||
if( muted() || ( _n && _n->bbTrackMuted() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -896,14 +896,17 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
|
||||
float frames_per_tact64th = eng()->framesPerTact64th();
|
||||
|
||||
vlist<trackContentObject *> tcos;
|
||||
bbTrack * bb_track;
|
||||
if( _tco_num >= 0 )
|
||||
{
|
||||
tcos.push_back( getTCO( _tco_num ) );
|
||||
bb_track = bbTrack::findBBTrack( _tco_num, eng() );
|
||||
}
|
||||
else
|
||||
{
|
||||
getTCOsInRange( tcos, _start, _start + static_cast<Sint32>(
|
||||
_frames / frames_per_tact64th ) );
|
||||
bb_track = NULL;
|
||||
}
|
||||
|
||||
if ( tcos.size() == 0 )
|
||||
@@ -930,6 +933,10 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
|
||||
if( p->frozen() &&
|
||||
eng()->getSongEditor()->exporting() == FALSE )
|
||||
{
|
||||
if( bb_track && bb_track->muted() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
volumeVector v = m_surroundArea->getVolumeVector(
|
||||
1.0f );
|
||||
// volume-vector was already used when freezing
|
||||
@@ -1008,6 +1015,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start,
|
||||
_frame_base,
|
||||
note_frames,
|
||||
*cur_note );
|
||||
note_play_handle->setBBTrack( bb_track );
|
||||
note_play_handle->play();
|
||||
// could we play all within current number of
|
||||
// frames per audio-buffer?
|
||||
|
||||
Reference in New Issue
Block a user