Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
c20b5139
Commit
c20b5139
authored
Apr 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix paste clips/compositions sometimes not working or pasting on wrong track/position
Fixes #642
parent
4f5af497
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
src/timeline2/model/timelinefunctions.cpp
src/timeline2/model/timelinefunctions.cpp
+2
-4
src/timeline2/view/qml/Clip.qml
src/timeline2/view/qml/Clip.qml
+1
-0
src/timeline2/view/qml/Composition.qml
src/timeline2/view/qml/Composition.qml
+1
-0
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+6
-0
No files found.
src/timeline2/model/timelinefunctions.cpp
View file @
c20b5139
...
...
@@ -1376,7 +1376,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
// Find top-most video track that requires an audio mirror
int
topAudioOffset
=
videoTracks
.
indexOf
(
topAudioMirror
)
-
videoTracks
.
indexOf
(
masterSourceTrack
);
// Check if we have enough video tracks with mirror at paste track position
if
(
projectTracks
.
first
.
size
()
<=
projectTracks
.
second
.
indexOf
(
trackId
)
+
topAudioOffset
)
{
if
(
requestedAudioTracks
>
0
&&
projectTracks
.
first
.
size
()
<=
(
projectTracks
.
second
.
indexOf
(
trackId
)
+
topAudioOffset
)
)
{
int
updatedPos
=
projectTracks
.
first
.
size
()
-
topAudioOffset
-
1
;
if
(
updatedPos
<
0
||
updatedPos
>=
projectTracks
.
second
.
size
())
{
pCore
->
displayMessage
(
i18n
(
"Not enough tracks to paste clipboard"
),
InformationMessage
,
500
);
...
...
@@ -1407,9 +1407,6 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
masterIx
=
projectTracks
.
first
.
indexOf
(
trackId
);
audioMaster
=
true
;
}
qDebug
()
<<
"/// PROJECT VIDEO TKS: "
<<
projectTracks
.
second
<<
", MASTER: "
<<
trackId
;
qDebug
()
<<
"/// PASTE VIDEO TKS: "
<<
videoTracks
<<
" / MASTER: "
<<
masterSourceTrack
;
qDebug
()
<<
"/// MASTER PASTE: "
<<
masterIx
;
for
(
int
tk
:
videoTracks
)
{
int
newPos
=
masterIx
+
tk
-
masterSourceTrack
;
if
(
newPos
<
0
||
newPos
>=
projectTracks
.
second
.
size
())
{
...
...
@@ -1418,6 +1415,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
return
false
;
}
tracksMap
.
insert
(
tk
,
projectTracks
.
second
.
at
(
newPos
));
//qDebug() << "/// MAPPING SOURCE TRACK: "<<tk<<" TO PROJECT TK: "<<projectTracks.second.at(newPos)<<" = "<<timeline->getTrackMltIndex(projectTracks.second.at(newPos));
}
bool
audioOffsetCalculated
=
false
;
int
audioOffset
=
0
;
...
...
src/timeline2/view/qml/Clip.qml
View file @
c20b5139
...
...
@@ -73,6 +73,7 @@ Rectangle {
property
bool
hideClipViews
:
false
property
var
groupTrimData
property
int
scrollStart
:
scrollView
.
contentX
-
(
clipRoot
.
modelStart
*
timeline
.
scaleFactor
)
property
int
mouseXPos
:
mouseArea
.
mouseX
width
:
clipDuration
*
timeScale
opacity
:
dragProxyArea
.
drag
.
active
&&
dragProxy
.
draggedItem
==
clipId
?
0.8
:
1.0
...
...
src/timeline2/view/qml/Composition.qml
View file @
c20b5139
...
...
@@ -63,6 +63,7 @@ Item {
property
color
borderColor
:
'
black
'
property
bool
hideCompoViews
property
int
scrollStart
:
scrollView
.
contentX
-
modelStart
*
timeline
.
scaleFactor
property
int
mouseXPos
:
mouseArea
.
mouseX
signal
moved
(
var
clip
)
signal
dragged
(
var
clip
,
var
mouse
)
...
...
src/timeline2/view/qml/timeline.qml
View file @
c20b5139
...
...
@@ -150,6 +150,9 @@ Rectangle {
}
function
getMousePos
()
{
if
(
dragProxy
.
draggedItem
>
-
1
&&
dragProxy
.
masterObject
)
{
return
(
dragProxy
.
masterObject
.
x
+
dragProxy
.
masterObject
.
mouseXPos
)
/
timeline
.
scaleFactor
}
if
(
tracksArea
.
containsMouse
)
{
return
(
scrollView
.
contentX
+
tracksArea
.
mouseX
)
/
timeline
.
scaleFactor
}
else
{
...
...
@@ -170,6 +173,9 @@ Rectangle {
}
function
getMouseTrack
()
{
if
(
dragProxy
.
draggedItem
>
-
1
&&
dragProxy
.
masterObject
)
{
return
dragProxy
.
masterObject
.
trackId
}
return
Logic
.
getTrackIdFromPos
(
tracksArea
.
mouseY
-
ruler
.
height
+
scrollView
.
contentY
)
}
...
...
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