Merge pull request #2883 from Stephen-Seo/bb_bugfix

Fixes newly added tracks in BB having wrong size
This commit is contained in:
Tres Finocchiaro
2016-07-05 18:09:32 -04:00
committed by GitHub

View File

@@ -65,6 +65,26 @@ Pattern::Pattern( InstrumentTrack * _instrument_track ) :
m_steps( MidiTime::stepsPerTact() )
{
setName( _instrument_track->name() );
// Resize this track to be the same as existing tracks in the BB
const TrackContainer::TrackList & tracks =
m_instrumentTrack->trackContainer()->tracks();
for(unsigned int trackID = 0; trackID < tracks.size(); ++trackID)
{
if(tracks.at(trackID)->type() == Track::InstrumentTrack)
{
if(tracks.at(trackID) != m_instrumentTrack)
{
unsigned int currentTCO = m_instrumentTrack->
getTCOs().indexOf(this);
m_steps = static_cast<Pattern *>
(tracks.at(trackID)->getTCO(currentTCO))
->m_steps;
}
break;
}
}
init();
setAutoResize( true );
}