diff options
author | Florian Jung <flo@windfisch.org> | 2013-08-16 23:04:08 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2013-08-16 23:04:08 +0200 |
commit | 4933ccfe7552dc5dbb2921f6583bbeb92dd144b4 (patch) | |
tree | aca8f234f17bbe94fc78c4d1cedd8e8649d2dd1f /muse2/muse/exportmidi.cpp | |
parent | be3b3fef8d787f167b57ebfd700717a02c38570d (diff) |
Parts have their own, non-shared EventList (still WIP!)
removed refcounting in Eventlist
Part::events() is now a const EventList&
chaining parts now a Part:: member function
made Track::events, ::mpevents public instead of using an insane reference-accessor
TODO: need a grouping indicator of clones (like the eventlist pointer was used for)
Diffstat (limited to 'muse2/muse/exportmidi.cpp')
-rw-r--r-- | muse2/muse/exportmidi.cpp | 16 |
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 |