Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
3bc09d50
Commit
3bc09d50
authored
Mar 26, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix zone incorrectly updating with undo
parent
9a918976
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/mainwindow.cpp
View file @
3bc09d50
...
...
@@ -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
)
{
...
...
src/mainwindow.h
View file @
3bc09d50
...
...
@@ -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
();
...
...
src/monitor/monitor.cpp
View file @
3bc09d50
...
...
@@ -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
)
...
...
src/monitor/monitor.h
View file @
3bc09d50
...
...
@@ -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
);
...
...
src/monitor/monitormanager.cpp
View file @
3bc09d50
...
...
@@ -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
);
}
}
...
...
src/monitor/monitorproxy.cpp
View file @
3bc09d50
...
...
@@ -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
)
);
}
}
...
...
src/monitor/monitorproxy.h
View file @
3bc09d50
...
...
@@ -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
();
...
...
src/timeline2/model/clipsnapmodel.cpp
View file @
3bc09d50
...
...
@@ -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
)
{
...
...
src/timeline2/view/qml/TrackHead.qml
View file @
3bc09d50
...
...
@@ -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
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
3bc09d50
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment