Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/Pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ protected slots:


private:
void resizeToFirstTrack();

InstrumentTrack * m_instrumentTrack;

PatternTypes m_patternType;
Expand Down
46 changes: 28 additions & 18 deletions src/tracks/Pattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,11 @@ 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( _instrument_track->trackContainer()
== Engine::getBBTrackContainer() )
{
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;
}
resizeToFirstTrack();
}

init();
setAutoResize( true );
}
Expand Down Expand Up @@ -135,6 +120,31 @@ Pattern::~Pattern()



void Pattern::resizeToFirstTrack()
{
// 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;
}
}
}




void Pattern::init()
{
connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ),
Expand Down