Skip to content

Commit

Permalink
Fix sound while playing from piano roll, when BB tracks are muted (LM…
Browse files Browse the repository at this point in the history
…MS#3804)

* Don't set BB track for tracks not in the BB

* Don't check for BB track mute state if we're playing a single pattern
  • Loading branch information
PhysSong authored Sep 28, 2017
1 parent 3750bb0 commit 626a451
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ InstrumentTrack::~InstrumentTrack()
void InstrumentTrack::processAudioBuffer( sampleFrame* buf, const fpp_t frames, NotePlayHandle* n )
{
// we must not play the sound if this InstrumentTrack is muted...
if( isMuted() || ( n && n->isBbTrackMuted() ) || ! m_instrument )
if( isMuted() || ( Engine::getSong()->playMode() != Song::Mode_PlayPattern &&
n && n->isBbTrackMuted() ) || ! m_instrument )
{
return;
}
Expand Down Expand Up @@ -613,7 +614,10 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames,
{
TrackContentObject * tco = getTCO( _tco_num );
tcos.push_back( tco );
bb_track = BBTrack::findBBTrack( _tco_num );
if (trackContainer() == (TrackContainer*)Engine::getBBTrackContainer())
{
bb_track = BBTrack::findBBTrack( _tco_num );
}
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion src/tracks/SampleTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames,
return false;
}
tcos.push_back( getTCO( _tco_num ) );
bb_track = BBTrack::findBBTrack( _tco_num );
if (trackContainer() == (TrackContainer*)Engine::getBBTrackContainer())
{
bb_track = BBTrack::findBBTrack( _tco_num );
}
}
else
{
Expand Down

0 comments on commit 626a451

Please sign in to comment.