pitivi-formatter: Remove broken code to handle unlocked track object
authorThibault Saunier <thibault.saunier@collabora.com>
Fri, 22 Mar 2013 22:34:14 +0000 (19:34 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Mon, 15 Apr 2013 03:18:05 +0000 (00:18 -0300)
WARNING: The plan is to remove unlocked track object APIs so this is
the first part of that process... that code was already broken, and
*needs* to be fixed anyway, better do it using new APIs

ges/ges-pitivi-formatter.c

index c78f11b..ccb9fc3 100644 (file)
@@ -417,20 +417,10 @@ static void
 track_element_added_cb (GESClip * clip,
     GESTrackElement * track_element, GHashTable * props_table)
 {
-  gchar *media_type = NULL, *lockedstr;
-  GList *tmp = NULL;
-  GESTrack *track;
-  gint64 start, duration;
-  gboolean has_effect = FALSE, locked = TRUE;
-  gint type = 0;
   GESPitiviFormatter *formatter;
 
-  media_type = (gchar *) g_hash_table_lookup (props_table, "media_type");
-  lockedstr = (gchar *) g_hash_table_lookup (props_table, "locked");
-
   formatter = GES_PITIVI_FORMATTER (g_hash_table_lookup (props_table,
           "current-formatter"));
-
   if (formatter) {
     GESPitiviFormatterPrivate *priv = formatter->priv;
 
@@ -444,65 +434,6 @@ track_element_added_cb (GESClip * clip,
           GES_FORMATTER (formatter));
   }
 
-  if (lockedstr && !g_strcmp0 (lockedstr, "(bool)False"))
-    locked = FALSE;
-
-  for (tmp = GES_CONTAINER_CHILDREN (clip); tmp; tmp = tmp->next) {
-    if (!GES_IS_TRACK_ELEMENT (tmp->data)) {
-      /* If we arrive here something massively screwed */
-      GST_ERROR ("Not a TrackElement, this is a bug");
-      continue;
-    }
-
-    track = ges_track_element_get_track (tmp->data);
-    if (!track) {
-      GST_WARNING ("TrackElement not in a track yet");
-      continue;
-    }
-
-    if (GES_IS_EFFECT (tmp->data)) {
-      has_effect = TRUE;
-      continue;
-    }
-
-    if ((!g_strcmp0 (media_type, "pitivi.stream.VideoStream")
-            && track->type == GES_TRACK_TYPE_VIDEO)
-        || (!g_strcmp0 (media_type, "pitivi.stream.AudioStream")
-            && track->type == GES_TRACK_TYPE_AUDIO)) {
-
-      /* We unlock the track element so we do not move the whole Clip */
-      ges_track_element_set_locked (tmp->data, FALSE);
-      set_properties (G_OBJECT (tmp->data), props_table);
-
-      if (locked)
-        ges_track_element_set_locked (tmp->data, TRUE);
-
-      type = track->type;
-      g_object_get (tmp->data, "start", &start, "duration", &duration, NULL);
-    }
-  }
-
-  if (has_effect) {
-
-    /* FIXME make sure this is the way we want to handle that
-     * ie: set duration and start as the other trackelement
-     * and no let full control to the user. */
-
-    for (tmp = GES_CONTAINER_CHILDREN (clip); tmp; tmp = tmp->next) {
-      /* We set the effects start and duration */
-      track = ges_track_element_get_track (tmp->data);
-
-      if (GES_IS_EFFECT (tmp->data)
-          && (type == track->type)) {
-        /* We lock the track elements so we do not move the whole Clip */
-        ges_track_element_set_locked (tmp->data, FALSE);
-        g_object_set (tmp->data, "start", start, "duration", duration, NULL);
-        if (locked)
-          ges_track_element_set_locked (tmp->data, TRUE);
-      }
-    }
-  }
-
   /* Disconnect the signal */
   g_signal_handlers_disconnect_by_func (clip, track_element_added_cb,
       props_table);