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:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user