Skip to content
GitLab
Menu
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
d5a078a1
Commit
d5a078a1
authored
Nov 02, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix split effect compare broken
parent
029a0781
Pipeline
#9871
passed with stage
in 13 minutes and 22 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/mainwindow.cpp
View file @
d5a078a1
...
...
@@ -883,10 +883,14 @@ void MainWindow::slotConnectMonitors()
connect
(
m_projectMonitor
,
&
Monitor
::
removeSplitOverlay
,
this
,
&
MainWindow
::
removeSplitOverlay
,
Qt
::
DirectConnection
);
}
void
MainWindow
::
createSplitOverlay
(
Mlt
::
Filter
*
filter
)
{
getMainTimeline
()
->
controller
()
->
createSplitOverlay
(
filter
);
m_projectMonitor
->
activateSplit
();
void
MainWindow
::
createSplitOverlay
(
std
::
shared_ptr
<
Mlt
::
Filter
>
filter
)
{
if
(
m_assetPanel
->
effectStackOwner
().
first
==
ObjectType
::
TimelineClip
)
{
getMainTimeline
()
->
controller
()
->
createSplitOverlay
(
m_assetPanel
->
effectStackOwner
().
second
,
filter
);
m_projectMonitor
->
activateSplit
();
}
else
{
pCore
->
displayMessage
(
i18n
(
"Select a clip to compare effect"
),
InformationMessage
);
}
}
void
MainWindow
::
removeSplitOverlay
()
...
...
src/mainwindow.h
View file @
d5a078a1
...
...
@@ -442,7 +442,7 @@ private slots:
/** @brief Update widget style */
void
slotChangeStyle
(
QAction
*
a
);
/** @brief Create temporary top track to preview an effect */
void
createSplitOverlay
(
Mlt
::
Filter
*
filter
);
void
createSplitOverlay
(
std
::
shared_ptr
<
Mlt
::
Filter
>
filter
);
void
removeSplitOverlay
();
/** @brief Create a generator's setup dialog */
void
buildGenerator
(
QAction
*
action
);
...
...
src/monitor/monitor.cpp
View file @
d5a078a1
...
...
@@ -368,7 +368,6 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
Monitor
::~
Monitor
()
{
delete
m_splitEffect
;
delete
m_audioMeterWidget
;
delete
m_glMonitor
;
delete
m_videoWidget
;
...
...
@@ -1782,7 +1781,7 @@ void Monitor::slotSwitchCompare(bool enable)
// Split scene is already active
return
;
}
m_splitEffect
=
new
Mlt
::
Filter
(
pCore
->
getCurrentProfile
()
->
profile
(),
"frei0r.alphagrad"
);
m_splitEffect
.
reset
(
new
Mlt
::
Filter
(
pCore
->
getCurrentProfile
()
->
profile
(),
"frei0r.alphagrad"
)
)
;
if
((
m_splitEffect
!=
nullptr
)
&&
m_splitEffect
->
is_valid
())
{
m_splitEffect
->
set
(
"0"
,
0.5
);
// 0 is the Clip left parameter
m_splitEffect
->
set
(
"1"
,
0
);
// 1 is gradient width
...
...
@@ -1797,15 +1796,13 @@ void Monitor::slotSwitchCompare(bool enable)
}
// Delete temp track
emit
removeSplitOverlay
();
delete
m_splitEffect
;
m_splitEffect
=
nullptr
;
m_splitEffect
.
reset
();
loadQmlScene
(
MonitorSceneDefault
);
if
(
isActive
())
{
m_glMonitor
->
requestRefresh
();
}
else
if
(
slotActivateMonitor
())
{
start
();
}
return
;
}
if
(
m_controller
==
nullptr
||
!
m_controller
->
hasEffects
())
{
...
...
@@ -1827,9 +1824,8 @@ void Monitor::slotSwitchCompare(bool enable)
}
else
if
(
m_splitEffect
)
{
// TODO
m_glMonitor
->
setProducer
(
m_controller
->
originalProducer
(),
isActive
(),
position
());
delete
m_splitEffect
;
m_splitEffect
.
reset
()
;
m_splitProducer
.
reset
();
m_splitEffect
=
nullptr
;
loadQmlScene
(
MonitorSceneDefault
);
}
slotActivateMonitor
();
...
...
@@ -1837,7 +1833,7 @@ void Monitor::slotSwitchCompare(bool enable)
void
Monitor
::
buildSplitEffect
(
Mlt
::
Producer
*
original
)
{
m_splitEffect
=
new
Mlt
::
Filter
(
pCore
->
getCurrentProfile
()
->
profile
(),
"frei0r.alphagrad"
);
m_splitEffect
.
reset
(
new
Mlt
::
Filter
(
pCore
->
getCurrentProfile
()
->
profile
(),
"frei0r.alphagrad"
)
)
;
if
((
m_splitEffect
!=
nullptr
)
&&
m_splitEffect
->
is_valid
())
{
m_splitEffect
->
set
(
"0"
,
0.5
);
// 0 is the Clip left parameter
m_splitEffect
->
set
(
"1"
,
0
);
// 1 is gradient width
...
...
@@ -1850,7 +1846,7 @@ void Monitor::buildSplitEffect(Mlt::Producer *original)
QString
splitTransition
=
TransitionsRepository
::
get
()
->
getCompositingTransition
();
Mlt
::
Transition
t
(
pCore
->
getCurrentProfile
()
->
profile
(),
splitTransition
.
toUtf8
().
constData
());
if
(
!
t
.
is_valid
())
{
delete
m_splitEffect
;
m_splitEffect
.
reset
()
;
pCore
->
displayMessage
(
i18n
(
"The cairoblend transition is required for that feature, please install frei0r and restart Kdenlive"
),
ErrorMessage
);
return
;
}
...
...
@@ -1874,7 +1870,7 @@ void Monitor::buildSplitEffect(Mlt::Producer *original)
}
trac
.
set_track
(
*
original
,
0
);
trac
.
set_track
(
*
clone
.
get
(),
1
);
clone
.
get
()
->
attach
(
*
m_splitEffect
);
clone
.
get
()
->
attach
(
*
m_splitEffect
.
get
()
);
t
.
set
(
"always_active"
,
1
);
trac
.
plant_transition
(
t
,
0
,
1
);
delete
original
;
...
...
src/monitor/monitor.h
View file @
d5a078a1
...
...
@@ -188,7 +188,7 @@ private:
QmlManager
*
m_qmlManager
;
std
::
shared_ptr
<
SnapModel
>
m_snaps
;
Mlt
::
Filter
*
m_splitEffect
;
std
::
shared_ptr
<
Mlt
::
Filter
>
m_splitEffect
;
std
::
shared_ptr
<
Mlt
::
Producer
>
m_splitProducer
;
int
m_length
;
bool
m_dragStarted
;
...
...
@@ -352,7 +352,7 @@ signals:
void
deleteMarker
(
bool
deleteGuide
=
true
);
void
seekToPreviousSnap
();
void
seekToNextSnap
();
void
createSplitOverlay
(
Mlt
::
Filter
*
);
void
createSplitOverlay
(
std
::
shared_ptr
<
Mlt
::
Filter
>
);
void
removeSplitOverlay
();
void
acceptRipple
(
bool
);
void
switchTrimMode
(
int
);
...
...
src/project/projectmanager.cpp
View file @
d5a078a1
...
...
@@ -672,15 +672,22 @@ void ProjectManager::slotAutoSave()
QString
ProjectManager
::
projectSceneList
(
const
QString
&
outputFolder
)
{
// Disable multitrack view
// Disable multitrack view
and overlay
bool
isMultiTrack
=
pCore
->
monitorManager
()
->
isMultiTrack
();
bool
hasPreview
=
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
hasPreviewTrack
();
if
(
isMultiTrack
)
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
slotMultitrackView
(
false
,
false
);
}
if
(
hasPreview
)
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
updatePreviewConnection
(
false
);
}
QString
scene
=
pCore
->
monitorManager
()
->
projectMonitor
()
->
sceneList
(
outputFolder
);
if
(
isMultiTrack
)
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
slotMultitrackView
(
true
,
false
);
}
if
(
hasPreview
)
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
updatePreviewConnection
(
true
);
}
return
scene
;
}
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
d5a078a1
...
...
@@ -157,17 +157,6 @@ Mlt::Tractor *TimelineController::tractor()
return
m_model
->
tractor
();
}
int
TimelineController
::
getCurrentItem
()
{
// TODO: if selection is empty, return topmost clip under timeline cursor
auto
selection
=
m_model
->
getCurrentSelection
();
if
(
selection
.
empty
())
{
return
-
1
;
}
// TODO: if selection contains more than 1 clip, return topmost clip under timeline cursor in selection
return
*
(
selection
.
begin
());
}
double
TimelineController
::
scaleFactor
()
const
{
return
m_scale
;
...
...
@@ -1275,12 +1264,11 @@ void TimelineController::setHeaderWidth(int width)
KdenliveSettings
::
setHeaderwidth
(
width
);
}
bool
TimelineController
::
createSplitOverlay
(
Mlt
::
Filter
*
filter
)
bool
TimelineController
::
createSplitOverlay
(
int
clipId
,
std
::
shared_ptr
<
Mlt
::
Filter
>
filter
)
{
if
(
m_timelinePreview
&&
m_timelinePreview
->
hasOverlayTrack
())
{
return
true
;
}
int
clipId
=
getCurrentItem
();
if
(
clipId
==
-
1
)
{
pCore
->
displayMessage
(
i18n
(
"Select a clip to compare effect"
),
InformationMessage
,
500
);
return
false
;
...
...
@@ -1303,7 +1291,7 @@ bool TimelineController::createSplitOverlay(Mlt::Filter *filter)
play2
.
append
(
*
binProd
);
trac
.
set_track
(
play
,
0
);
trac
.
set_track
(
play2
,
1
);
play2
.
attach
(
*
filter
);
play2
.
attach
(
*
filter
.
get
()
);
QString
splitTransition
=
TransitionsRepository
::
get
()
->
getCompositingTransition
();
Mlt
::
Transition
t
(
*
m_model
->
m_tractor
->
profile
(),
splitTransition
.
toUtf8
().
constData
());
t
.
set
(
"always_active"
,
1
);
...
...
@@ -1327,7 +1315,7 @@ bool TimelineController::createSplitOverlay(Mlt::Filter *filter)
void
TimelineController
::
removeSplitOverlay
()
{
if
(
m_timelinePreview
&&
!
m_timelinePreview
->
hasOverlayTrack
())
{
if
(
!
m_timelinePreview
||
!
m_timelinePreview
->
hasOverlayTrack
())
{
return
;
}
// disconnect
...
...
@@ -1413,6 +1401,22 @@ void TimelineController::initializePreview()
m_disablePreview
->
blockSignals
(
false
);
}
bool
TimelineController
::
hasPreviewTrack
()
const
{
return
(
m_timelinePreview
&&
m_timelinePreview
->
hasOverlayTrack
());
}
void
TimelineController
::
updatePreviewConnection
(
bool
enable
)
{
if
(
m_timelinePreview
)
{
if
(
enable
)
{
m_timelinePreview
->
reconnectTrack
();
}
else
{
m_timelinePreview
->
disconnectTrack
();
}
}
}
void
TimelineController
::
disablePreview
(
bool
disable
)
{
if
(
disable
)
{
...
...
src/timeline2/view/timelinecontroller.h
View file @
d5a078a1
...
...
@@ -408,7 +408,7 @@ public:
void
focusItem
(
int
itemId
);
/* @brief Create and display a split clip view to compare effect
*/
bool
createSplitOverlay
(
Mlt
::
Filter
*
filter
);
bool
createSplitOverlay
(
int
clipId
,
std
::
shared_ptr
<
Mlt
::
Filter
>
filter
);
/* @brief Delete the split clip view to compare effect
*/
void
removeSplitOverlay
();
...
...
@@ -472,6 +472,9 @@ public:
void
prepareClose
();
/** @brief Check that we don't keep a deleted track id */
void
checkTrackDeletion
(
int
selectedTrackIx
);
/** @brief Return true if an overlay track is used */
bool
hasPreviewTrack
()
const
;
void
updatePreviewConnection
(
bool
enable
);
public
slots
:
void
resetView
();
...
...
@@ -531,7 +534,6 @@ private:
std
::
shared_ptr
<
AudioCorrelation
>
m_audioCorrelator
;
QMutex
m_metaMutex
;
int
getCurrentItem
();
void
initializePreview
();
bool
darkBackground
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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