MidiGhostRegion micro-optimisation.
This commit is contained in:
parent
e7415c6619
commit
86a471f93f
@ -340,13 +340,13 @@ MidiGhostRegion::add_note (NoteBase* n)
|
|||||||
MidiStreamView* mv = midi_view();
|
MidiStreamView* mv = midi_view();
|
||||||
|
|
||||||
if (mv) {
|
if (mv) {
|
||||||
uint8_t const note_num = n->note()->note();
|
|
||||||
double const h = note_height(trackview, mv);
|
|
||||||
double const y = note_y(trackview, mv, note_num);
|
|
||||||
|
|
||||||
if (!n->item()->visible()) {
|
if (!n->item()->visible()) {
|
||||||
event->item->hide();
|
event->item->hide();
|
||||||
} else {
|
} else {
|
||||||
|
uint8_t const note_num = n->note()->note();
|
||||||
|
double const h = note_height(trackview, mv);
|
||||||
|
double const y = note_y(trackview, mv, note_num);
|
||||||
if (!event->is_hit) {
|
if (!event->is_hit) {
|
||||||
_tmp_rect = static_cast<ArdourCanvas::Rectangle*>(event->item);
|
_tmp_rect = static_cast<ArdourCanvas::Rectangle*>(event->item);
|
||||||
_tmp_rect->set (ArdourCanvas::Rect (_tmp_rect->x0(), y, _tmp_rect->x1(), y + h));
|
_tmp_rect->set (ArdourCanvas::Rect (_tmp_rect->x0(), y, _tmp_rect->x1(), y + h));
|
||||||
@ -387,15 +387,15 @@ MidiGhostRegion::update_note (Note* note, bool hide)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t const note_num = note->note()->note();
|
|
||||||
|
|
||||||
double const y = note_y(trackview, mv, note_num);
|
|
||||||
double const h = note_height(trackview, mv);
|
|
||||||
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
ev->item->hide();
|
ev->item->hide();
|
||||||
} else if (!ev->is_hit) {
|
} else if (!ev->is_hit) {
|
||||||
_tmp_rect = static_cast<ArdourCanvas::Rectangle*>(ev->item);
|
_tmp_rect = static_cast<ArdourCanvas::Rectangle*>(ev->item);
|
||||||
|
|
||||||
|
uint8_t const note_num = note->note()->note();
|
||||||
|
double const y = note_y(trackview, mv, note_num);
|
||||||
|
double const h = note_height(trackview, mv);
|
||||||
|
|
||||||
_tmp_rect->set (ArdourCanvas::Rect (note->x0(), y, note->x1(), y + h));
|
_tmp_rect->set (ArdourCanvas::Rect (note->x0(), y, note->x1(), y + h));
|
||||||
|
|
||||||
ev->item->show();
|
ev->item->show();
|
||||||
@ -420,15 +420,15 @@ MidiGhostRegion::update_hit (Hit* hit, bool hide)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t const note_num = ev->event->note()->note();
|
|
||||||
|
|
||||||
double const h = note_height(trackview, mv);
|
|
||||||
double const y = note_y(trackview, mv, note_num);
|
|
||||||
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
ev->item->hide();
|
ev->item->hide();
|
||||||
} else if (ev->is_hit) {
|
} else if (ev->is_hit) {
|
||||||
_tmp_poly = static_cast<ArdourCanvas::Polygon*>(ev->item);
|
_tmp_poly = static_cast<ArdourCanvas::Polygon*>(ev->item);
|
||||||
|
|
||||||
|
uint8_t const note_num = ev->event->note()->note();
|
||||||
|
double const h = note_height(trackview, mv);
|
||||||
|
double const y = note_y(trackview, mv, note_num);
|
||||||
|
|
||||||
ArdourCanvas::Duple ppos = hit->position();
|
ArdourCanvas::Duple ppos = hit->position();
|
||||||
ArdourCanvas::Duple gpos = _tmp_poly->position();
|
ArdourCanvas::Duple gpos = _tmp_poly->position();
|
||||||
gpos.x = ppos.x;
|
gpos.x = ppos.x;
|
||||||
|
Loading…
Reference in New Issue
Block a user