[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdenlive] src/monitor: Small fixes in markers display
From: Jean-Baptiste Mardelle <jb () kdenlive ! org>
Date: 2015-12-31 17:53:03
Message-ID: E1aEhPL-0008Ua-8m () scm ! kde ! org
[Download RAW message or body]
Git commit ff6cff87cc3a43916d15990b65db99ba463acaa2 by Jean-Baptiste Mardelle.
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() != QLatin1String("root")) {
// we are not in main view, ignore
return;
}
QString overlayText;
- int pos = m_timePos->getValue();
+ if (pos == -1) pos = m_timePos->getValue();
QPoint zone = m_ruler->zone();
- if (pos == zone.x())
- overlayText = i18n("In Point");
- else if (pos == zone.y())
- overlayText = i18n("Out Point");
- else if (m_controller) {
- overlayText = m_controller->markerComment(GenTime(pos, m_monitorManager->timecode().fps()));
+ if (m_id == Kdenlive::ClipMonitor) {
+ if (m_controller) {
+ overlayText = m_controller->markerComment(GenTime(pos, m_monitorManager->timecode().fps()));
+ if (overlayText.isEmpty()) {
+ if (pos == zone.x())
+ overlayText = i18n("In Point");
+ else if (pos == zone.y())
+ overlayText = i18n("Out Point");
+ }
+ }
}
- else {
+ else if (m_id == Kdenlive::ProjectMonitor) {
// Check for timeline guides
overlayText = m_ruler->markerAt(GenTime(pos, m_monitorManager->timecode().fps()));
+ if (overlayText.isEmpty()) {
+ if (pos == zone.x())
+ overlayText = i18n("In Point");
+ else if (pos == zone.y())
+ overlayText = i18n("Out Point");
+ }
}
if (overlayText != 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 != 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 = 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 = -1);
void updateTimecodeFormat();
void updateMarkers();
/** @brief Controller for the clip currently displayed (only valid for clip monitor). */
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic