diff --git a/ChangeLog b/ChangeLog index 7e5414b51..6d0a3ad53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2008-02-25 Tobias Doerffel + * include/oscillator.h: + cleanups + + * src/lib/mmp.cpp: + fixed tag-renaming-loops + + * include/automatable_model_templates.h: + instantiate automation-pattern before loading settings of it - fixes + crashes when loading projects with automation inside + + * include/instrument_track.h: + * src/tracks/instrument_track.cpp: + track-window-creation on-demand - makes loading/unloading projects + ultra-fast!! + * plugins/triple_oscillator/triple_oscillator.cpp: fixed wrong index for saving/restoring modulation-algo-settings - now projects sound like they did in pre-MV diff --git a/include/instrument_track.h b/include/instrument_track.h index 0d1242fd0..544e04958 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -206,10 +206,7 @@ public: instrumentTrackView( instrumentTrack * _it, trackContainerView * _tc ); virtual ~instrumentTrackView(); - instrumentTrackWindow * getInstrumentTrackWindow( void ) - { - return( m_window ); - } + instrumentTrackWindow * getInstrumentTrackWindow( void ); instrumentTrack * model( void ) { @@ -223,6 +220,7 @@ public: private slots: + void toggledInstrumentTrackButton( bool _on ); void activityIndicatorPressed( void ); void activityIndicatorReleased( void ); diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 5f9f99ce4..e4f29c11d 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -762,13 +762,14 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) m_audioPort.getEffects()->restoreState( node.toElement() ); } - else if( automationPattern::classNodeName() - != node.nodeName() ) + else if( automationPattern::classNodeName() != + node.nodeName() ) { // if node-name doesn't match any known one, // we assume that it is an instrument-plugin // which we'll try to load delete m_instrument; + m_instrument = NULL; m_instrument = instrument::instantiate( node.nodeName(), this ); if( m_instrument->nodeName() == @@ -831,7 +832,8 @@ void instrumentTrack::invalidateAllMyNPH( void ) instrumentTrackView::instrumentTrackView( instrumentTrack * _it, trackContainerView * _tcv ) : - trackView( _it, _tcv ) + trackView( _it, _tcv ), + m_window( NULL ) { setAcceptDrops( TRUE ); setFixedHeight( 32 ); @@ -910,9 +912,8 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it, setModel( _it ); - m_window = new instrumentTrackWindow( this ); connect( m_tswInstrumentTrackButton, SIGNAL( toggled( bool ) ), - m_window, SLOT( toggledInstrumentTrackButton( bool ) ) ); + this, SLOT( toggledInstrumentTrackButton( bool ) ) ); } @@ -927,6 +928,28 @@ instrumentTrackView::~instrumentTrackView() +instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void ) +{ + if( m_window == NULL ) + { + m_window = new instrumentTrackWindow( this ); + connect( m_tswInstrumentTrackButton, SIGNAL( toggled( bool ) ), + this, SLOT( toggledInstrumentTrackButton( bool ) ) ); + } + return( m_window ); +} + + + + +void instrumentTrackView::toggledInstrumentTrackButton( bool _on ) +{ + getInstrumentTrackWindow()->toggledInstrumentTrackButton( _on ); +} + + + + void instrumentTrackView::activityIndicatorPressed( void ) { model()->processInEvent( midiEvent( NOTE_ON, 0, @@ -1418,7 +1441,8 @@ void instrumentTrackButton::paintEvent( QPaintEvent * _pe ) void instrumentTrackButton::dragEnterEvent( QDragEnterEvent * _dee ) { - m_instrumentTrackView->m_window->dragEnterEvent( _dee ); + m_instrumentTrackView->getInstrumentTrackWindow()-> + dragEnterEvent( _dee ); } @@ -1426,7 +1450,7 @@ void instrumentTrackButton::dragEnterEvent( QDragEnterEvent * _dee ) void instrumentTrackButton::dropEvent( QDropEvent * _de ) { - m_instrumentTrackView->m_window->dropEvent( _de ); + m_instrumentTrackView->getInstrumentTrackWindow()->dropEvent( _de ); setChecked( TRUE ); }