Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Scott Petrovic
kdenlive
Commits
d18f65bd
Commit
d18f65bd
authored
Apr 05, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reintroduce missing marker menu in timeline clip context menu
parent
53648675
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
4 deletions
+72
-4
src/timeline2/view/qml/ClipMenu.qml
src/timeline2/view/qml/ClipMenu.qml
+23
-0
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+36
-3
src/timeline2/view/timelinecontroller.h
src/timeline2/view/timelinecontroller.h
+13
-1
No files found.
src/timeline2/view/qml/ClipMenu.qml
View file @
d18f65bd
...
...
@@ -66,6 +66,29 @@ Menu {
onTriggered
:
timeline
.
splitVideo
(
clipId
)
visible
:
!
grouped
&&
canBeVideo
&&
clipStatus
==
ClipState
.
AudioOnly
}
Menu
{
title
:
i18n
(
'
Markers
'
)
MenuItem
{
text
:
i18n
(
'
Add Marker
'
)
onTriggered
:
timeline
.
addMarker
(
clipId
,
timeline
.
position
)
}
MenuItem
{
text
:
i18n
(
'
Add Marker/Guide quickly
'
)
onTriggered
:
timeline
.
addQuickMarker
(
clipId
,
timeline
.
position
)
}
MenuItem
{
text
:
i18n
(
'
Edit Marker
'
)
onTriggered
:
timeline
.
editMarker
(
clipId
,
timeline
.
position
)
}
MenuItem
{
text
:
i18n
(
'
Delete Marker
'
)
onTriggered
:
timeline
.
deleteMarker
(
clipId
,
timeline
.
position
)
}
MenuItem
{
text
:
i18n
(
'
Delete All Markers
'
)
onTriggered
:
timeline
.
deleteAllMarkers
(
clipId
)
}
}
MenuItem
{
text
:
i18n
(
'
Set Audio Reference
'
)
onTriggered
:
timeline
.
setAudioRef
(
clipId
)
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
d18f65bd
...
...
@@ -583,13 +583,46 @@ void TimelineController::setOutPoint()
}
}
void
TimelineController
::
editMarker
(
const
QString
&
cid
,
int
frame
)
void
TimelineController
::
editMarker
(
int
cid
,
int
position
)
{
std
::
shared_ptr
<
ProjectClip
>
clip
=
pCore
->
bin
()
->
getBinClip
(
cid
);
GenTime
pos
(
frame
,
pCore
->
getCurrentFps
());
Q_ASSERT
(
m_model
->
isClip
(
cid
));
std
::
shared_ptr
<
ProjectClip
>
clip
=
pCore
->
bin
()
->
getBinClip
(
getClipBinId
(
cid
));
GenTime
pos
(
position
-
m_model
->
getClipPosition
(
cid
)
+
m_model
->
getClipIn
(
cid
),
pCore
->
getCurrentFps
());
clip
->
getMarkerModel
()
->
editMarkerGui
(
pos
,
qApp
->
activeWindow
(),
false
,
clip
.
get
());
}
void
TimelineController
::
addMarker
(
int
cid
,
int
position
)
{
Q_ASSERT
(
m_model
->
isClip
(
cid
));
std
::
shared_ptr
<
ProjectClip
>
clip
=
pCore
->
bin
()
->
getBinClip
(
getClipBinId
(
cid
));
GenTime
pos
(
position
-
m_model
->
getClipPosition
(
cid
)
+
m_model
->
getClipIn
(
cid
),
pCore
->
getCurrentFps
());
clip
->
getMarkerModel
()
->
editMarkerGui
(
pos
,
qApp
->
activeWindow
(),
true
,
clip
.
get
());
}
void
TimelineController
::
addQuickMarker
(
int
cid
,
int
position
)
{
Q_ASSERT
(
m_model
->
isClip
(
cid
));
std
::
shared_ptr
<
ProjectClip
>
clip
=
pCore
->
bin
()
->
getBinClip
(
getClipBinId
(
cid
));
GenTime
pos
(
position
-
m_model
->
getClipPosition
(
cid
)
+
m_model
->
getClipIn
(
cid
),
pCore
->
getCurrentFps
());
CommentedTime
marker
(
pos
,
pCore
->
currentDoc
()
->
timecode
().
getDisplayTimecode
(
pos
,
false
),
KdenliveSettings
::
default_marker_type
());
clip
->
getMarkerModel
()
->
addMarker
(
marker
.
time
(),
marker
.
comment
(),
marker
.
markerType
());
}
void
TimelineController
::
deleteMarker
(
int
cid
,
int
position
)
{
Q_ASSERT
(
m_model
->
isClip
(
cid
));
std
::
shared_ptr
<
ProjectClip
>
clip
=
pCore
->
bin
()
->
getBinClip
(
getClipBinId
(
cid
));
GenTime
pos
(
position
-
m_model
->
getClipPosition
(
cid
)
+
m_model
->
getClipIn
(
cid
),
pCore
->
getCurrentFps
());
clip
->
getMarkerModel
()
->
removeMarker
(
pos
);
}
void
TimelineController
::
deleteAllMarkers
(
int
cid
)
{
Q_ASSERT
(
m_model
->
isClip
(
cid
));
std
::
shared_ptr
<
ProjectClip
>
clip
=
pCore
->
bin
()
->
getBinClip
(
getClipBinId
(
cid
));
clip
->
getMarkerModel
()
->
removeAllMarkers
();
}
void
TimelineController
::
editGuide
(
int
frame
)
{
if
(
frame
==
-
1
)
{
...
...
src/timeline2/view/timelinecontroller.h
View file @
d18f65bd
...
...
@@ -228,7 +228,19 @@ public:
Q_INVOKABLE
void
unGroupSelection
(
int
cid
=
-
1
);
/* @brief Ask for edit marker dialog
*/
Q_INVOKABLE
void
editMarker
(
const
QString
&
cid
,
int
frame
);
Q_INVOKABLE
void
editMarker
(
int
cid
,
int
position
);
/* @brief Ask for marker add dialog
*/
Q_INVOKABLE
void
addMarker
(
int
cid
,
int
position
);
/* @brief Ask for quick marker add (without dialog)
*/
Q_INVOKABLE
void
addQuickMarker
(
int
cid
,
int
position
);
/* @brief Ask for marker delete
*/
Q_INVOKABLE
void
deleteMarker
(
int
cid
,
int
position
);
/* @brief Ask for all markers delete
*/
Q_INVOKABLE
void
deleteAllMarkers
(
int
cid
);
/* @brief Ask for edit timeline guide dialog
*/
Q_INVOKABLE
void
editGuide
(
int
frame
=
-
1
);
...
...
Write
Preview
Markdown
is supported
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