From 4cad9517aa4892b6495898f35efeb1805c4be2e0 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. --- 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 6037ea07c..2624783c1 100644 --- a/include/song.h +++ b/include/song.h @@ -215,11 +215,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 ) {