summaryrefslogtreecommitdiff
path: root/muse2/muse/exportmidi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/exportmidi.cpp')
-rw-r--r--muse2/muse/exportmidi.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp
index e5cd74e1..aa9b83cc 100644
--- a/muse2/muse/exportmidi.cpp
+++ b/muse2/muse/exportmidi.cpp
@@ -131,11 +131,11 @@ static void addController(MPEventList* l, int tick, int port, int channel, int a
// track can be NULL meaning no concept of drum notes is allowed in init sequences.
//---------------------------------------------------------
-static void addEventList(MusECore::EventList* evlist, MusECore::MPEventList* mpevlist, MusECore::MidiTrack* track, MusECore::Part* part, int port, int channel)
+static void addEventList(const MusECore::EventList& evlist, MusECore::MPEventList* mpevlist, MusECore::MidiTrack* track, MusECore::Part* part, int port, int channel)
{
- for (MusECore::iEvent i = evlist->begin(); i != evlist->end(); ++i)
+ for (MusECore::ciEvent i = evlist.begin(); i != evlist.end(); ++i)
{
- MusECore::Event ev = i->second;
+ const MusECore::Event& ev = i->second;
int tick = ev.tick();
if(part)
tick += part->tick();
@@ -519,8 +519,7 @@ void MusE::exportMidi()
MusECore::PartList* parts = track->parts();
for (MusECore::iPart p = parts->begin(); p != parts->end(); ++p) {
MusECore::MidiPart* part = (MusECore::MidiPart*) (p->second);
- MusECore::EventList* evlist = part->events();
- MusECore::addEventList(evlist, l, track, part, port, channel);
+ MusECore::addEventList(part->events(), l, track, part, port, channel);
}
++i;
@@ -529,12 +528,7 @@ void MusE::exportMidi()
mf.setDivision(MusEGlobal::config.midiDivision);
mf.setTrackList(mtl, i);
mf.write();
-
- // DELETETHIS 4 ??? or is this still an issue?
- // TESTING: Cleanup. I did not valgrind this feature in last memleak fixes, but I suspect it leaked.
- //for(MusECore::iMidiFileTrack imft = mtl->begin(); imft != mtl->end(); ++imft)
- // delete *imft;
- //delete mtl;
+
}
} // namespace MusEGui