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
dbec1372
Commit
dbec1372
authored
May 12, 2020
by
Jean-Baptiste Mardelle
Browse files
Multi stream clips: drag all active streams in timeline.
Related to
#382
parent
89cec14e
Pipeline
#20055
passed with stage
in 9 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
dbec1372
...
...
@@ -1069,15 +1069,38 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
mirror
=
-
1
;
}
bool
canMirrorDrop
=
!
useTargets
&&
mirror
>
-
1
;
QMap
<
int
,
int
>
dropTargets
;
if
(
res
&&
(
canMirrorDrop
||
!
target_track
.
isEmpty
())
&&
master
->
hasAudioAndVideo
())
{
if
(
!
useTargets
)
{
int
streamsCount
=
m_audioTarget
.
keys
().
count
();
target_track
=
{
mirror
};
QList
<
int
>
audioTids
=
getLowerTracksId
(
mirror
,
TrackType
::
AudioTrack
);
if
(
streamsCount
>
audioTids
.
count
()
+
1
)
{
pCore
->
displayMessage
(
i18n
(
"Not enough audio tracks for all streams (%1)"
,
streamsCount
),
ErrorMessage
);
res
=
false
;
}
else
{
while
(
streamsCount
>
1
&&
!
audioTids
.
isEmpty
())
{
target_track
<<
audioTids
.
takeFirst
();
streamsCount
--
;
}
}
QList
<
int
>
aTargets
=
m_audioTarget
.
values
();
std
::
sort
(
aTargets
.
begin
(),
aTargets
.
end
());
for
(
int
i
=
0
;
i
<
target_track
.
count
();
++
i
)
{
dropTargets
.
insert
(
target_track
.
at
(
i
),
aTargets
.
at
(
i
));
}
}
if
(
target_track
.
isEmpty
())
{
// No available track for splitting, abort
pCore
->
displayMessage
(
i18n
(
"No available track for split operation"
),
ErrorMessage
);
res
=
false
;
}
if
(
!
res
)
{
bool
undone
=
local_undo
();
Q_ASSERT
(
undone
);
id
=
-
1
;
return
false
;
}
// Process all mirror insertions
std
::
function
<
bool
(
void
)
>
audio_undo
=
[]()
{
return
true
;
};
std
::
function
<
bool
(
void
)
>
audio_redo
=
[]()
{
return
true
;
};
...
...
@@ -1085,7 +1108,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
for
(
int
&
target_ix
:
target_track
)
{
if
(
!
audioDrop
)
{
if
(
!
useTargets
)
{
audioStream
=
master
->
getProducerIntProperty
(
"audio_index"
);
audioStream
=
dropTargets
.
value
(
target_ix
);
//
master->getProducerIntProperty("audio_index");
}
else
{
audioStream
=
m_audioTarget
.
value
(
target_ix
);
}
...
...
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