diff --git a/include/bb_editor.h b/include/bb_editor.h index 200896718..a4bce6253 100644 --- a/include/bb_editor.h +++ b/include/bb_editor.h @@ -56,6 +56,8 @@ public slots: void stop(); void updatePosition(); void addAutomationTrack(); + void addSteps(); + void removeSteps(); private: virtual void keyPressEvent( QKeyEvent * _ke ); diff --git a/include/pattern.h b/include/pattern.h index 2d3f208f2..26b51849e 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -163,6 +163,7 @@ private: friend class patternView; friend class patternFreezeThread; + friend class bbEditor; } ; diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index 8045c8af1..211981788 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -36,6 +36,9 @@ #include "tool_button.h" #include "config_mgr.h" +#include "TrackContainer.h" +#include "pattern.h" + bbEditor::bbEditor( bbTrackContainer* tc ) : @@ -93,6 +96,16 @@ bbEditor::bbEditor( bbTrackContainer* tc ) : tr( "Add automation-track" ), this, SLOT( addAutomationTrack() ), m_toolBar ); + toolButton * remove_bar = new toolButton( + embed::getIconPixmap( "step_btn_remove" ), + tr( "Remove steps" ), + this, SLOT( removeSteps() ), m_toolBar ); + + toolButton * add_bar = new toolButton( + embed::getIconPixmap( "step_btn_add" ), + tr( "Add steps" ), + this, SLOT( addSteps() ), m_toolBar ); + m_playButton->setWhatsThis( @@ -119,6 +132,8 @@ bbEditor::bbEditor( bbTrackContainer* tc ) : tb_layout->addWidget( add_bb_track ); tb_layout->addWidget( add_automation_track ); tb_layout->addStretch(); + tb_layout->addWidget( remove_bar ); + tb_layout->addWidget( add_bar ); tb_layout->addWidget( l ); tb_layout->addSpacing( 15 ); @@ -219,6 +234,38 @@ void bbEditor::addAutomationTrack() +void bbEditor::addSteps() +{ + TrackContainer::TrackList tl = model()->tracks(); + + for( TrackContainer::TrackList::iterator it = tl.begin(); + it != tl.end(); ++it ) + { + pattern * p = static_cast( + ( *it )->getTCO( m_bbtc->currentBB() ) ); + p->addSteps(); + } +} + + + + +void bbEditor::removeSteps() +{ + TrackContainer::TrackList tl = model()->tracks(); + + for( TrackContainer::TrackList::iterator it = tl.begin(); + it != tl.end(); ++it ) + { + pattern * p = static_cast( + ( *it )->getTCO( m_bbtc->currentBB() ) ); + p->removeSteps(); + } +} + + + + void bbEditor::keyPressEvent( QKeyEvent * _ke ) { if ( _ke->key() == Qt::Key_Space )