MCPcopy Create free account
hub / github.com/LMMS/lmms / loadTrackSpecificSettings

Method loadTrackSpecificSettings

src/tracks/BBTrack.cpp:542–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540
541
542void BBTrack::loadTrackSpecificSettings( const QDomElement & _this )
543{
544/* if( _this.attribute( "icon" ) != "" )
545 {
546 m_trackLabel->setPixmapFile( _this.attribute( "icon" ) );
547 }*/
548
549 if( _this.hasAttribute( "clonebbt" ) )
550 {
551 const int src = _this.attribute( "clonebbt" ).toInt();
552 const int dst = s_infoMap[this];
553 TrackContainer::TrackList tl =
554 Engine::getBBTrackContainer()->tracks();
555 // copy TCOs of all tracks from source BB (at bar "src") to destination
556 // TCOs (which are created if they do not exist yet)
557 for( TrackContainer::TrackList::iterator it = tl.begin();
558 it != tl.end(); ++it )
559 {
560 ( *it )->getTCO( src )->copy();
561 ( *it )->getTCO( dst )->paste();
562 }
563 setName( tr( "Clone of %1" ).arg(
564 _this.parentNode().toElement().attribute( "name" ) ) );
565 }
566 else
567 {
568 QDomNode node = _this.namedItem(
569 TrackContainer::classNodeName() );
570 if( node.isElement() )
571 {
572 ( (JournallingObject *)Engine::getBBTrackContainer() )->
573 restoreState( node.toElement() );
574 }
575 }
576/* doesn't work yet because BBTrack-ctor also sets current bb so if
577 bb-tracks are created after this function is called, this doesn't
578 help at all....
579 if( _this.attribute( "current" ).toInt() )
580 {
581 engine::getBBEditor()->setCurrentBB( s_infoMap[this] );
582 }*/
583}
584
585
586

Callers 1

Calls 10

getBBTrackContainerFunction · 0.85
tracksMethod · 0.80
getTCOMethod · 0.80
setNameFunction · 0.50
classNodeNameFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
copyMethod · 0.45
pasteMethod · 0.45
restoreStateMethod · 0.45

Tested by

no test coverage detected