From 99a36b2b695ef8d595beb8a610b7a99f9fbeab6a Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 25 Nov 2013 15:17:33 -0300 Subject: [PATCH] timeline: Add all assets of the clip added to the timeline to the project --- ges/ges-project.c | 1 + ges/ges-timeline.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/ges/ges-project.c b/ges/ges-project.c index 5600a3a..9cbb883 100644 --- a/ges/ges-project.c +++ b/ges/ges-project.c @@ -236,6 +236,7 @@ ges_project_extract (GESAsset * project, GError ** error) { GESTimeline *timeline = g_object_new (GES_TYPE_TIMELINE, NULL); + ges_extractable_set_asset (GES_EXTRACTABLE (timeline), GES_ASSET (project)); if (_load_project (GES_PROJECT (project), timeline, error)) return GES_EXTRACTABLE (timeline); diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c index 1edfd2f..241c0d1 100644 --- a/ges/ges-timeline.c +++ b/ges/ges-timeline.c @@ -2042,6 +2042,8 @@ clip_track_element_removed_cb (GESClip * clip, static void layer_object_added_cb (GESLayer * layer, GESClip * clip, GESTimeline * timeline) { + GESProject *project; + /* We make sure not to be connected twice */ g_signal_handlers_disconnect_by_func (clip, clip_track_element_added_cb, timeline); @@ -2063,7 +2065,15 @@ layer_object_added_cb (GESLayer * layer, GESClip * clip, GESTimeline * timeline) return; } + add_object_to_tracks (timeline, clip, NULL); + + GST_DEBUG ("Making sure that the asset is in our project"); + project = + GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (timeline))); + ges_project_add_asset (project, + ges_extractable_get_asset (GES_EXTRACTABLE (clip))); + GST_DEBUG ("Done"); } -- 2.7.4