From kde-commits Thu Dec 31 17:53:03 2015 From: Jean-Baptiste Mardelle Date: Thu, 31 Dec 2015 17:53:03 +0000 To: kde-commits Subject: [kdenlive] src/monitor: Small fixes in markers display Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145158439607994 Git commit ff6cff87cc3a43916d15990b65db99ba463acaa2 by Jean-Baptiste Mardel= le. Committed on 31/12/2015 at 17:52. Pushed by mardelle into branch 'master'. Small fixes in markers display M +22 -11 src/monitor/monitor.cpp M +1 -1 src/monitor/monitor.h http://commits.kde.org/kdenlive/ff6cff87cc3a43916d15990b65db99ba463acaa2 diff --git a/src/monitor/monitor.cpp b/src/monitor/monitor.cpp index a210269..de96c92 100644 --- a/src/monitor/monitor.cpp +++ b/src/monitor/monitor.cpp @@ -962,25 +962,35 @@ void Monitor::slotSeek(int pos) m_ruler->update(); } = -void Monitor::checkOverlay() +void Monitor::checkOverlay(int pos) { if (!m_rootItem || m_rootItem->objectName() !=3D QLatin1String("root")= ) { // we are not in main view, ignore return; } QString overlayText; - int pos =3D m_timePos->getValue(); + if (pos =3D=3D -1) pos =3D m_timePos->getValue(); QPoint zone =3D m_ruler->zone(); - if (pos =3D=3D zone.x()) - overlayText =3D i18n("In Point"); - else if (pos =3D=3D zone.y()) - overlayText =3D i18n("Out Point"); - else if (m_controller) { - overlayText =3D m_controller->markerComment(GenTime(pos, m_monitor= Manager->timecode().fps())); + if (m_id =3D=3D Kdenlive::ClipMonitor) { + if (m_controller) { + overlayText =3D m_controller->markerComment(GenTime(pos, m_mon= itorManager->timecode().fps())); + if (overlayText.isEmpty()) { + if (pos =3D=3D zone.x()) + overlayText =3D i18n("In Point"); + else if (pos =3D=3D zone.y()) + overlayText =3D i18n("Out Point"); + } + } } - else { + else if (m_id =3D=3D Kdenlive::ProjectMonitor) { // Check for timeline guides overlayText =3D m_ruler->markerAt(GenTime(pos, m_monitorManager->t= imecode().fps())); + if (overlayText.isEmpty()) { + if (pos =3D=3D zone.x()) + overlayText =3D i18n("In Point"); + else if (pos =3D=3D zone.y()) + overlayText =3D i18n("Out Point"); + } } if (overlayText !=3D m_markerItem->property("text")) { m_markerItem->setProperty("text", overlayText); @@ -1091,7 +1101,7 @@ void Monitor::seekCursor(int pos) { if (m_ruler->slotNewValue(pos)) { m_timePos->setValue(pos); - checkOverlay(); + checkOverlay(pos); if (m_id !=3D Kdenlive::ClipMonitor) { emit renderPosition(pos); } @@ -1102,7 +1112,7 @@ void Monitor::rendererStopped(int pos) { if (m_ruler->slotNewValue(pos)) { m_timePos->setValue(pos); - checkOverlay(); + checkOverlay(pos); } m_playAction->setActive(false); } @@ -1280,6 +1290,7 @@ void Monitor::slotOpenClip(ClipController *controller= , int in, int out) m_glMonitor->setAudioThumb(); //hasEffects =3D false; } + checkOverlay(); } = void Monitor::enableCompare(int effectsCount) diff --git a/src/monitor/monitor.h b/src/monitor/monitor.h index d9947db..3d406fa 100644 --- a/src/monitor/monitor.h +++ b/src/monitor/monitor.h @@ -95,7 +95,7 @@ public: const QString activeClipId(); GenTime position(); /** @brief Check current position to show relevant infos in qml view (= markers, zone in/out, etc). */ - void checkOverlay(); + void checkOverlay(int pos =3D -1); void updateTimecodeFormat(); void updateMarkers(); /** @brief Controller for the clip currently displayed (only valid for= clip monitor). */