diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 89baf7415..6524cd4fd 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -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: diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 72c8afaf5..28c232fab 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -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() ) diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 35130e2de..dcc992162 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -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 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( _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?