implemented correct behaviour when cloning BB-tracks (closes #2042409)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1465 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-08-22 21:02:33 +00:00
parent b789cc4c68
commit 1661aba15f
5 changed files with 39 additions and 13 deletions

View File

@@ -1,5 +1,11 @@
2008-08-22 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/bb_track_container.h:
* include/track.h:
* src/core/track.cpp:
* src/tracks/bb_track.cpp:
implemented correct behaviour when cloning BB-tracks (closes #2042409)
* src/core/midi/midi_alsa_seq.cpp:
fixed strange ALSA-sequencer behaviour when using MIDI-controllers and
controlling intrument-tracks via MIDI (closes #2062907)

View File

@@ -61,6 +61,7 @@ public:
void updateBBTrack( trackContentObject * _tco );
void fixIncorrectPositions( void );
void createTCOsForBB( int _bb );
public slots:
@@ -71,8 +72,6 @@ public slots:
private:
void createTCOsForBB( int _bb );
comboBoxModel m_bbComboBoxModel;

View File

@@ -112,17 +112,17 @@ public:
virtual trackContentObjectView * createView( trackView * _tv ) = 0;
protected:
virtual void undoStep( journalEntry & _je );
virtual void redoStep( journalEntry & _je );
protected slots:
public slots:
void copy( void );
void paste( void );
void toggleMute( void );
protected:
virtual void undoStep( journalEntry & _je );
virtual void redoStep( journalEntry & _je );
signals:
void lengthChanged( void );
void positionChanged( void );

View File

@@ -1613,7 +1613,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc )
/*! \brief Create a track from track type in a QDomElement and a container object.
/*! \brief Create a track inside trackContainer from track type in a QDomElement and restore state from XML
*
* \param _this The QDomElement containing the type of track to create
* \param _tc The track container to attach to

View File

@@ -437,6 +437,10 @@ void bbTrack::saveTrackSpecificSettings( QDomDocument & _doc,
( (journallingObject *)( engine::getBBTrackContainer() ) )->
saveState( _doc, _this );
}
if( _this.parentNode().parentNode().nodeName() == "clone" )
{
_this.setAttribute( "clonebbt", s_infoMap[this] );
}
}
@@ -448,13 +452,30 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
{
m_trackLabel->setPixmapFile( _this.attribute( "icon" ) );
}*/
// engine::getBBTrackContainer()->updateComboBox();
QDomNode node = _this.namedItem( trackContainer::classNodeName() );
if( node.isElement() )
if( _this.hasAttribute( "clonebbt" ) )
{
( (journallingObject *)engine::getBBTrackContainer() )->
const int src = _this.attribute( "clonebb" ).toInt();
const int dst = s_infoMap[this];
engine::getBBTrackContainer()->createTCOsForBB( dst );
trackContainer::trackList tl =
engine::getBBTrackContainer()->tracks();
for( trackContainer::trackList::iterator it = tl.begin();
it != tl.end(); ++it )
{
( *it )->getTCO( src )->copy();
( *it )->getTCO( dst )->paste();
}
}
else
{
QDomNode node = _this.namedItem(
trackContainer::classNodeName() );
if( node.isElement() )
{
( (journallingObject *)engine::getBBTrackContainer() )->
restoreState( node.toElement() );
}
}
/* doesn't work yet because bbTrack-ctor also sets current bb so if
bb-tracks are created after this function is called, this doesn't