summaryrefslogtreecommitdiff
path: root/ges/ges-clip.c
diff options
context:
space:
mode:
authorHenry Wilkes <hwilkes@igalia.com>2020-03-03 18:00:51 +0000
committerHenry Wilkes <hwilkes@igalia.com>2020-03-16 14:19:52 +0000
commitdc4ca15ba803ea65ec705be4eee8730e9280f31c (patch)
tree08a554481c93e32940b175951aa53de7aebb31b2 /ges/ges-clip.c
parentc63fb5db0e994cd13fea373b5e8f6c240089940c (diff)
clip: copy and paste control bindings
Previously the control bindings were not properly copied into the pasted clip. Also changed the order so that elements are added to the clip before the clip is added to the timeline.
Diffstat (limited to 'ges/ges-clip.c')
-rw-r--r--ges/ges-clip.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/ges/ges-clip.c b/ges/ges-clip.c
index d57f3f5b..533ab22e 100644
--- a/ges/ges-clip.c
+++ b/ges/ges-clip.c
@@ -727,7 +727,9 @@ _deep_copy (GESTimelineElement * element, GESTimelineElement * copy)
for (tmp = GES_CONTAINER_CHILDREN (element); tmp; tmp = tmp->next) {
el = GES_TRACK_ELEMENT (tmp->data);
+ /* copies the children properties */
el_copy = ges_track_element_copy_core (el, TRUE);
+ ges_track_element_copy_bindings (el, el_copy, GST_CLOCK_TIME_NONE);
ccopy->priv->copied_track_elements =
g_list_append (ccopy->priv->copied_track_elements, el_copy);
}
@@ -745,17 +747,7 @@ _paste (GESTimelineElement * element, GESTimelineElement * ref,
if (self->priv->copied_layer)
nclip->priv->copied_layer = g_object_ref (self->priv->copied_layer);
-
ges_timeline_element_set_start (GES_TIMELINE_ELEMENT (nclip), paste_position);
- if (self->priv->copied_layer) {
- if (!ges_layer_add_clip (self->priv->copied_layer, nclip)) {
- GST_INFO ("%" GES_FORMAT " could not be pasted to %" GST_TIME_FORMAT,
- GES_ARGS (element), GST_TIME_ARGS (paste_position));
-
- return NULL;
- }
-
- }
for (tmp = self->priv->copied_track_elements; tmp; tmp = tmp->next) {
GESTrackElement *new_trackelement, *trackelement =
@@ -781,6 +773,18 @@ _paste (GESTimelineElement * element, GESTimelineElement * ref,
GST_CLOCK_TIME_NONE);
}
+ /* FIXME: should we bypass the select-tracks-for-object signal when
+ * copying and pasting? */
+ if (self->priv->copied_layer) {
+ if (!ges_layer_add_clip (self->priv->copied_layer, nclip)) {
+ GST_INFO ("%" GES_FORMAT " could not be pasted to %" GST_TIME_FORMAT,
+ GES_ARGS (element), GST_TIME_ARGS (paste_position));
+
+ return NULL;
+ }
+
+ }
+
return GES_TIMELINE_ELEMENT (nclip);
}