diff options
author | Florian Jung <flo@windfisch.org> | 2013-09-18 23:54:35 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2013-09-18 23:54:35 +0200 |
commit | b3fc353a09496ee0aea7099d72e6963f4c2fc774 (patch) | |
tree | 83ab91e988c59076d81ebddc09e8ff274dee8af5 /muse2/muse/exportmidi.cpp | |
parent | 48a93993cfce160fb7d4cf0b67b4b77e22db19e5 (diff) | |
parent | 85a51421d44f3893a1010f77e0418caf6be70235 (diff) |
Merge branch 'audiomsg_overhaul' (nonshared eventlists and more)
This introduces the following changes:
- Clone Parts no more share their eventlist. Instead, all changes
made to one clone are replicated to the other clones' eventlists
- audio/song->msg{Add,Delete,Change}{Part,Event,Track} have been
replaced by the corresponding UndoOp operations.
- Enforcing of const-correctness: No GUI code may ever gain
writable access to audio/midi/song data structures. Access
must *always* go through applyOperationGroup. This is now
enforced.
- Removed a bunch of DELETETHIS or REMOVE or otherwise commented
out code
- Removed dead code
- Removed unused Audio Messages (that should go through applyOpGroup
anyway.)
Diffstat (limited to 'muse2/muse/exportmidi.cpp')
-rw-r--r-- | muse2/muse/exportmidi.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp index e5cd74e1..34ac8983 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(); @@ -490,7 +490,7 @@ void MusE::exportMidi() { MusECore::EventList* el = instr->midiInit(); if(!el->empty()) - MusECore::addEventList(el, l, NULL, NULL, port, channel); // No track or part passed for init sequences + MusECore::addEventList(*el, l, NULL, NULL, port, channel); // No track or part passed for init sequences } //-------------------------- @@ -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 |