From ae3273faf9ade4fd76f350205017c97e803127e8 Mon Sep 17 00:00:00 2001 From: Hannu Haahti Date: Sat, 18 Jan 2014 10:04:30 +0200 Subject: [PATCH] check track type first before adding or removing steps --- src/gui/bb_editor.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index 211981788..e66e74da1 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -241,9 +241,12 @@ void bbEditor::addSteps() for( TrackContainer::TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { - pattern * p = static_cast( - ( *it )->getTCO( m_bbtc->currentBB() ) ); - p->addSteps(); + if( ( *it )->type() == track::InstrumentTrack ) + { + pattern * p = static_cast( + ( *it )->getTCO( m_bbtc->currentBB() ) ); + p->addSteps(); + } } } @@ -257,9 +260,12 @@ void bbEditor::removeSteps() for( TrackContainer::TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { - pattern * p = static_cast( - ( *it )->getTCO( m_bbtc->currentBB() ) ); - p->removeSteps(); + if( ( *it )->type() == track::InstrumentTrack ) + { + pattern * p = static_cast( + ( *it )->getTCO( m_bbtc->currentBB() ) ); + p->removeSteps(); + } } }