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
Multimedia
Kdenlive
Commits
787436dd
Commit
787436dd
authored
May 16, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix edit duration from timeline menu not connected
parent
884ad0a2
Pipeline
#3571
passed with stage
in 20 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
+27
-15
src/mainwindow.cpp
src/mainwindow.cpp
+6
-11
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+16
-1
src/timeline2/view/timelinecontroller.h
src/timeline2/view/timelinecontroller.h
+5
-3
No files found.
src/mainwindow.cpp
View file @
787436dd
...
...
@@ -2215,7 +2215,7 @@ void MainWindow::slotAddClipMarker()
std
::
shared_ptr
<
ProjectClip
>
clip
(
nullptr
);
GenTime
pos
;
if
(
m_projectMonitor
->
isActive
())
{
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Clip
();
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Item
();
if
(
selectedClip
>
-
1
)
{
getMainTimeline
()
->
controller
()
->
addMarker
(
selectedClip
);
return
;
...
...
@@ -2237,7 +2237,7 @@ void MainWindow::slotDeleteClipMarker(bool allowGuideDeletion)
std
::
shared_ptr
<
ProjectClip
>
clip
(
nullptr
);
GenTime
pos
;
if
(
m_projectMonitor
->
isActive
())
{
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Clip
();
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Item
();
if
(
selectedClip
>
-
1
)
{
getMainTimeline
()
->
controller
()
->
deleteMarker
(
selectedClip
);
return
;
...
...
@@ -2269,7 +2269,7 @@ void MainWindow::slotDeleteAllClipMarkers()
{
std
::
shared_ptr
<
ProjectClip
>
clip
(
nullptr
);
if
(
m_projectMonitor
->
isActive
())
{
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Clip
();
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Item
();
if
(
selectedClip
>
-
1
)
{
getMainTimeline
()
->
controller
()
->
deleteAllMarkers
(
selectedClip
);
return
;
...
...
@@ -2293,7 +2293,7 @@ void MainWindow::slotEditClipMarker()
std
::
shared_ptr
<
ProjectClip
>
clip
(
nullptr
);
GenTime
pos
;
if
(
m_projectMonitor
->
isActive
())
{
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Clip
();
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Item
();
if
(
selectedClip
>
-
1
)
{
getMainTimeline
()
->
controller
()
->
editMarker
(
selectedClip
);
return
;
...
...
@@ -2335,7 +2335,7 @@ void MainWindow::slotAddMarkerGuideQuickly()
CommentedTime
marker
(
pos
,
pCore
->
currentDoc
()
->
timecode
().
getDisplayTimecode
(
pos
,
false
),
KdenliveSettings
::
default_marker_type
());
clip
->
getMarkerModel
()
->
addMarker
(
marker
.
time
(),
marker
.
comment
(),
marker
.
markerType
());
}
else
{
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Clip
();
int
selectedClip
=
getMainTimeline
()
->
controller
()
->
getMainSelected
Item
();
if
(
selectedClip
==
-
1
)
{
// Add timeline guide
getMainTimeline
()
->
controller
()
->
switchGuide
();
...
...
@@ -2535,12 +2535,7 @@ void MainWindow::slotUnGroupClips()
void
MainWindow
::
slotEditItemDuration
()
{
// TODO refac
/*
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->editItemDuration();
}
*/
getCurrentTimeline
()
->
controller
()
->
editItemDuration
();
}
void
MainWindow
::
slotAddProjectClip
(
const
QUrl
&
url
,
const
QString
&
folderInfo
)
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
787436dd
...
...
@@ -411,7 +411,7 @@ void TimelineController::deleteSelectedClips()
m_model
->
requestItemDeletion
(
*
sel
.
begin
());
}
int
TimelineController
::
getMainSelected
Clip
(
)
int
TimelineController
::
getMainSelected
Item
(
bool
restrictToCurrentPos
,
bool
allowComposition
)
{
auto
sel
=
m_model
->
getCurrentSelection
();
if
(
sel
.
empty
()
||
sel
.
size
()
>
2
)
{
...
...
@@ -424,6 +424,11 @@ int TimelineController::getMainSelectedClip()
return
-
1
;
}
}
if
(
!
restrictToCurrentPos
)
{
if
(
m_model
->
isClip
(
itemId
)
||
(
allowComposition
&&
m_model
->
isComposition
(
itemId
)))
{
return
itemId
;
}
}
if
(
m_model
->
isClip
(
itemId
))
{
int
position
=
timelinePosition
();
int
start
=
m_model
->
getClipPosition
(
itemId
);
...
...
@@ -1914,6 +1919,13 @@ double TimelineController::fps() const
void
TimelineController
::
editItemDuration
(
int
id
)
{
if
(
id
==
-
1
)
{
id
=
getMainSelectedItem
(
false
,
true
);
}
if
(
id
==
-
1
)
{
pCore
->
displayMessage
(
i18n
(
"No item to edit"
),
InformationMessage
,
500
);
return
;
}
int
start
=
m_model
->
getItemPosition
(
id
);
int
in
=
0
;
int
duration
=
m_model
->
getItemPlaytime
(
id
);
...
...
@@ -2057,6 +2069,9 @@ void TimelineController::grabCurrent()
return
;
}
int
id
=
*
m_model
->
getCurrentSelection
().
begin
();
while
(
m_model
->
isGroup
(
id
))
{
id
=
*
m_model
->
m_groups
->
getLeaves
(
id
).
begin
();
}
if
(
m_model
->
isClip
(
id
))
{
std
::
shared_ptr
<
ClipModel
>
clip
=
m_model
->
getClipPtr
(
id
);
clip
->
setGrab
(
!
clip
->
isGrabbed
());
...
...
src/timeline2/view/timelinecontroller.h
View file @
787436dd
...
...
@@ -82,7 +82,7 @@ public:
void
setRoot
(
QQuickItem
*
root
);
/** @brief Edit an item's in/out points with a dialog
*/
Q_INVOKABLE
void
editItemDuration
(
int
itemId
);
Q_INVOKABLE
void
editItemDuration
(
int
itemId
=
-
1
);
/** @brief Returns the topmost track containing a selected item (-1 if selection is embty) */
Q_INVOKABLE
int
selectedTrack
()
const
;
...
...
@@ -209,9 +209,11 @@ public:
Q_INVOKABLE
void
triggerAction
(
const
QString
&
name
);
/* @brief Returns id of the timeline selcted clip if there is only 1 clip selected
* or an AVSplit group. Returns -1 otherwise
* or an AVSplit group. If allowComposition is true, returns composition id if
* only 1 is selected, otherwise returns -1. If restrictToCurrentPos is true, it will
* only return the id if timeline cursor is inside item
*/
int
getMainSelected
Clip
(
);
int
getMainSelected
Item
(
bool
restrictToCurrentPos
=
true
,
bool
allowComposition
=
false
);
/* @brief Do we want to display video thumbnails
*/
...
...
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