Commit 1aebed16 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2004'

parents a8097f2a 3bc09d50
Pipeline #17292 passed with stage
in 15 minutes and 4 seconds
......@@ -2238,13 +2238,6 @@ void MainWindow::connectDocument()
getMainTimeline()->focusTimeline();
}
void MainWindow::slotZoneMoved(int start, int end)
{
pCore->currentDoc()->setZone(start, end);
QPoint zone(start, end);
m_projectMonitor->slotLoadClipZone(zone);
}
void MainWindow::slotGuidesUpdated()
{
if (m_renderWidget) {
......
......@@ -392,7 +392,6 @@ private slots:
void slotGetNewKeyboardStuff(QComboBox *schemesList);
void slotAutoTransition();
void slotRunWizard();
void slotZoneMoved(int start, int end);
void slotDvdWizard(const QString &url = QString());
void slotGroupClips();
void slotUnGroupClips();
......
......@@ -381,7 +381,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
if (id != Kdenlive::ClipMonitor) {
// TODO: reimplement
// connect(render, &Render::durationChanged, this, &Monitor::durationChanged);
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::saveZone, this, &Monitor::updateTimelineClipZone);
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::saveZone, this, &Monitor::zoneUpdated);
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::saveZoneWithUndo, this, &Monitor::zoneUpdatedWithUndo);
} else {
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::saveZone, this, &Monitor::updateClipZone);
......@@ -699,28 +699,19 @@ GenTime Monitor::getSnapForPos(bool previous)
void Monitor::slotLoadClipZone(const QPoint &zone)
{
m_glMonitor->getControllerProxy()->setZone(zone.x(), zone.y());
m_glMonitor->getControllerProxy()->setZone(zone.x(), zone.y(), false);
checkOverlay();
}
void Monitor::slotSetZoneStart()
{
m_glMonitor->getControllerProxy()->setZoneIn(m_glMonitor->getCurrentPos());
if (m_controller) {
m_controller->setZone(m_glMonitor->getControllerProxy()->zone());
} else {
// timeline
emit timelineZoneChanged();
}
checkOverlay();
}
void Monitor::slotSetZoneEnd()
{
m_glMonitor->getControllerProxy()->setZoneOut(m_glMonitor->getCurrentPos() + 1);
if (m_controller) {
m_controller->setZone(m_glMonitor->getControllerProxy()->zone());
}
checkOverlay();
}
......@@ -1518,17 +1509,12 @@ const QString Monitor::sceneList(const QString &root, const QString &fullPath)
return m_glMonitor->sceneList(root, fullPath);
}
void Monitor::updateClipZone()
void Monitor::updateClipZone(const QPoint zone)
{
if (m_controller == nullptr) {
return;
}
m_controller->setZone(m_glMonitor->getControllerProxy()->zone());
}
void Monitor::updateTimelineClipZone()
{
emit zoneUpdated(m_glMonitor->getControllerProxy()->zone());
m_controller->setZone(zone);
}
void Monitor::switchDropFrames(bool drop)
......@@ -1577,10 +1563,7 @@ void Monitor::updateTimecodeFormat()
QPoint Monitor::getZoneInfo() const
{
if (m_controller == nullptr) {
return {};
}
return m_controller->zone();
return m_glMonitor->getControllerProxy()->zone();
}
void Monitor::slotEnableEffectScene(bool enable)
......
......@@ -237,7 +237,7 @@ private slots:
void slotSetThumbFrame();
void slotSaveZone();
void slotSeek();
void updateClipZone();
void updateClipZone(const QPoint zone);
void slotGoToMarker(QAction *action);
void slotSetVolume(int volume);
void slotEditMarker();
......@@ -264,8 +264,6 @@ private slots:
void setOffsetY(int y);
/** @brief Pan monitor view */
void panView(QPoint diff);
/** @brief Project monitor zone changed, inform timeline */
void updateTimelineClipZone();
void slotSeekPosition(int);
void addSnapPoint(int pos);
void removeSnapPoint(int pos);
......@@ -338,7 +336,6 @@ signals:
void refreshClipThumbnail(const QString &);
void zoneUpdated(const QPoint &);
void zoneUpdatedWithUndo(const QPoint &, const QPoint &);
void timelineZoneChanged();
/** @brief Editing transitions / effects over the monitor requires the renderer to send frames as QImage.
* This causes a major slowdown, so we only enable it if required */
void requestFrameForAnalysis(bool);
......
......@@ -569,7 +569,10 @@ void MonitorManager::slotSetInPoint()
if (m_activeMonitor == m_clipMonitor) {
m_clipMonitor->slotSetZoneStart();
} else if (m_activeMonitor == m_projectMonitor) {
m_projectMonitor->slotSetZoneStart();
QPoint sourceZone = m_projectMonitor->getZoneInfo();
QPoint destZone = sourceZone;
destZone.setX(m_projectMonitor->position());
m_projectMonitor->zoneUpdatedWithUndo(sourceZone, destZone);
}
}
......@@ -578,7 +581,10 @@ void MonitorManager::slotSetOutPoint()
if (m_activeMonitor == m_clipMonitor) {
m_clipMonitor->slotSetZoneEnd();
} else if (m_activeMonitor == m_projectMonitor) {
m_projectMonitor->slotSetZoneEnd();
QPoint sourceZone = m_projectMonitor->getZoneInfo();
QPoint destZone = sourceZone;
destZone.setY(m_projectMonitor->position());
m_projectMonitor->zoneUpdatedWithUndo(sourceZone, destZone);
}
}
......
......@@ -135,7 +135,7 @@ void MonitorProxy::setZoneIn(int pos)
emit addSnap(pos);
}
emit zoneChanged();
emit saveZone();
emit saveZone(QPoint(m_zoneIn, m_zoneOut));
}
void MonitorProxy::setZoneOut(int pos)
......@@ -148,7 +148,7 @@ void MonitorProxy::setZoneOut(int pos)
emit addSnap(m_zoneOut - 1);
}
emit zoneChanged();
emit saveZone();
emit saveZone(QPoint(m_zoneIn, m_zoneOut));
}
void MonitorProxy::startZoneMove()
......@@ -179,7 +179,7 @@ void MonitorProxy::setZone(int in, int out, bool sendUpdate)
}
emit zoneChanged();
if (sendUpdate) {
emit saveZone();
emit saveZone(QPoint(m_zoneIn, m_zoneOut));
}
}
......
......@@ -97,7 +97,7 @@ signals:
void seekFinishedChanged();
void requestSeek(int pos);
void zoneChanged();
void saveZone();
void saveZone(const QPoint zone);
void saveZoneWithUndo(const QPoint, const QPoint&);
void markerCommentChanged();
void rulerHeightChanged();
......
......@@ -91,8 +91,8 @@ void ClipSnapModel::removeAllSnaps()
void ClipSnapModel::allSnaps(std::vector<size_t> &snaps)
{
snaps.push_back(m_position);
snaps.push_back(m_position + m_outPoint - m_inPoint);
snaps.push_back((size_t)m_position);
snaps.push_back((size_t)(m_position + m_outPoint - m_inPoint));
if (auto ptr = m_registeredSnap.lock()) {
for (const auto &snap : m_snapPoints) {
if (snap >= m_inPoint * m_speed && snap < m_outPoint * m_speed) {
......
......@@ -226,8 +226,7 @@ Rectangle {
id: textMetricsLed
font: miniFont
}
height: parent.height, textMetricsLed.height + 2
width: (textMetricsLed.averageCharacterWidth * text.length) + 4
width: (Math.ceil(textMetricsLed.averageCharacterWidth * trackLed.text.length * 1.2))
y: 1
leftPadding:0
rightPadding:0
......
......@@ -1143,6 +1143,8 @@ void TimelineController::updateZone(const QPoint oldZone, const QPoint newZone,
if (!withUndo) {
m_zone = newZone;
emit zoneChanged();
// Update monitor zone
emit zoneMoved(m_zone);
return;
}
std::function<bool(void)> undo = []() { return true; };
......@@ -1170,6 +1172,7 @@ void TimelineController::setZoneIn(int inPoint)
}
m_zone.setX(inPoint);
emit zoneChanged();
// Update monitor zone
emit zoneMoved(m_zone);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment