summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2013-09-19 22:34:42 +0200
committerFlorian Jung <flo@windfisch.org>2013-09-19 22:34:42 +0200
commit1e07c748f3a30da6794577cf7e9cb5d62812cfe5 (patch)
treeac0e15a937fff15e99402cd739935e957f8b2e2e
parentb3fc353a09496ee0aea7099d72e6963f4c2fc774 (diff)
Use Part::addEvent() instead of adding to EventList directly
-rw-r--r--muse2/muse/functions.cpp2
-rw-r--r--muse2/muse/importmidi.cpp2
-rw-r--r--muse2/muse/part.cpp10
-rw-r--r--muse2/muse/remote/pyapi.cpp4
-rw-r--r--muse2/muse/song.cpp10
-rw-r--r--muse2/muse/songfile.cpp2
6 files changed, 15 insertions, 15 deletions
diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp
index 7569cc95..45c665b1 100644
--- a/muse2/muse/functions.cpp
+++ b/muse2/muse/functions.cpp
@@ -1523,7 +1523,7 @@ bool merge_parts(const set<const Part*>& parts)
{
Event new_event=ev_it->second.clone();
new_event.setTick( new_event.tick() + (*p_it)->tick() - new_part->tick() );
- new_part->nonconst_events().add(new_event);
+ new_part->addEvent(new_event);
}
}
diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp
index b0affa24..11e1db52 100644
--- a/muse2/muse/importmidi.cpp
+++ b/muse2/muse/importmidi.cpp
@@ -484,7 +484,7 @@ void MusE::processTrack(MusECore::MidiTrack* track)
MusECore::Event& ev = i->second;
int ntick = ev.tick() - startTick;
ev.setTick(ntick);
- part->nonconst_events().add(ev);
+ part->addEvent(ev);
}
tevents.erase(r1, r2);
}
diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp
index 1d246c50..e6fb087d 100644
--- a/muse2/muse/part.cpp
+++ b/muse2/muse/part.cpp
@@ -491,7 +491,7 @@ Part* Part::duplicate() const
// copy the eventlist; duplicate each Event(Ptr!).
for (MusECore::ciEvent i = _events.begin(); i != _events.end(); ++i)
- dup->_events.add(i->second.clone());
+ dup->addEvent(i->second.clone());
return dup;
}
@@ -723,11 +723,11 @@ void Part::splitPart(int tickpos, Part*& p1, Part*& p2) const
if ((s2 > d1p1) && (s1 < d2p1)) {
Event si = event.mid(d1p1 - ps, d2p1 - ps);
- p1->_events.add(si);
+ p1->addEvent(si);
}
if ((s2 > d1p2) && (s1 < d2p2)) {
Event si = event.mid(d1p2 - ps, d2p2 - ps);
- p2->_events.add(si);
+ p2->addEvent(si);
}
}
}
@@ -737,10 +737,10 @@ void Part::splitPart(int tickpos, Part*& p1, Part*& p2) const
int t = event.tick();
if (t >= l1) {
event.move(-l1);
- p2->_events.add(event);
+ p2->addEvent(event);
}
else
- p1->_events.add(event);
+ p1->addEvent(event);
}
}
}
diff --git a/muse2/muse/remote/pyapi.cpp b/muse2/muse/remote/pyapi.cpp
index 8f5abe06..fa3c1cdf 100644
--- a/muse2/muse/remote/pyapi.cpp
+++ b/muse2/muse/remote/pyapi.cpp
@@ -331,7 +331,7 @@ bool addPyPartEventsToMusePart(MidiPart* npart, PyObject* part)
event.setC(data[2]);
event.setTick(etick);
event.setLenTick(elen);
- npart->nonconst_events().add(event);
+ npart->addEvent(event);
}
else
printf("Unhandled event type from python: %s\n", type.c_str());
@@ -409,7 +409,7 @@ PyObject* modifyPart(PyObject*, PyObject* part)
if (event.type() == Note || event.type() == Controller)
continue;
- npart->nonconst_events()->add(event);
+ npart->addEvent(event);
}
addPyPartEventsToMusePart(npart, part);
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp
index 926ba0ac..3c5b8fa7 100644
--- a/muse2/muse/song.cpp
+++ b/muse2/muse/song.cpp
@@ -490,7 +490,7 @@ bool Song::addEvent(Event& event, Part* part)
return false;
}
- part->nonconst_events().add(event);
+ part->addEvent(event);
return true;
}
@@ -511,7 +511,7 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part)
else
part->nonconst_events().erase(i);
- part->nonconst_events().add(newEvent);
+ part->addEvent(newEvent);
}
//---------------------------------------------------------
@@ -752,7 +752,7 @@ void Song::cmdAddRecordedEvents(MidiTrack* mt, const EventList& events, unsigned
// addEvent also adds port controller values. So does msgAddPart, below. Let msgAddPart handle them.
//addEvent(event, part);
if(newpart->events().find(event) == newpart->events().end())
- newpart->nonconst_events().add(event);
+ newpart->addEvent(event);
}
MusEGlobal::audio->msgAddPart(newpart);
updateFlags |= SC_PART_INSERTED;
@@ -2121,7 +2121,7 @@ void Song::recordEvent(MidiTrack* mt, Event& event)
part->setLenTick(endTick - startTick);
part->setName(mt->name());
event.move(-startTick);
- part->nonconst_events().add(event);
+ part->addEvent(event);
MusEGlobal::audio->msgAddPart(part);
return;
}
@@ -2502,7 +2502,7 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo
part->setLenTick(endTick - startTick);
part->setName(mt->name());
e.setTick(tick - startTick);
- part->nonconst_events().add(e);
+ part->addEvent(e);
// Allow undo.
MusEGlobal::audio->msgAddPart(part);
}
diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp
index 78338bac..563a2203 100644
--- a/muse2/muse/songfile.cpp
+++ b/muse2/muse/songfile.cpp
@@ -304,7 +304,7 @@ Part* Part::readFromXml(Xml& xml, Track* track, bool doClone, bool toTrack)
}
else
{
- npart->_events.add(e);
+ npart->addEvent(e);
}
}
else // ...Otherwise a clone was created, so we don't need the events.