priv->parsecontext = NULL;
g_hash_table_foreach (priv->layers, (GHFunc) _set_auto_transition, NULL);
- ges_timeline_enable_update (self->timeline, TRUE);
ges_project_set_loaded (self->project, self);
}
static gboolean
_emit_loaded_in_idle (EmitLoadedInIdle * data)
{
+ ges_timeline_commit (data->timeline);
g_signal_emit (data->project, _signals[LOADED_SIGNAL], 0, data->timeline);
- ges_timeline_enable_update (data->timeline, TRUE);
gst_object_unref (data->project);
gst_object_unref (data->timeline);
g_slice_free (EmitLoadedInIdle, data);
}
ges_project_add_formatter (GES_PROJECT (project), formatter);
- ges_timeline_enable_update (timeline, FALSE);
ges_formatter_load_from_uri (formatter, timeline, priv->uri, &lerr);
if (lerr) {
GST_WARNING_OBJECT (project, "Could not load the timeline,"
ges_project_set_loaded (GESProject * project, GESFormatter * formatter)
{
GST_INFO_OBJECT (project, "Emit project loaded");
+ ges_timeline_commit (formatter->timeline);
g_signal_emit (project, _signals[LOADED_SIGNAL], 0, formatter->timeline);
/* We are now done with that formatter */
- ges_timeline_enable_update (formatter->timeline, TRUE);
ges_project_remove_formatter (project, formatter);
return TRUE;
}
*
* To save/load a timeline, you can use the ges_timeline_load_from_uri() and
* ges_timeline_save_to_uri() methods to use the default format. If you wish
+ *
+ * Note that any change you make in the timeline will not actually be taken
+ * into account until you call the #ges_timeline_commit method.
*/
#include "ges-internal.h"
* and %FALSE otherwize */
gboolean needs_transitions_update;
- gboolean updates_enabled;
-
/* While we are creating and adding the TrackElements for a clip, we need to
* ignore the child-added signal */
GESClip *ignore_track_element_added;
case PROP_SNAPPING_DISTANCE:
g_value_set_uint64 (value, timeline->priv->snapping_distance);
break;
- case PROP_UPDATE:
- g_value_set_boolean (value, ges_timeline_is_updating (timeline));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
case PROP_SNAPPING_DISTANCE:
timeline->priv->snapping_distance = g_value_get_uint64 (value);
break;
- case PROP_UPDATE:
- ges_timeline_enable_update (timeline, g_value_get_boolean (value));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
g_object_class_install_property (object_class, PROP_SNAPPING_DISTANCE,
properties[PROP_SNAPPING_DISTANCE]);
- /**
- * GESTimeline:update:
- *
- * If %TRUE, then all modifications to objects within the timeline will
- * cause a internal pipeline update (if required).
- * If %FALSE, then only the timeline start/duration/stop properties
- * will be updated, and the internal pipeline will only be updated when the
- * property is set back to %TRUE.
- *
- * It is recommended to temporarily set this property to %FALSE before doing
- * more than one modification in the timeline (like adding or moving
- * several objects at once) in order to speed up the process, and then setting
- * back the property to %TRUE when done.
- */
-
- properties[PROP_UPDATE] = g_param_spec_boolean ("update", "Update",
- "Update the internal pipeline on every modification", TRUE,
- G_PARAM_READWRITE);
- g_object_class_install_property (object_class, PROP_UPDATE,
- properties[PROP_UPDATE]);
-
/**
* GESTimeline::track-added:
* @timeline: the #GESTimeline
g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gst_object_unref);
priv->needs_transitions_update = TRUE;
- priv->updates_enabled = TRUE;
-
g_signal_connect_after (self, "select-tracks-for-object",
G_CALLBACK (select_tracks_for_object_default), NULL);
}
GESTimelinePrivate *priv = timeline->priv;
- if (!priv->needs_transitions_update || !priv->updates_enabled)
+ if (!priv->needs_transitions_update)
return;
GST_DEBUG_OBJECT (timeline, "Creating transitions around %p", track_element);
/* Inform the track that it's currently being used by ourself */
ges_track_set_timeline (track, timeline);
- ges_track_enable_update (track, timeline->priv->updates_enabled);
-
GST_DEBUG ("Done adding track, emitting 'track-added' signal");
/* emit 'track-added' */
}
/**
- * ges_timeline_is_updating:
+ * ges_timeline_commit:
* @timeline: a #GESTimeline
*
- * Get whether the timeline is updated for every change happening within or not.
+ * Commits all the pending changes of the clips contained in the
+ * @timeline.
*
- * Returns: %TRUE if @timeline is updating on every changes, else %FALSE.
- */
-gboolean
-ges_timeline_is_updating (GESTimeline * timeline)
-{
- GList *tmp;
-
- g_return_val_if_fail (GES_IS_TIMELINE (timeline), FALSE);
-
- for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
- if (!ges_track_is_updating (GES_TRACK (tmp->data)))
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * ges_timeline_enable_update:
- * @timeline: a #GESTimeline
- * @enabled: Whether the timeline should update on every change or not.
+ * When timing changes happen in a timeline, the changes are not
+ * directly done inside GNL. This method needs to be called so any changes
+ * on a clip contained in the timeline actually happen at the media
+ * processing level.
*
- * Control whether the timeline is updated for every change happening within.
- *
- * Users will want to use this method with %FALSE before doing lots of changes,
- * and then call again with %TRUE for the changes to take effect in one go.
- *
- * Returns: %TRUE if the update status could be changed, else %FALSE.
+ * Returns: %TRUE if something as been commited %FALSE if nothing needed
+ * to be commited
*/
gboolean
-ges_timeline_enable_update (GESTimeline * timeline, gboolean enabled)
+ges_timeline_commit (GESTimeline * timeline)
{
GList *tmp;
gboolean res = TRUE;
- GST_DEBUG_OBJECT (timeline, "%s updates", enabled ? "Enabling" : "Disabling");
+ GST_DEBUG_OBJECT (timeline, "commiting changes");
for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
- if (!ges_track_enable_update (GES_TRACK (tmp->data), enabled))
+ if (!ges_track_commit (GES_TRACK (tmp->data)))
res = FALSE;
}
/* Make sure we reset the context */
timeline->priv->movecontext.needs_move_ctx = TRUE;
- timeline->priv->updates_enabled = enabled;
for (tmp = timeline->layers; tmp; tmp = tmp->next) {
_create_transitions_on_layer (timeline, GES_LAYER (tmp->data),
NULL, NULL, _find_transition_from_auto_transitions);
}
- if (res)
- g_object_notify_by_pspec (G_OBJECT (timeline), properties[PROP_UPDATE]);
-
return res;
}
GESTrack * ges_timeline_get_track_for_pad (GESTimeline *timeline, GstPad *pad);
GList *ges_timeline_get_tracks (GESTimeline *timeline);
-gboolean ges_timeline_enable_update(GESTimeline * timeline, gboolean enabled);
-gboolean ges_timeline_is_updating (GESTimeline * timeline);
+gboolean ges_timeline_commit (GESTimeline * timeline);
GstClockTime ges_timeline_get_duration (GESTimeline *timeline);
static GstElement *ges_track_element_create_gnl_object_func (GESTrackElement *
object);
-static void gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg
- G_GNUC_UNUSED, GESTrackElement * track_element);
-
-static void gnlobject_media_start_cb (GstElement * gnlobject, GParamSpec * arg
- G_GNUC_UNUSED, GESTrackElement * track_element);
-
-static void gnlobject_priority_cb (GstElement * gnlobject, GParamSpec * arg
- G_GNUC_UNUSED, GESTrackElement * track_element);
-
-static void gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg
- G_GNUC_UNUSED, GESTrackElement * track_element);
-
-static void gnlobject_active_cb (GstElement * gnlobject, GParamSpec * arg
- G_GNUC_UNUSED, GESTrackElement * track_element);
-
static void connect_properties_signals (GESTrackElement * object);
static void connect_signal (gpointer key, gpointer value, gpointer user_data);
static void gst_element_prop_changed_cb (GstElement * element, GParamSpec * arg
return FALSE;
- g_object_set (object->priv->gnlobject, "media-start", inpoint, NULL);
+ g_object_set (object->priv->gnlobject, "inpoint", inpoint, NULL);
} else
object->priv->pending_inpoint = inpoint;
if (G_UNLIKELY (duration == _DURATION (object)))
return FALSE;
- g_object_set (priv->gnlobject, "duration", duration,
- "media-duration", duration, NULL);
+ g_object_set (priv->gnlobject, "duration", duration, NULL);
} else
priv->pending_duration = duration;
{
g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), FALSE);
- GST_DEBUG ("object:%p, active:%d", object, active);
+ GST_DEBUG_OBJECT (object, "object:%p, active:%d", object, active);
if (object->priv->gnlobject != NULL) {
if (G_UNLIKELY (active == object->active))
return FALSE;
g_object_set (object->priv->gnlobject, "active", active, NULL);
+
+ if (active != object->active) {
+ object->active = active;
+ if (GES_TRACK_ELEMENT_GET_CLASS (object)->active_changed)
+ GES_TRACK_ELEMENT_GET_CLASS (object)->active_changed (object, active);
+ }
} else
object->priv->pending_active = active;
+
return TRUE;
}
return object->priv->track_type;
}
-/* Callbacks from the GNonLin object */
-static void
-gnlobject_start_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
- GESTrackElement * track_element)
-{
- guint64 start;
-
- g_object_get (gnlobject, "start", &start, NULL);
-
- GST_DEBUG_OBJECT (gnlobject, "start : %" GST_TIME_FORMAT " current : %"
- GST_TIME_FORMAT, GST_TIME_ARGS (start),
- GST_TIME_ARGS (_START (track_element)));
-
- if (start != _START (track_element)) {
- ges_timeline_element_set_start (GES_TIMELINE_ELEMENT (track_element),
- start);
- }
-}
-
static void
gst_element_prop_changed_cb (GstElement * element, GParamSpec * arg
G_GNUC_UNUSED, GESTrackElement * track_element)
}
-/* Callbacks from the GNonLin object */
-static void
-gnlobject_media_start_cb (GstElement * gnlobject,
- GParamSpec * arg G_GNUC_UNUSED, GESTrackElement * track_element)
-{
- guint64 inpoint;
-
- g_object_get (gnlobject, "media-start", &inpoint, NULL);
-
- GST_DEBUG_OBJECT (gnlobject, "in-point : %" GST_TIME_FORMAT " current : %"
- GST_TIME_FORMAT, GST_TIME_ARGS (inpoint),
- GST_TIME_ARGS (_INPOINT (track_element)));
-
- if (inpoint != _INPOINT (track_element)) {
- ges_timeline_element_set_inpoint (GES_TIMELINE_ELEMENT (track_element),
- inpoint);
- }
-}
-
-static void
-gnlobject_priority_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
- GESTrackElement * track_element)
-{
- guint32 priority;
-
- g_object_get (gnlobject, "priority", &priority, NULL);
-
- GST_DEBUG ("gnlobject priority : %d current : %d", priority,
- _PRIORITY (track_element));
-
- if (priority != _PRIORITY (track_element)) {
- ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (track_element),
- priority);
- }
-}
-
-static void
-gnlobject_duration_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
- GESTrackElement * track_element)
-{
- guint64 duration;
-
- g_object_get (gnlobject, "duration", &duration, NULL);
-
- GST_DEBUG_OBJECT (gnlobject, "duration : %" GST_TIME_FORMAT " current : %"
- GST_TIME_FORMAT, GST_TIME_ARGS (duration),
- GST_TIME_ARGS (_DURATION (track_element)));
-
- if (duration != _DURATION (track_element)) {
- ges_timeline_element_set_duration (GES_TIMELINE_ELEMENT (track_element),
- duration);
- }
-}
-
-static void
-gnlobject_active_cb (GstElement * gnlobject, GParamSpec * arg G_GNUC_UNUSED,
- GESTrackElement * track_element)
-{
- gboolean active;
- GESTrackElementClass *klass;
-
- klass = GES_TRACK_ELEMENT_GET_CLASS (track_element);
-
- g_object_get (gnlobject, "active", &active, NULL);
-
- GST_DEBUG ("gnlobject active : %d current : %d", active,
- track_element->active);
-
- if (active != track_element->active) {
- track_element->active = active;
- if (klass->active_changed)
- klass->active_changed (track_element, active);
- }
-}
-
-
/* default 'create_gnl_object' virtual method implementation */
static GstElement *
ges_track_element_create_gnl_object_func (GESTrackElement * self)
res = TRUE;
if (res) {
- /* Connect to property notifications */
- /* FIXME : remember the signalids so we can remove them later on !!! */
- g_signal_connect (G_OBJECT (object->priv->gnlobject), "notify::start",
- G_CALLBACK (gnlobject_start_cb), object);
- g_signal_connect (G_OBJECT (object->priv->gnlobject),
- "notify::media-start", G_CALLBACK (gnlobject_media_start_cb), object);
- g_signal_connect (G_OBJECT (object->priv->gnlobject), "notify::duration",
- G_CALLBACK (gnlobject_duration_cb), object);
- g_signal_connect (G_OBJECT (object->priv->gnlobject), "notify::priority",
- G_CALLBACK (gnlobject_priority_cb), object);
- g_signal_connect (G_OBJECT (object->priv->gnlobject), "notify::active",
- G_CALLBACK (gnlobject_active_cb), object);
-
/* Set some properties on the GnlObject */
g_object_set (object->priv->gnlobject,
"duration", object->priv->pending_duration,
- "media-duration", object->priv->pending_duration,
"start", object->priv->pending_start,
- "media-start", object->priv->pending_inpoint,
+ "inpoint", object->priv->pending_inpoint,
"priority", object->priv->pending_priority,
"active", object->priv->pending_active, NULL);
+ /* Pendings values are not pending anymore */
+ GES_TIMELINE_ELEMENT_START (object) = object->priv->pending_start;
+ GES_TIMELINE_ELEMENT_INPOINT (object) = object->priv->pending_inpoint;
+ GES_TIMELINE_ELEMENT_DURATION (object) = object->priv->pending_duration;
+ GES_TIMELINE_ELEMENT_PRIORITY (object) = object->priv->pending_priority;
+ object->active = object->priv->pending_active;
+
+
if (object->priv->track != NULL)
g_object_set (object->priv->gnlobject,
"caps", ges_track_get_caps (object->priv->track), NULL);
}
/**
- * ges_track_enable_update:
+ * ges_track_commit:
* @track: a #GESTrack
- * @enabled: Whether the track should update on every change or not.
*
- * Control whether the track is updated for every change happening within.
+ * Commits all the pending changes of the TrackElement contained in the
+ * track.
*
- * Users will want to use this method with %FALSE before doing lots of changes,
- * and then call again with %TRUE for the changes to take effect in one go.
+ * When timing changes happen in a timeline, the changes are not
+ * directly done inside GNL. This method needs to be called so any changes
+ * on a clip contained in the timeline actually happen at the media
+ * processing level.
*
- * Returns: %TRUE if the update status could be changed, else %FALSE.
+ * Returns: %TRUE if something as been commited %FALSE if nothing needed
+ * to be commited
*/
gboolean
-ges_track_enable_update (GESTrack * track, gboolean enabled)
+ges_track_commit (GESTrack * track)
{
- gboolean update;
+ gboolean ret;
g_return_val_if_fail (GES_IS_TRACK (track), FALSE);
- g_object_set (track->priv->composition, "update", enabled, NULL);
- g_object_get (track->priv->composition, "update", &update, NULL);
+ g_signal_emit_by_name (track->priv->composition, "commit", TRUE, &ret);
- track->priv->updating = update;
-
- if (update == TRUE)
- resort_and_fill_gaps (track);
-
- return update == enabled;
-}
-
-/**
- * ges_track_is_updating:
- * @track: a #GESTrack
- *
- * Get whether the track is updated for every change happening within or not.
- *
- * Returns: %TRUE if @track is updating on every changes, else %FALSE.
- */
-gboolean
-ges_track_is_updating (GESTrack * track)
-{
- g_return_val_if_fail (GES_IS_TRACK (track), FALSE);
-
- return track->priv->updating;
+ return ret;
}
};
const GstCaps* ges_track_get_caps (GESTrack *track);
-gboolean ges_track_is_updating (GESTrack *track);
GList* ges_track_get_elements (GESTrack *track);
const GESTimeline* ges_track_get_timeline (GESTrack *track);
-gboolean ges_track_enable_update (GESTrack *track, gboolean enabled);
+gboolean ges_track_commit (GESTrack *track);
void ges_track_set_caps (GESTrack *track, const GstCaps *caps);
void ges_track_set_timeline (GESTrack *track, GESTimeline *timeline);
gboolean ges_track_add_element (GESTrack *track, GESTrackElement *object);
assert_equals_uint64 (_DURATION (trackelement), 51);
assert_equals_uint64 (_INPOINT (trackelement), 12);
+ fail_unless (ges_timeline_commit (timeline));
/* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
51, 0, TRUE);
assert_equals_uint64 (_DURATION (trackelement), 510);
assert_equals_uint64 (_INPOINT (trackelement), 120);
+ fail_unless (ges_timeline_commit (timeline));
/* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
120, 510, 0, TRUE);
/* Test mute support */
g_object_set (clip, "mute", TRUE, NULL);
+ fail_unless (ges_timeline_commit (timeline));
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
120, 510, 0, FALSE);
g_object_set (clip, "mute", FALSE, NULL);
+ fail_unless (ges_timeline_commit (timeline));
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
120, 510, 0, TRUE);
}
}
fail_unless (gap != NULL);
+ fail_unless (ges_timeline_commit (timeline));
gap_object_check (gap, 5, 10, 0);
clip2 = GES_CLIP (ges_test_clip_new ());
gap = GST_BIN_CHILDREN (composition)->data;
fail_unless (gap != NULL);
+ fail_unless (ges_timeline_commit (timeline));
gap_object_check (gap, 0, 10, 0);
gst_object_unref (timeline);
ges_layer_add_asset (layer, asset, 0, 0, 10, GES_TRACK_TYPE_UNKNOWN);
gst_object_unref (asset);
+ ges_timeline_commit (timeline);
ASSERT_SET_STATE (GST_ELEMENT (pipeline), GST_STATE_PLAYING,
GST_STATE_CHANGE_ASYNC);
fail_unless (gst_element_get_state (GST_ELEMENT (pipeline), &state, NULL,
assert_equals_uint64 (_INPOINT (clip), 12);
ges_layer_add_clip (layer, GES_CLIP (clip));
+ ges_timeline_commit (timeline);
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
fail_unless (trackelement != NULL);
assert_equals_uint64 (_INPOINT (trackelement), 120);
/* And let's also check that it propagated correctly to GNonLin */
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
120, 510, 0, TRUE);
/* This time, we move the trackelement to see if the changes move
* along to the parent and the gnonlin clip */
g_object_set (trackelement, "start", (guint64) 400, NULL);
+ ges_timeline_commit (timeline);
assert_equals_uint64 (_START (clip), 400);
assert_equals_uint64 (_START (trackelement), 400);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 400, 510,
assert_equals_uint64 (_INPOINT (clip), 12);
ges_layer_add_clip (layer, GES_CLIP (clip));
+ ges_timeline_commit (timeline);
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 2);
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
fail_unless (trackelement != NULL);
assert_equals_uint64 (_DURATION (clip), 51);
assert_equals_uint64 (_INPOINT (clip), 12);
assert_equals_uint64 (_PRIORITY (clip), 0);
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
51, 0, TRUE);
g_object_set (layer, "priority", 1, NULL);
assert_equals_int (ges_layer_get_priority (layer), 1);
assert_equals_uint64 (_PRIORITY (clip), 0);
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
51, LAYER_HEIGHT, TRUE);
g_object_set (layer, "priority", 31, NULL);
assert_equals_int (ges_layer_get_priority (layer), 31);
assert_equals_uint64 (_PRIORITY (clip), 0);
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
51, LAYER_HEIGHT * 31, TRUE);
g_object_set (layer, "priority", 0, NULL);
assert_equals_int (ges_layer_get_priority (layer), 0);
assert_equals_uint64 (_PRIORITY (clip), 0);
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12,
51, 0, TRUE);
trackelement3 = ges_clip_find_track_element (clip3, track, G_TYPE_NONE);
fail_unless (trackelement3 != NULL);
+ ges_timeline_commit (timeline);
assert_equals_int (_PRIORITY (clip1), 0);
gnlobj1 = ges_track_element_get_gnlobject (trackelement1);
fail_unless (gnlobj1 != NULL);
g_object_set (layer1, "priority", 2, NULL);
g_object_set (layer2, "priority", 0, NULL);
g_object_set (layer3, "priority", 1, NULL);
+ ges_timeline_commit (timeline);
/* And check the new priorities */
assert_equals_int (ges_layer_get_priority (layer1), 2);
/* And move objects around */
fail_unless (ges_clip_move_to_layer (clip2, layer1));
fail_unless (ges_clip_move_to_layer (clip3, layer1));
+ ges_timeline_commit (timeline);
objs = ges_layer_get_clips (layer1);
assert_equals_int (g_list_length (objs), 3);
* refected on it containing Clip */
ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (trackelement3),
LAYER_HEIGHT * 2);
+ ges_timeline_commit (timeline);
g_object_get (gnlobj3, "priority", &prio3, NULL);
assert_equals_int (prio3, 2 * LAYER_HEIGHT);
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1);
assert_equals_uint64 (_INPOINT (clip), 12);
ges_layer_add_clip (layer, GES_CLIP (clip));
+ ges_timeline_commit (timeline);
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
fail_unless (trackelement != NULL);
/* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
"in-point", (guint64) 120, NULL);
+ ges_timeline_commit (timeline);
assert_equals_uint64 (_START (clip), 420);
assert_equals_uint64 (_DURATION (clip), 510);
assert_equals_uint64 (_INPOINT (clip), 120);
gchar * ges_test_file_uri (const gchar *filename);
#define gnl_object_check(gnlobj, start, duration, mstart, mduration, priority, active) { \
- guint64 pstart, pdur, pmstart, pmdur, pprio, pact; \
+ guint64 pstart, pdur, inpoint, pprio, pact; \
g_object_get (gnlobj, "start", &pstart, "duration", &pdur, \
- "media-start", &pmstart, "media-duration", &pmdur, \
- "priority", &pprio, "active", &pact, \
+ "inpoint", &inpoint, "priority", &pprio, "active", &pact, \
NULL); \
assert_equals_uint64 (pstart, start); \
assert_equals_uint64 (pdur, duration); \
- assert_equals_uint64 (pmstart, mstart); \
- assert_equals_uint64 (pmdur, mduration); \
+ assert_equals_uint64 (inpoint, mstart); \
assert_equals_int (pprio, priority); \
assert_equals_int (pact, active); \
}
element = ges_layer_get_clips (layer)->data;
deep_check (element, 0, 0, 10);
- ges_timeline_enable_update (timeline, FALSE);
ges_clip_edit (GES_CLIP (element), NULL, -1, GES_EDIT_MODE_TRIM,
GES_EDGE_START, 5);
deep_check (element, 5, 5, 5);
assert_equals_uint64 (_INPOINT (clip), 12);
ges_layer_add_clip (layer, GES_CLIP (clip));
+ ges_timeline_commit (timeline);
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
fail_unless (trackelement != NULL);
/* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
"in-point", (guint64) 120, NULL);
+ ges_timeline_commit (timeline);
assert_equals_uint64 (_START (clip), 420);
assert_equals_uint64 (_DURATION (clip), 510);
assert_equals_uint64 (_INPOINT (clip), 120);
assert_equals_uint64 (_INPOINT (clip), 12);
fail_unless (ges_layer_add_clip (layer, GES_CLIP (clip)));
+ ges_timeline_commit (timeline);
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (clip)), 1);
trackelement = GES_CONTAINER_CHILDREN (clip)->data;
fail_unless (trackelement != NULL);
/* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
"in-point", (guint64) 120, NULL);
+ ges_timeline_commit (timeline);
assert_equals_uint64 (_START (clip), 420);
assert_equals_uint64 (_DURATION (clip), 510);
assert_equals_uint64 (_INPOINT (clip), 120);
fail_unless (GES_IS_ASSET (asset));
clip = ges_layer_add_asset (layer, GES_ASSET (asset),
42, 12, 51, GES_TRACK_TYPE_AUDIO);
+ ges_timeline_commit (timeline);
assert_is_type (clip, GES_TYPE_URI_CLIP);
assert_equals_uint64 (_START (clip), 42);
assert_equals_uint64 (_DURATION (clip), 51);
/* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
"in-point", (guint64) 120, NULL);
+ ges_timeline_commit (timeline);
assert_equals_uint64 (_START (clip), 420);
assert_equals_uint64 (_DURATION (clip), 510);
assert_equals_uint64 (_INPOINT (clip), 120);
/* Test mute support */
g_object_set (clip, "mute", TRUE, NULL);
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
120, 510, 0, FALSE);
g_object_set (clip, "mute", FALSE, NULL);
+ ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510,
120, 510, 0, TRUE);
if (!(timeline = create_timeline (argc, argv, audio, video)))
goto failure;
}
+ ges_timeline_commit (timeline);
/* save project if path is given. we do this now in case GES crashes or
* hangs during playback. */