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
865f17f4
Commit
865f17f4
authored
May 18, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix drop regression (in/out ignored)
parent
0b83d248
Pipeline
#20400
passed with stage
in 9 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
865f17f4
...
...
@@ -1030,20 +1030,28 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
<<
" "
<<
trackId
<<
" "
<<
position
;
bool
res
=
false
;
ClipType
::
ProducerType
type
=
ClipType
::
Unknown
;
// binClipId id is in the form: A2/10/50
// A2 means audio only insertion for bin clip with id 2
// 10 is in point
// 50 is out point
QString
binIdWithInOut
=
binClipId
;
// bid is the A2 part
QString
bid
=
binClipId
.
section
(
QLatin1Char
(
'/'
),
0
,
0
);
// dropType indicates if we want a normal drop (disabled), audio only or video only drop
PlaylistState
::
ClipState
dropType
=
PlaylistState
::
Disabled
;
if
(
bid
.
startsWith
(
QLatin1Char
(
'A'
)))
{
dropType
=
PlaylistState
::
AudioOnly
;
bid
=
bid
.
remove
(
0
,
1
);
bid
.
remove
(
0
,
1
);
binIdWithInOut
.
remove
(
0
,
1
);
}
else
if
(
bid
.
startsWith
(
QLatin1Char
(
'V'
)))
{
dropType
=
PlaylistState
::
VideoOnly
;
bid
=
bid
.
remove
(
0
,
1
);
bid
.
remove
(
0
,
1
);
binIdWithInOut
.
remove
(
0
,
1
);
}
if
(
!
pCore
->
projectItemModel
()
->
hasClip
(
bid
))
{
return
false
;
}
bool
audioDrop
=
false
;
if
(
!
useTargets
)
{
audioDrop
=
getTrackById_const
(
trackId
)
->
isAudioTrack
();
...
...
@@ -1055,7 +1063,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
return
false
;
}
}
std
::
shared_ptr
<
ProjectClip
>
master
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
bid
);
type
=
master
->
clipType
();
if
(
useTargets
&&
m_audioTarget
.
isEmpty
()
&&
m_videoTarget
==
-
1
)
{
...
...
@@ -1116,14 +1124,13 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
}
return
false
;
}
}
}
else
if
(
audioDrop
)
{
// Using our targets
audioStream
=
m_audioTarget
.
first
();
}
res
=
requestClipCreation
(
bi
d
,
id
,
getTrackById_const
(
trackId
)
->
trackType
(),
audioDrop
?
audioStream
:
-
1
,
1.0
,
false
,
local_undo
,
local_redo
);
res
=
requestClipCreation
(
bi
nIdWithInOut
,
id
,
getTrackById_const
(
trackId
)
->
trackType
(),
audioDrop
?
audioStream
:
-
1
,
1.0
,
false
,
local_undo
,
local_redo
);
res
=
res
&&
requestClipMove
(
id
,
trackId
,
position
,
true
,
refreshView
,
logUndo
,
logUndo
,
local_undo
,
local_redo
);
qDebug
()
<<
"==== INSERTED FIRST AUDIO STREAM: "
<<
audioStream
<<
", ON TK: "
<<
trackId
<<
"
\n
-----"
;
QList
<
int
>
target_track
;
...
...
@@ -1140,7 +1147,6 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
}
}
qDebug
()
<<
"CLIP HAS A+V: "
<<
master
->
hasAudioAndVideo
();
// Get mirror track
int
mirror
=
dropType
==
PlaylistState
::
Disabled
?
getMirrorTrackId
(
trackId
)
:
-
1
;
if
(
mirror
>
-
1
&&
getTrackById_const
(
mirror
)
->
isLocked
())
{
...
...
@@ -1163,7 +1169,6 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
}
// First audio stream already inserted in target_track or in timeline
streamsCount
=
m_binAudioTargets
.
keys
().
count
()
-
1
;
qDebug
()
<<
"=== GOT AUDIO STRAMS: "
<<
streamsCount
<<
"
\n
AUDIO IDS: "
<<
audioTids
;
while
(
streamsCount
>
0
&&
!
audioTids
.
isEmpty
())
{
target_track
<<
audioTids
.
takeFirst
();
...
...
@@ -1224,7 +1229,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
}
// QList<int> possibleTracks = m_audioTarget >= 0 ? QList<int>() << m_audioTarget : getLowerTracksId(trackId, TrackType::AudioTrack);
int
newId
;
res
=
requestClipCreation
(
bi
d
,
newId
,
currentDropIsAudio
?
PlaylistState
::
AudioOnly
:
PlaylistState
::
VideoOnly
,
currentDropIsAudio
?
mirrorAudioStream
:
-
1
,
1.0
,
false
,
audio_undo
,
audio_redo
);
res
=
requestClipCreation
(
bi
nIdWithInOut
,
newId
,
currentDropIsAudio
?
PlaylistState
::
AudioOnly
:
PlaylistState
::
VideoOnly
,
currentDropIsAudio
?
mirrorAudioStream
:
-
1
,
1.0
,
false
,
audio_undo
,
audio_redo
);
if
(
res
)
{
res
=
requestClipMove
(
newId
,
target_ix
,
position
,
true
,
true
,
true
,
true
,
audio_undo
,
audio_redo
);
// use lazy evaluation to group only if move was successful
...
...
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