[pitivi] Port to the new GESContainer API
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Port to the new GESContainer API
- Date: Thu, 4 Apr 2013 20:15:38 +0000 (UTC)
commit fbd6235f4c28bc67fd8dbcc0c9af19fa3f75aa25
Author: Thibault Saunier <thibault saunier collabora com>
Date: Thu Feb 28 22:42:11 2013 -0300
Port to the new GESContainer API
pitivi/clipproperties.py | 14 +++++++-------
pitivi/timeline/thumbnailer.py | 2 +-
pitivi/timeline/timeline.py | 8 ++++----
pitivi/timeline/track.py | 16 ++++++++--------
pitivi/transitions.py | 4 ++--
pitivi/undo/timeline.py | 10 +++++-----
pitivi/utils/timeline.py | 12 ++++++------
7 files changed, 33 insertions(+), 33 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index 8a2a9c8..850a1cf 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -279,8 +279,8 @@ class EffectProperties(Gtk.Expander, Loggable):
if selection.selected:
self.clips = list(selection.selected)
for clip in self.clips:
- clip.connect("track-element-added", self._TrackElementAddedCb)
- clip.connect("track-element-removed", self._trackElementRemovedCb)
+ clip.connect("child-added", self._TrackElementAddedCb)
+ clip.connect("child-removed", self._trackElementRemovedCb)
self.show()
else:
self.clips = []
@@ -314,7 +314,7 @@ class EffectProperties(Gtk.Expander, Loggable):
self.app.action_log.begin("remove effect")
self._cleanCache(effect)
effect.get_track().remove_element(effect)
- effect.get_clip().release_track_element(effect)
+ effect.get_parent().remove(effect)
self._updateTreeview()
self.app.action_log.commit()
@@ -330,7 +330,7 @@ class EffectProperties(Gtk.Expander, Loggable):
# Checking that this effect can be applied on this track object
# Which means, it has the corresponding media_type
- for track_element in clip.get_track_elements():
+ for track_element in clip.get_children():
track = track_element.get_track()
if track.get_property("track_type") == GES.TrackType.AUDIO and \
media_type == AUDIO_EFFECT or \
@@ -339,7 +339,7 @@ class EffectProperties(Gtk.Expander, Loggable):
#Actually add the effect
self.app.action_log.begin("add effect")
effect = GES.Effect(bin_description=bin_desc)
- clip.add_track_element(effect)
+ clip.add(effect)
track.add_element(effect)
self.updateAll()
self.app.action_log.commit()
@@ -585,7 +585,7 @@ class TransformationProperties(Gtk.Expander):
self.app.current.pipeline.flushSeek()
def _findEffect(self, name):
- for effect in self._selected_clip.get_track_elements():
+ for effect in self._selected_clip.get_children():
if isinstance(effect, GES.BaseEffect):
if name in effect.get_property("bin-description"):
self.effect = effect
@@ -595,7 +595,7 @@ class TransformationProperties(Gtk.Expander):
effect = self._findEffect(name)
if not effect:
effect = GES.Effect(bin_description=name)
- self._selected_clip.add_track_element(effect)
+ self._selected_clip.add(effect)
tracks = self.app.projectManager.current.timeline.get_tracks()
for track in tracks:
if track.get_caps().to_string() == "video/x-raw":
diff --git a/pitivi/timeline/thumbnailer.py b/pitivi/timeline/thumbnailer.py
index 7b5a03a..484b64d 100644
--- a/pitivi/timeline/thumbnailer.py
+++ b/pitivi/timeline/thumbnailer.py
@@ -218,7 +218,7 @@ def get_preview_for_object(instance, trackelement):
# previewers[key] = RandomAccessAudioPreviewer(instance, uri)
previewers[key] = DefaultPreviewer(instance, uri)
elif track_type == GES.TrackType.VIDEO:
- if trackelement.get_clip().is_image():
+ if trackelement.get_parent().is_image():
previewers[key] = StillImagePreviewer(instance, uri)
else:
previewers[key] = RandomAccessVideoPreviewer(instance, uri)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 4103b98..e10abbb 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1252,7 +1252,7 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
# Checking that this effect can be applied on this track object
# Which means, it has the corresponding media_type
- for track_element in clip.get_track_elements():
+ for track_element in clip.get_children():
track = track_element.get_track()
if track.get_property("track_type") == GES.TrackType.AUDIO and \
media_type == AUDIO_EFFECT or \
@@ -1261,7 +1261,7 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
#Actually add the effect
self.app.action_log.begin("add effect")
effect = GES.Effect(bin_description=bin_desc)
- clip.add_track_element(effect)
+ clip.add(effect)
track.add_element(effect)
self.app.gui.clipconfig.effect_expander.updateAll()
self.app.action_log.commit()
@@ -1279,7 +1279,7 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
track_elements = [obj for obj in items_in_area[1]]
for track_element in track_elements:
- clips.append(track_element.get_clip())
+ clips.append(track_element.get_parent())
return clips
@@ -1784,7 +1784,7 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
start = element.get_start()
end = start + element.get_duration()
if start < position and end > position:
- clip = element.get_clip()
+ clip = element.get_parent()
clip.split(position)
self.timeline.enable_update(True)
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index a06f9b3..b968e73 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -303,7 +303,7 @@ class StartHandle(TrimHandle):
TrackElementController.drag_start(self, item, target, event)
if self._view.element.is_locked():
- elem = self._view.element.get_clip()
+ elem = self._view.element.get_parent()
else:
elem = self._view.element
@@ -337,7 +337,7 @@ class EndHandle(TrimHandle):
TrackElementController.drag_start(self, item, target, event)
if self._view.element.is_locked():
- elem = self._view.element.get_clip()
+ elem = self._view.element.get_parent()
else:
elem = self._view.element
self._context = EditingContext(elem, self._view.timeline,
@@ -616,12 +616,12 @@ class TrackElement(View, GooCanvas.CanvasGroup, Zoomable, Loggable):
self.app.gui.trans_list.activate(self.element)
elif isinstance(self.element, GES.TitleSource):
self.app.gui.switchContextTab("title editor")
- self.app.gui.title_editor.set_source(self.element.get_clip())
+ self.app.gui.title_editor.set_source(self.element.get_parent())
else:
if self.element.get_track().get_property("track_type") == GES.TrackType.VIDEO:
has_text_overlay = False
- clip = self.element.get_clip()
- elements = clip.get_track_elements()
+ clip = self.element.get_parent()
+ elements = clip.get_children()
for element in elements:
if isinstance(element, GES.TextOverlay):
has_text_overlay = True
@@ -632,7 +632,7 @@ class TrackElement(View, GooCanvas.CanvasGroup, Zoomable, Loggable):
title.set_start(self.element.start)
title.set_duration(self.element.duration)
# FIXME: Creating a text overlay everytime we select a video track object is madness
- self.element.get_clip().add_track_element(title)
+ self.element.get_parent().add(title)
self.element.get_track().add_element(title)
self.app.gui.title_editor.set_source(title)
self.app.gui.trans_list.deactivate()
@@ -650,7 +650,7 @@ class TrackElement(View, GooCanvas.CanvasGroup, Zoomable, Loggable):
raise Exception(e)
# get layer and track_type
- layer = self.element.get_clip().get_layer()
+ layer = self.element.get_parent().get_layer()
track_type = self.element.get_track().get_property("track-type")
# update height, compare with current height to not run into recursion
@@ -763,7 +763,7 @@ class UriSource(TrackElement):
Set the human-readable file name as the clip's text label
"""
if self.element:
- info = element.get_clip().get_asset().get_info()
+ info = element.get_parent().get_asset().get_info()
self.name.props.text = info_name(info)
twidth, theight = text_size(self.name)
self.namewidth = twidth
diff --git a/pitivi/transitions.py b/pitivi/transitions.py
index 46bdebe..0758121 100644
--- a/pitivi/transitions.py
+++ b/pitivi/transitions.py
@@ -165,7 +165,7 @@ class TransitionsListWidget(Signallable, Gtk.VBox, Loggable):
position = self.app.current.pipeline.getPosition()
self.app.current.pipeline.simple_seek(0)
- self.element.get_clip().set_asset(transition_asset)
+ self.element.get_parent().set_asset(transition_asset)
# Seek back into the previous position, refreshing the preview
self.app.current.pipeline.simple_seek(position)
@@ -278,7 +278,7 @@ class TransitionsListWidget(Signallable, Gtk.VBox, Loggable):
self.element.connect("notify::border", self._borderChangedCb)
self.element.connect("notify::invert", self._invertChangedCb)
self.element.connect("notify::type", self._transitionTypeChangedCb)
- transition_asset = element.get_clip().get_asset()
+ transition_asset = element.get_parent().get_asset()
if transition_asset.get_id() == "crossfade":
self.props_widgets.set_sensitive(False)
else:
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index 47b2cbd..0fe6ed3 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -122,7 +122,7 @@ class ClipAdded(UndoableAction):
self.timeline = timeline
self.clip = clip
self.tracks = dict((track_element, track_element.get_track())
- for track_element in clip.get_track_elements())
+ for track_element in clip.get_children())
def do(self):
for track_element, track in self.tracks.iteritems():
@@ -141,7 +141,7 @@ class ClipRemoved(UndoableAction):
self.timeline = timeline
self.clip = clip
self.tracks = dict((track_element, track_element.get_track())
- for track_element in clip.get_track_elements())
+ for track_element in clip.get_children())
def do(self):
self.timeline.removeClip(self.clip, deep=True)
@@ -281,9 +281,9 @@ class TimelineLogObserver(object):
self._clipPropertyChangedCb, property_name)
self.clip_property_trackers[clip] = tracker
- clip.connect("track-element-added", self._clipTrackElementAddedCb)
- clip.connect("track-element-removed", self._clipTrackElementRemovedCb)
- for element in clip.get_track_elements():
+ clip.connect("child-added", self._clipTrackElementAddedCb)
+ clip.connect("child-removed", self._clipTrackElementRemovedCb)
+ for element in clip.get_children():
self._connectToTrackElement(element)
def _disconnectFromClip(self, clip):
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index 34ae031..2b5b5db 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -106,7 +106,7 @@ class Selection(Signallable):
for obj in objs:
# FIXME GES break, handle the fact that we have unlinked objects in GES
if isinstance(obj, GES.TrackElement):
- selection.add(obj.get_clip())
+ selection.add(obj.get_parent())
else:
selection.add(obj)
@@ -125,12 +125,12 @@ class Selection(Signallable):
self.last_single_obj = iter(selection).next()
for obj in old_selection - self.selected:
- for element in obj.get_track_elements():
+ for element in obj.get_children():
if not isinstance(element, GES.BaseEffect) and not isinstance(element, GES.TextOverlay):
element.selected.selected = False
for obj in self.selected - old_selection:
- for element in obj.get_track_elements():
+ for element in obj.get_children():
if not isinstance(element, GES.BaseEffect) and not isinstance(element, GES.TextOverlay):
element.selected.selected = True
@@ -142,7 +142,7 @@ class Selection(Signallable):
"""
objects = []
for clip in self.selected:
- objects.extend(clip.get_track_elements())
+ objects.extend(clip.get_children())
return set(objects)
@@ -152,7 +152,7 @@ class Selection(Signallable):
"""
effects = []
for clip in self.selected:
- for element in clip.get_track_elements():
+ for element in clip.get_children():
if isinstance(element, GES.BaseEffect):
effects.append(element)
@@ -213,7 +213,7 @@ class EditingContext(Signallable):
self.other = other
if isinstance(focus, GES.TrackElement):
- self.focus = focus.get_clip()
+ self.focus = focus.get_parent()
else:
self.focus = focus
self.timeline = timeline
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]