From 11757502be8ebe01f0e515977da7da6452e97d1c Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sun, 27 Aug 2006 21:39:48 +0000 Subject: [PATCH] - fixed no bb-track case - removed checks when sending automation events - use update() instead of repaint() git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@371 0778d3d1-df1d-0410-868b-ea421aaaa00d --- src/core/track.cpp | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/core/track.cpp b/src/core/track.cpp index 20d906c4a..88386be41 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -1095,7 +1095,8 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) const char * trackOps_icon; const char * mute_active_icon; const char * mute_inactive_icon; - if( currentBBTrack()->automationDisabled( + bbTrack * bb_track = currentBBTrack(); + if( !bb_track || bb_track->automationDisabled( m_trackWidget->getTrack() ) ) { trackOps_icon = "track_op_menu_disabled"; @@ -1191,20 +1192,24 @@ void trackOperationsWidget::updateMenu( void ) to_menu->clear(); if( inBBEditor() ) { - if( currentBBTrack()->automationDisabled( - m_trackWidget->getTrack() ) ) + bbTrack * bb_track = currentBBTrack(); + if( bb_track ) { - to_menu->addAction( embed::getIconPixmap( "led_off", - 16, 16 ), + if( bb_track->automationDisabled( + m_trackWidget->getTrack() ) ) + { + to_menu->addAction( embed::getIconPixmap( + "led_off", 16, 16 ), tr( "Enable automation" ), this, SLOT( enableAutomation() ) ); - } - else - { - to_menu->addAction( embed::getIconPixmap( "led_green", - 16, 16 ), + } + else + { + to_menu->addAction( embed::getIconPixmap( + "led_green", 16, 16 ), tr( "Disable automation" ), this, SLOT( disableAutomation() ) ); + } } } to_menu->addAction( embed::getIconPixmap( "edit_copy", 16, 16 ), @@ -1314,6 +1319,15 @@ void trackWidget::repaint( void ) +void trackWidget::update( void ) +{ + m_trackContentWidget.update(); + QWidget::update(); +} + + + + // resposible for moving track-content-widgets to appropriate position after // change of visible viewport void trackWidget::changePosition( const midiTime & _new_pos ) @@ -1876,14 +1890,8 @@ void track::removeAutomationPattern( automationPattern * _pattern ) -bool track::sendMidiTime( const midiTime & _time ) +void track::sendMidiTime( const midiTime & _time ) { - if( m_last_time_sent == _time ) - { - return( FALSE ); - } - m_last_time_sent = _time; - QPtrListIterator it( m_automation_patterns ); automationPattern * pattern; while( ( pattern = it.current() ) ) @@ -1891,7 +1899,6 @@ bool track::sendMidiTime( const midiTime & _time ) ++it; pattern->processMidiTime( _time ); } - return( TRUE ); }