more note performance work (dereference less).
This commit is contained in:
@@ -273,8 +273,8 @@ MidiGhostRegion::set_colors()
|
||||
_outline = UIConfiguration::instance().color ("ghost track midi outline");
|
||||
|
||||
for (EventList::iterator it = events.begin(); it != events.end(); ++it) {
|
||||
(*it).second->item->set_fill_color (UIConfiguration::instance().color_mod((*it).second->event->base_color(), "ghost track midi fill"));
|
||||
(*it).second->item->set_outline_color (_outline);
|
||||
it->second->item->set_fill_color (UIConfiguration::instance().color_mod((*it).second->event->base_color(), "ghost track midi fill"));
|
||||
it->second->item->set_outline_color (_outline);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,13 +309,13 @@ MidiGhostRegion::update_contents_height ()
|
||||
double const h = note_height(trackview, mv);
|
||||
|
||||
for (EventList::iterator it = events.begin(); it != events.end(); ++it) {
|
||||
uint8_t const note_num = (*it).second->event->note()->note();
|
||||
uint8_t const note_num = it->second->event->note()->note();
|
||||
|
||||
double const y = note_y(trackview, mv, note_num);
|
||||
|
||||
if ((_tmp_rect = dynamic_cast<ArdourCanvas::Rectangle*>((*it).second->item))) {
|
||||
if ((_tmp_rect = dynamic_cast<ArdourCanvas::Rectangle*>(it->second->item))) {
|
||||
_tmp_rect->set (ArdourCanvas::Rect (_tmp_rect->x0(), y, _tmp_rect->x1(), y + h));
|
||||
} else if ((_tmp_poly = dynamic_cast<ArdourCanvas::Polygon*>((*it).second->item))) {
|
||||
} else if ((_tmp_poly = dynamic_cast<ArdourCanvas::Polygon*>(it->second->item))) {
|
||||
Duple position = _tmp_poly->position();
|
||||
position.y = y;
|
||||
_tmp_poly->set_position(position);
|
||||
@@ -442,7 +442,7 @@ MidiGhostRegion::remove_note (NoteBase* note)
|
||||
return;
|
||||
}
|
||||
|
||||
delete (*f).second;
|
||||
delete f->second;
|
||||
events.erase (f);
|
||||
|
||||
_optimization_iterator = events.end ();
|
||||
@@ -462,14 +462,14 @@ MidiGhostRegion::find_event (NoteBase* parent)
|
||||
|
||||
if (_optimization_iterator != events.end()) {
|
||||
++_optimization_iterator;
|
||||
if (_optimization_iterator != events.end() && (*_optimization_iterator).second->event == parent) {
|
||||
return (*_optimization_iterator).second;
|
||||
if (_optimization_iterator != events.end() && _optimization_iterator->second->event == parent) {
|
||||
return _optimization_iterator->second;
|
||||
}
|
||||
}
|
||||
|
||||
_optimization_iterator = events.find (parent->note());
|
||||
if (_optimization_iterator != events.end()) {
|
||||
return (*_optimization_iterator).second;
|
||||
return _optimization_iterator->second;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1140,7 +1140,7 @@ MidiRegionView::find_canvas_patch_change (MidiModel::PatchChangePtr p)
|
||||
PatchChanges::const_iterator f = _patch_changes.find (p);
|
||||
|
||||
if (f != _patch_changes.end()) {
|
||||
return (*f).second;
|
||||
return f->second;
|
||||
}
|
||||
|
||||
return boost::shared_ptr<PatchChange>();
|
||||
@@ -1194,36 +1194,36 @@ MidiRegionView::redisplay_model()
|
||||
MidiModel::Notes::iterator f;
|
||||
for (Events::iterator i = _events.begin(); i != _events.end(); ) {
|
||||
boost::shared_ptr<NoteType> note = (*i)->note();
|
||||
NoteBase* cne = (*i);
|
||||
|
||||
/* if event item's note exists in the model, we can just update it.
|
||||
* don't mark it as missing.
|
||||
*/
|
||||
if ((f = missing_notes.find (note)) != missing_notes.end()) {
|
||||
if ((*f) == note) {
|
||||
(*i)->validate();
|
||||
cne->validate();
|
||||
missing_notes.erase (f);
|
||||
} else {
|
||||
(*i)->invalidate();
|
||||
cne->invalidate();
|
||||
}
|
||||
|
||||
} else {
|
||||
(*i)->invalidate();
|
||||
cne->invalidate();
|
||||
}
|
||||
/* remove note items that are no longer valid */
|
||||
if (!(*i)->valid()) {
|
||||
if (!cne->valid()) {
|
||||
|
||||
for (vector<GhostRegion*>::iterator j = ghosts.begin(); j != ghosts.end(); ++j) {
|
||||
MidiGhostRegion* gr = dynamic_cast<MidiGhostRegion*> (*j);
|
||||
if (gr) {
|
||||
gr->remove_note (*i);
|
||||
gr->remove_note (cne);
|
||||
}
|
||||
}
|
||||
|
||||
delete *i;
|
||||
delete cne;
|
||||
i = _events.erase (i);
|
||||
|
||||
} else {
|
||||
NoteBase* cne = (*i);
|
||||
bool visible;
|
||||
bool update = false;
|
||||
|
||||
@@ -1968,7 +1968,7 @@ MidiRegionView::remove_canvas_patch_change (PatchChange* pc)
|
||||
{
|
||||
/* remove the canvas item */
|
||||
for (PatchChanges::iterator x = _patch_changes.begin(); x != _patch_changes.end(); ++x) {
|
||||
if ((*x).second->patch() == pc->patch()) {
|
||||
if (x->second->patch() == pc->patch()) {
|
||||
_patch_changes.erase (x);
|
||||
break;
|
||||
}
|
||||
@@ -2061,7 +2061,7 @@ MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const
|
||||
trackview.editor().commit_reversible_command ();
|
||||
|
||||
for (PatchChanges::iterator x = _patch_changes.begin(); x != _patch_changes.end(); ++x) {
|
||||
if ((*x).second->patch() == old_change) {
|
||||
if (x->second->patch() == old_change) {
|
||||
_patch_changes.erase (x);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user