* fixed issue when moving BB-tracks up/down where actual BB-TCOs were not moved

* in trackContentObjectView and trackView, handle deletion of models more gracefully



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1137 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-15 12:52:20 +00:00
parent e2b533dcc5
commit 9f584e5612
3 changed files with 104 additions and 13 deletions

View File

@@ -1,3 +1,92 @@
2008-06-15 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/stk/voices/flute/flute_model.cpp:
* plugins/stk/voices/flute/flute_model.h:
* plugins/stk/voices/flute/flute_instrument.cpp:
* plugins/stk/voices/resonate/resonate_model.cpp:
* plugins/stk/voices/resonate/resonate_model.h:
* plugins/stk/voices/resonate/resonate_instrument.cpp:
* plugins/stk/voices/include/stk_instrument.h:
* plugins/stk/voices/include/stk_processor.h:
* plugins/stk/voices/include/stk_model.h:
* plugins/stk/voices/include/stk_voice.h:
* plugins/stk/voices/wurley/wurley_instrument.cpp:
* plugins/stk/voices/wurley/wurley_model.cpp:
* plugins/stk/voices/wurley/wurley_model.h:
* plugins/stk/voices/src/stk_model.cpp:
* plugins/stk/voices/percflute/percflute_model.h:
* plugins/stk/voices/percflute/percflute_instrument.cpp:
* plugins/stk/voices/percflute/percflute_model.cpp:
* plugins/stk/voices/rhodey/rhodey_model.h:
* plugins/stk/voices/rhodey/rhodey_instrument.cpp:
* plugins/stk/voices/rhodey/rhodey_model.cpp:
* plugins/stk/voices/tubebell/tubebell_model.cpp:
* plugins/stk/voices/tubebell/tubebell_model.h:
* plugins/stk/voices/tubebell/tubebell_instrument.cpp:
* plugins/stk/voices/bowed/bowed_model.cpp:
* plugins/stk/voices/bowed/bowed_model.h:
* plugins/stk/voices/bowed/bowed_instrument.cpp:
* plugins/stk/voices/clarinet/clarinet_model.cpp:
* plugins/stk/voices/clarinet/clarinet_model.h:
* plugins/stk/voices/clarinet/clarinet_instrument.cpp:
* plugins/stk/voices/moog/moog_model.cpp:
* plugins/stk/voices/moog/moog_model.h:
* plugins/stk/voices/moog/moog_instrument.cpp:
* plugins/stk/voices/metal/metal_model.cpp:
* plugins/stk/voices/metal/metal_model.h:
* plugins/stk/voices/metal/metal_instrument.cpp:
* plugins/stk/voices/b3/b3_model.cpp:
* plugins/stk/voices/b3/b3_model.h:
* plugins/stk/voices/b3/b3_instrument.cpp:
* plugins/stk/voices/blow_hole/blow_hole_model.h:
* plugins/stk/voices/blow_hole/blow_hole_instrument.cpp:
* plugins/stk/voices/blow_hole/blow_hole_model.cpp:
* plugins/stk/voices/brass/brass_model.h:
* plugins/stk/voices/brass/brass_instrument.cpp:
* plugins/stk/voices/brass/brass_model.cpp:
* plugins/stk/voices/fmvoices/fmvoices_model.h:
* plugins/stk/voices/fmvoices/fmvoices_instrument.cpp:
* plugins/stk/voices/fmvoices/fmvoices_model.cpp:
* plugins/stk/voices/bandedwg/bandedwg_model.h:
* plugins/stk/voices/bandedwg/bandedwg_instrument.cpp:
* plugins/stk/voices/bandedwg/bandedwg_model.cpp:
* plugins/stk/voices/blow_bottle/blow_bottle_model.h:
* plugins/stk/voices/blow_bottle/blow_bottle_instrument.cpp:
* plugins/stk/voices/blow_bottle/blow_bottle_model.cpp:
made STK-voices-plugins compile after they've not been maintained for
a while
* include/pixmap_button.h:
* src/gui/widgets/pixmap_button.cpp:
removed removed obsolete ctrlClick() signal
* include/track_container.h:
* src/core/track_container.cpp:
removed obsolete setMutedOfAllTracks() method
* src/core/song.cpp:
- lock mixer while loading project - fixes crashes when loading projects
with FX-mixer settings
- update BB-track-container after creating a new project - fixes
non-existing TCOs (i.e. patterns) in BB-Editor in new projects
* include/config_mgr.h:
added missing include
* src/tracks/bb_track.cpp:
unregister BB-track-view from BB-editor at destruction - fixes crash
when removing BB-tracks
* src/core/bb_track_container.cpp:
cleanups and more optimized loops
* include/track.h:
* src/core/track.cpp:
- fixed issue when moving BB-tracks up/down where actual BB-TCOs were
not moved
- in trackContentObjectView and trackView, handle deletion of models
more gracefully
2008-06-14 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/spectrum_analyzer/spectrum_analyzer.cpp:

View File

@@ -113,6 +113,7 @@ protected slots:
signals:
void lengthChanged( void );
void positionChanged( void );
void destroyed( void );
private:
@@ -453,6 +454,7 @@ private:
signals:
void trackContentObjectAdded( trackContentObject * );
void destroyed( void );
} ;

View File

@@ -93,6 +93,8 @@ trackContentObject::trackContentObject( track * _track ) :
trackContentObject::~trackContentObject()
{
emit destroyed();
m_track->removeTCO( this );
}
@@ -224,8 +226,7 @@ trackContentObjectView::trackContentObjectView( trackContentObject * _tco,
this, SLOT( updateLength() ) );
connect( m_tco, SIGNAL( positionChanged() ),
this, SLOT( updatePosition() ) );
connect( m_tco, SIGNAL( destroyed( QObject * ) ),
this, SLOT( close() ), Qt::QueuedConnection );
connect( m_tco, SIGNAL( destroyed() ), this, SLOT( close() ) );
setModel( m_tco );
m_trackView->getTrackContentWidget()->addTCOView( this );
@@ -474,7 +475,8 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
arg( m_tco->startPosition().getTact() + 1 ).
arg( m_tco->startPosition().getTicks() %
midiTime::ticksPerTact() ) );
s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2 ) );
s_textFloat->moveGlobal( this, QPoint( width() + 2,
height() + 2 ) );
}
else if( m_action == MoveSelection )
{
@@ -713,14 +715,14 @@ void trackContentWidget::changePosition( const midiTime & _new_pos )
if( m_trackView->getTrackContainerView() == engine::getBBEditor() )
{
const int cur_bb = engine::getBBTrackContainer()->currentBB();
int i = 0;
setUpdatesEnabled( false );
// first show TCO for current BB...
for( tcoViewVector::iterator it = m_tcoViews.begin();
it != m_tcoViews.end(); ++it, ++i )
it != m_tcoViews.end(); ++it )
{
if( i == cur_bb )
if( ( *it )->getTrackContentObject()->
startPosition().getTact() == cur_bb )
{
( *it )->move( 0, ( *it )->y() );
( *it )->raise();
@@ -732,11 +734,11 @@ void trackContentWidget::changePosition( const midiTime & _new_pos )
}
}
// ...then hide others to avoid flickering
i = 0;
for( tcoViewVector::iterator it = m_tcoViews.begin();
it != m_tcoViews.end(); ++it, ++i )
it != m_tcoViews.end(); ++it )
{
if( i != cur_bb )
if( ( *it )->getTrackContentObject()->
startPosition().getTact() != cur_bb )
{
( *it )->hide();
}
@@ -1786,8 +1788,7 @@ trackView::trackView( track * _track, trackContainerView * _tcv ) :
setAttribute( Qt::WA_DeleteOnClose );
connect( m_track, SIGNAL( destroyed( QObject * ) ),
this, SLOT( close() ), Qt::QueuedConnection );
connect( m_track, SIGNAL( destroyed() ), this, SLOT( close() ) );
connect( m_track,
SIGNAL( trackContentObjectAdded( trackContentObject * ) ),
this, SLOT( createTCOView( trackContentObject * ) ),
@@ -1856,8 +1857,7 @@ void trackView::modelChanged( void )
{
m_track = castModel<track>();
assert( m_track != NULL );
connect( m_track, SIGNAL( destroyed( QObject * ) ),
this, SLOT( close() ), Qt::QueuedConnection );
connect( m_track, SIGNAL( destroyed() ), this, SLOT( close() ) );
m_trackOperationsWidget.m_muteBtn->setModel( &m_track->m_mutedModel );
m_trackOperationsWidget.m_soloBtn->setModel( &m_track->m_soloModel );
modelView::modelChanged();