Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
51a0e59a
Commit
51a0e59a
authored
Dec 11, 2016
by
luyikei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clip: Add a getter for checking whether a clip is on the timeline
parent
6f9be2ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
src/Media/Clip.cpp
src/Media/Clip.cpp
+16
-1
src/Media/Clip.h
src/Media/Clip.h
+6
-0
src/Workflow/SequenceWorkflow.cpp
src/Workflow/SequenceWorkflow.cpp
+6
-0
No files found.
src/Media/Clip.cpp
View file @
51a0e59a
...
...
@@ -42,7 +42,8 @@
Clip
::
Clip
(
QSharedPointer
<
Media
>
media
,
qint64
begin
/*= 0*/
,
qint64
end
/*= Backend::IInput::EndOfMedia */
,
const
QUuid
&
uuid
/*= QString()*/
)
:
Workflow
::
Helper
(
uuid
),
m_media
(
media
),
m_input
(
media
->
input
()
->
cut
(
begin
,
end
)
)
m_input
(
media
->
input
()
->
cut
(
begin
,
end
)
),
m_onTimeline
(
false
)
{
}
...
...
@@ -107,6 +108,20 @@ Clip::setNotes( const QString ¬es )
m_notes
=
notes
;
}
bool
Clip
::
onTimeline
()
const
{
return
m_onTimeline
;
}
void
Clip
::
setOnTimeline
(
bool
onTimeline
)
{
if
(
m_onTimeline
!=
onTimeline
)
emit
onTimelineChanged
(
onTimeline
);
m_onTimeline
=
onTimeline
;
}
const
QUuid
&
Clip
::
uuid
()
const
{
...
...
src/Media/Clip.h
View file @
51a0e59a
...
...
@@ -94,6 +94,9 @@ class Clip : public Workflow::Helper
const
QString
&
notes
()
const
;
void
setNotes
(
const
QString
&
notes
);
bool
onTimeline
()
const
;
void
setOnTimeline
(
bool
onTimeline
);
QVariant
toVariant
()
const
;
Backend
::
IInput
*
input
();
...
...
@@ -105,11 +108,14 @@ class Clip : public Workflow::Helper
QStringList
m_metaTags
;
QString
m_notes
;
bool
m_onTimeline
;
signals:
/**
* \brief Act just like QObject::destroyed(), but before the clip deletion.
*/
void
unloaded
(
Clip
*
);
bool
onTimelineChanged
(
bool
);
};
#endif //CLIP_H__
src/Workflow/SequenceWorkflow.cpp
View file @
51a0e59a
...
...
@@ -76,6 +76,7 @@ SequenceWorkflow::addClip( QSharedPointer<::Clip> clip, quint32 trackId, qint32
trackId
,
pos
,
isAudioClip
);
vlmcDebug
()
<<
"adding"
<<
(
isAudioClip
?
"audio"
:
"video"
)
<<
"clip instance:"
<<
c
->
uuid
;
m_clips
.
insert
(
c
->
uuid
,
c
)
;
clip
->
setOnTimeline
(
true
);
emit
clipAdded
(
c
->
uuid
.
toString
()
);
return
c
->
uuid
;
}
...
...
@@ -166,6 +167,11 @@ SequenceWorkflow::removeClip( const QUuid& uuid )
t
->
remove
(
t
->
clipIndexAt
(
position
)
);
m_clips
.
erase
(
it
);
clip
->
disconnect
(
this
);
bool
onTimeline
=
false
;
for
(
const
auto
&
clipInstance
:
m_clips
)
if
(
clipInstance
->
clip
->
uuid
()
==
clip
->
uuid
()
)
onTimeline
=
true
;
clip
->
setOnTimeline
(
onTimeline
);
emit
clipRemoved
(
uuid
.
toString
()
);
return
c
;
...
...
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