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
This commit is contained in:
Tobias Doerffel
2008-06-30 21:43:03 +00:00
parent c84582ad61
commit c97fc932a1
2 changed files with 18 additions and 3 deletions

View File

@@ -53,6 +53,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) :
static_cast<QVBoxLayout *>( 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 )