Mercurial > hg > svgui
diff view/AlignmentView.cpp @ 1324:13d9b422f7fe zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:31 +0100 |
parents | 57d192e26331 a34a2a25907c |
children | c8a6fd3f9dff |
line wrap: on
line diff
--- a/view/AlignmentView.cpp Mon Dec 12 15:18:52 2016 +0000 +++ b/view/AlignmentView.cpp Mon Sep 17 13:51:31 2018 +0100 @@ -43,10 +43,10 @@ { View::viewCentreFrameChanged(v, f); if (v == m_above) { - m_centreFrame = f; - update(); + m_centreFrame = f; + update(); } else if (v == m_below) { - update(); + update(); } } @@ -73,15 +73,15 @@ AlignmentView::setViewAbove(View *v) { if (m_above) { - disconnect(m_above, 0, this, 0); + disconnect(m_above, 0, this, 0); } m_above = v; if (m_above) { - connect(m_above, + connect(m_above, SIGNAL(zoomLevelChanged(ZoomLevel, bool)), - this, + this, SLOT(viewAboveZoomLevelChanged(ZoomLevel, bool))); } } @@ -90,15 +90,15 @@ AlignmentView::setViewBelow(View *v) { if (m_below) { - disconnect(m_below, 0, this, 0); + disconnect(m_below, 0, this, 0); } m_below = v; if (m_below) { - connect(m_below, + connect(m_below, SIGNAL(zoomLevelChanged(ZoomLevel, bool)), - this, + this, SLOT(viewBelowZoomLevelChanged(ZoomLevel, bool))); } } @@ -130,11 +130,11 @@ vector<sv_frame_t> keyFrames = getKeyFrames(); foreach (sv_frame_t f, keyFrames) { - int ax = m_above->getXForFrame(f); - sv_frame_t rf = m_above->alignToReference(f); - sv_frame_t bf = m_below->alignFromReference(rf); - int bx = m_below->getXForFrame(bf); - paint.drawLine(ax, 0, bx, height()); + int ax = m_above->getXForFrame(f); + sv_frame_t rf = m_above->alignToReference(f); + sv_frame_t bf = m_below->alignFromReference(rf); + int bx = m_below->getXForFrame(bf); + paint.drawLine(ax, 0, bx, height()); } paint.end(); @@ -144,31 +144,31 @@ AlignmentView::getKeyFrames() { if (!m_above) { - return getDefaultKeyFrames(); + return getDefaultKeyFrames(); } SparseOneDimensionalModel *m = 0; // get the topmost such for (int i = 0; i < m_above->getLayerCount(); ++i) { - if (qobject_cast<TimeInstantLayer *>(m_above->getLayer(i))) { - SparseOneDimensionalModel *mm = - qobject_cast<SparseOneDimensionalModel *> - (m_above->getLayer(i)->getModel()); - if (mm) m = mm; - } + if (qobject_cast<TimeInstantLayer *>(m_above->getLayer(i))) { + SparseOneDimensionalModel *mm = + qobject_cast<SparseOneDimensionalModel *> + (m_above->getLayer(i)->getModel()); + if (mm) m = mm; + } } if (!m) { - return getDefaultKeyFrames(); + return getDefaultKeyFrames(); } vector<sv_frame_t> keyFrames; const SparseOneDimensionalModel::PointList pp = m->getPoints(); for (SparseOneDimensionalModel::PointList::const_iterator pi = pp.begin(); - pi != pp.end(); ++pi) { - keyFrames.push_back(pi->frame); + pi != pp.end(); ++pi) { + keyFrames.push_back(pi->frame); } return keyFrames; @@ -185,9 +185,9 @@ if (rate == 0) return keyFrames; for (sv_frame_t f = m_above->getModelsStartFrame(); - f <= m_above->getModelsEndFrame(); - f += sv_frame_t(rate * 5 + 0.5)) { - keyFrames.push_back(f); + f <= m_above->getModelsEndFrame(); + f += sv_frame_t(rate * 5 + 0.5)) { + keyFrames.push_back(f); } return keyFrames;