From 5949f49e112df1598a611c2ff2aa5d8a6950efce Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 23 Jan 2011 23:10:04 +0100 Subject: [PATCH] Add BB track when adding track to empty BB editor When there's no BB track but a track is added to the BB editor, automatically create a BB track so that the user doesn't get confused by new empty track (not even showing clickable beats). Partially closes #3149779. (cherry picked from commit 4cad9517aa4892b6495898f35efeb1805c4be2e0) --- include/song.h | 3 ++- src/core/bb_track_container.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/song.h b/include/song.h index 5c0d619e0..3fabae1af 100644 --- a/include/song.h +++ b/include/song.h @@ -219,11 +219,12 @@ public slots: void clearProject(); + void addBBTrack(); + private slots: void insertBar(); void removeBar(); - void addBBTrack(); void addSampleTrack(); void addAutomationTrack(); diff --git a/src/core/bb_track_container.cpp b/src/core/bb_track_container.cpp index d44d7c09f..f95e8211d 100644 --- a/src/core/bb_track_container.cpp +++ b/src/core/bb_track_container.cpp @@ -83,6 +83,11 @@ bool bbTrackContainer::play( midiTime _start, fpp_t _frames, void bbTrackContainer::updateAfterTrackAdd() { + if( numOfBBs() == 0 && !engine::getSong()->isLoadingProject() ) + { + engine::getSong()->addBBTrack(); + } + // make sure, new track(s) have TCOs for every beat/bassline for( int i = 0; i < qMax( 1, numOfBBs() ); ++i ) {