From c97fc932a17309190922dd3c669a2f1addda146a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 30 Jun 2008 21:43:03 +0000 Subject: [PATCH] made it possible to add automation-tracks to BB-editor git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1243 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/bb_editor.h | 2 +- src/gui/bb_editor.cpp | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/bb_editor.h b/include/bb_editor.h index 7eaa3575b..5924a5a79 100644 --- a/include/bb_editor.h +++ b/include/bb_editor.h @@ -53,7 +53,7 @@ public slots: void play( void ); void stop( void ); void updatePosition( void ); - + void addAutomationTrack( void ); private: virtual void keyPressEvent( QKeyEvent * _ke ); diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index 81f15f287..d425e9ea1 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -53,6 +53,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : static_cast( layout() )->insertWidget( 0, m_toolBar ); QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar ); + tb_layout->setSpacing( 0 ); tb_layout->setMargin( 0 ); @@ -77,6 +78,12 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : engine::getSong(), SLOT( addBBTrack() ), m_toolBar ); + toolButton * add_automation_track = new toolButton( + embed::getIconPixmap( "add_automation" ), + tr( "Add automation-track" ), + this, SLOT( addAutomationTrack() ), m_toolBar ); + + m_playButton->setWhatsThis( tr( "Click here, if you want to play the current " @@ -100,6 +107,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : tb_layout->addWidget( m_bbComboBox ); tb_layout->addSpacing( 10 ); tb_layout->addWidget( add_bb_track ); + tb_layout->addWidget( add_automation_track ); tb_layout->addStretch(); tb_layout->addWidget( l ); tb_layout->addSpacing( 15 ); @@ -114,8 +122,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : setModel( _tc ); connect( &_tc->m_bbComboBoxModel, SIGNAL( dataChanged() ), - this, SLOT( updatePosition() ), - Qt::QueuedConnection ); + this, SLOT( updatePosition() ), Qt::QueuedConnection ); } @@ -193,6 +200,14 @@ void bbEditor::updatePosition( void ) +void bbEditor::addAutomationTrack( void ) +{ + (void) track::create( track::AutomationTrack, model() ); +} + + + + void bbEditor::keyPressEvent( QKeyEvent * _ke ) { if ( _ke->key() == Qt::Key_Space )