MIDI import: add naming of AutomationTracks

Name the automation tracks like "[MIDI trackname] CC ##". And don't
call the automation track creation function for every CC event, as
it now will involve constructing a QString.
This commit is contained in:
Raine M. Ekman
2015-04-24 22:44:02 +03:00
parent 2a72d5f119
commit 61ab0ed093

View File

@@ -156,12 +156,15 @@ public:
AutomationPattern * ap;
MidiTime lastPos;
smfMidiCC & create( TrackContainer* tc )
smfMidiCC & create( TrackContainer* tc, QString tn )
{
if( !at )
{
at = dynamic_cast<AutomationTrack *>( Track::create( Track::AutomationTrack, tc ) );
}
if( tn != "") {
at->setName( tn );
}
return *this;
}
@@ -487,7 +490,11 @@ bool MidiImport::readSMF( TrackContainer* tc )
}
else
{
ccs[ccid].create( tc );
if( ccs[ccid].at == NULL ) {
ccs[ccid].create( tc, trackName +
(ccid == 128 ? " Pitch bend" :
QString(" CC %1").arg(ccid) ) );
}
ccs[ccid].putValue( time, objModel, cc );
}
}