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
25ba5eaa
Commit
25ba5eaa
authored
Oct 04, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix track insertion in mixed view mode.
CCBUG: 403443
parent
568cf02f
Pipeline
#36411
passed with stage
in 29 minutes and 49 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
25ba5eaa
...
...
@@ -410,13 +410,14 @@ int TimelineModel::getTrackSortValue(int trackId, int separated) const
}
}
if
(
isAudio
)
{
if
(
aCount
>
vCount
&&
(
trackPos
-
1
>
aCount
-
vCount
))
{
return
(
aCount
-
vCount
+
1
)
+
2
*
(
trackPos
-
(
aCount
-
vCount
+
1
));
}
if
(
aCount
==
vCount
)
{
return
2
*
trackPos
;
if
(
aCount
>
vCount
)
{
if
(
trackPos
-
1
>
aCount
-
vCount
)
{
// We have more audio tracks than video tracks
return
(
aCount
-
vCount
+
1
)
+
2
*
(
trackPos
-
(
aCount
-
vCount
+
1
));
}
return
trackPos
;
}
return
trackPos
;
return
2
*
trackPos
;
}
return
2
*
(
vCount
+
1
-
trackPos
)
+
1
;
}
...
...
src/timeline2/view/dialogs/trackdialog.cpp
View file @
25ba5eaa
...
...
@@ -83,14 +83,19 @@ void TrackDialog::buildCombo()
int
TrackDialog
::
selectedTrackPosition
()
const
{
bool
audioMode
=
audio_track
->
isChecked
()
||
arec_track
->
isChecked
();
if
(
comboTracks
->
count
()
>
0
)
{
int
position
=
m_positionByIndex
.
value
(
comboTracks
->
currentData
().
toInt
());
if
(
before_select
->
currentIndex
()
==
1
)
{
if
(
audioMode
&&
KdenliveSettings
::
audiotracksbelow
()
==
0
)
{
// In mixed track modes, indexes are sorted differently so above/under have different meaning
if
(
before_select
->
currentIndex
()
==
0
)
{
position
--
;
}
}
else
if
(
before_select
->
currentIndex
()
==
1
)
{
position
--
;
}
return
position
;
}
bool
audioMode
=
audio_track
->
isChecked
()
||
arec_track
->
isChecked
();
return
audioMode
?
0
:
-
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