Skip to content
GitLab
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
39995d21
Commit
39995d21
authored
Feb 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Fix audio track tag on track insert
parent
32136296
Pipeline
#15746
passed with stage
in 16 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
39995d21
...
...
@@ -2249,6 +2249,7 @@ bool TimelineModel::requestTrackInsertion(int position, int &id, const QString &
bool
TimelineModel
::
requestTrackInsertion
(
int
position
,
int
&
id
,
const
QString
&
trackName
,
bool
audioTrack
,
Fun
&
undo
,
Fun
&
redo
,
bool
addCompositing
)
{
// TODO: make sure we disable overlayTrack before inserting a track
qDebug
()
<<
"=== REQUESTING TRACK INSERTION AT: "
<<
position
;
if
(
position
==
-
1
)
{
position
=
(
int
)(
m_allTracks
.
size
());
}
...
...
@@ -2275,10 +2276,17 @@ bool TimelineModel::requestTrackInsertion(int position, int &id, const QString &
return
true
;
};
Fun
local_name_update
=
[
position
,
this
]()
{
Fun
local_name_update
=
[
position
,
audioTrack
,
this
]()
{
if
(
audioTrack
)
{
for
(
int
i
=
0
;
i
<=
position
;
i
++
)
{
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
}
}
else
{
for
(
int
i
=
position
;
i
<
getTracksCount
();
i
++
)
{
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
}
}
return
true
;
};
...
...
@@ -2363,6 +2371,7 @@ bool TimelineModel::requestTrackDeletion(int trackId, Fun &undo, Fun &redo)
int
old_position
=
getTrackPosition
(
trackId
);
auto
operation
=
deregisterTrack_lambda
(
trackId
);
std
::
shared_ptr
<
TrackModel
>
track
=
getTrackById
(
trackId
);
bool
audioTrack
=
track
->
isAudioTrack
();
Fun
reverse
=
[
this
,
track
,
old_position
]()
{
// We capture a shared_ptr to the track, which means that as long as this undo object lives, the track object is not deleted. To insert it back it is
// sufficient to register it.
...
...
@@ -2373,10 +2382,17 @@ bool TimelineModel::requestTrackDeletion(int trackId, Fun &undo, Fun &redo)
buildTrackCompositing
(
true
);
return
true
;
};
Fun
local_name_update
=
[
old_position
,
this
]()
{
Fun
local_name_update
=
[
old_position
,
audioTrack
,
this
]()
{
if
(
audioTrack
)
{
for
(
int
i
=
0
;
i
<
qMin
(
old_position
+
1
,
getTracksCount
());
i
++
)
{
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
}
}
else
{
for
(
int
i
=
old_position
;
i
<
getTracksCount
();
i
++
)
{
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
QModelIndex
ix
=
makeTrackIndexFromID
(
getTrackIndexFromPosition
(
i
));
emit
dataChanged
(
ix
,
ix
,
{
TimelineModel
::
TrackTagRole
});
}
}
return
true
;
};
...
...
Eugen Mohr
@emohr
mentioned in issue
#506 (closed)
·
Feb 29, 2020
mentioned in issue
#506 (closed)
mentioned in issue #506
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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