Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
343a82b5
Commit
343a82b5
authored
Jul 28, 2016
by
luyikei
Browse files
MLTTrack: Reimplement the move function to specify position in frames
parent
4e16dae8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Backend/ITrack.h
View file @
343a82b5
...
...
@@ -37,7 +37,7 @@ namespace Backend
virtual
void
replaceWithBlank
(
int
index
)
=
0
;
virtual
bool
append
(
IInput
&
input
)
=
0
;
virtual
bool
remove
(
int
index
)
=
0
;
// src and dist are
index
es.
// src and dist are
fram
es.
virtual
bool
move
(
int
src
,
int
dist
)
=
0
;
virtual
IInput
*
clip
(
int
index
)
const
=
0
;
virtual
IInput
*
clipAt
(
int64_t
position
)
const
=
0
;
...
...
src/Backend/MLT/MLTTrack.cpp
View file @
343a82b5
...
...
@@ -114,7 +114,12 @@ MLTTrack::remove( int index )
bool
MLTTrack
::
move
(
int
src
,
int
dist
)
{
return
!
playlist
()
->
move
(
src
,
dist
);
std
::
unique_ptr
<
Mlt
::
Producer
>
prod
(
playlist
()
->
replace_with_blank
(
playlist
()
->
get_clip_index_at
(
src
)
)
);
if
(
!
prod
)
return
false
;
playlist
()
->
consolidate_blanks
(
0
);
return
!
playlist
()
->
insert_at
(
dist
,
prod
.
get
(),
1
);
}
Backend
::
IInput
*
...
...
src/Workflow/TrackWorkflow.cpp
View file @
343a82b5
...
...
@@ -130,11 +130,7 @@ TrackWorkflow::moveClip( const QUuid& id, qint64 startingFrame )
{
auto
clip
=
it
.
value
();
auto
track
=
trackFromFormats
(
it
.
value
()
->
formats
()
);
auto
input
=
track
->
clipAt
(
it
.
key
()
);
track
->
remove
(
track
->
clipIndexAt
(
it
.
key
()
)
);
track
->
insertAt
(
*
input
,
startingFrame
);
delete
input
;
track
->
move
(
it
.
key
(),
startingFrame
);
m_clips
.
erase
(
it
);
m_clips
.
insertMulti
(
startingFrame
,
clip
);
return
;
...
...
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