[pitivi] Rename bElement/Clip/Timeline to ges_elem/clip/timeline
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Rename bElement/Clip/Timeline to ges_elem/clip/timeline
- Date: Fri, 12 Feb 2016 17:55:45 +0000 (UTC)
commit 68dd0584fe17bdf81d7938dc8b25b14484620dd4
Author: Thibault Saunier <tsaunier gnome org>
Date: Thu Feb 11 13:43:44 2016 +0100
Rename bElement/Clip/Timeline to ges_elem/clip/timeline
It is a more understandable and bElement was a wrong variable/attribute
name.
Reviewed-by: Alex Băluț <alexandru balut gmail com>
Differential Revision: https://phabricator.freedesktop.org/D763
docs/pylint.rc | 2 +-
pitivi/mainwindow.py | 14 ++--
pitivi/render.py | 2 +-
pitivi/timeline/elements.py | 129 ++++++++++++++++++--------------------
pitivi/timeline/layer.py | 86 +++++++++++++-------------
pitivi/timeline/previewers.py | 58 ++++++++----------
pitivi/timeline/timeline.py | 130 ++++++++++++++++++--------------------
tests/common.py | 20 +++---
tests/test_timeline_timeline.py | 38 ++++++------
9 files changed, 231 insertions(+), 248 deletions(-)
---
diff --git a/docs/pylint.rc b/docs/pylint.rc
index 84f4d0e..7cad009 100644
--- a/docs/pylint.rc
+++ b/docs/pylint.rc
@@ -60,7 +60,7 @@ variable-rgx=[a-z_][a-z0-9_]{1,30}$
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
-good-names=x,y,z,i,j,k,ex,Run,_,bElement
+good-names=x,y,z,i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index c567d03..7104a85 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -382,22 +382,22 @@ class PitiviMainWindow(Gtk.ApplicationWindow, Loggable):
self.info("Minimum UI size has been reduced to " +
str(min_size.width) + "x" + str(min_size.height))
- def switchContextTab(self, bClip):
+ def switchContextTab(self, ges_clip):
"""
Switch the tab being displayed on the second set of tabs,
depending on the context.
- @param bClip: The clip which has been focused.
- @type bClip: GES.SourceClip
+ @param ges_clip: The clip which has been focused.
+ @type ges_clip: GES.SourceClip
"""
- if isinstance(bClip, GES.TitleClip):
+ if isinstance(ges_clip, GES.TitleClip):
page = 2
- elif isinstance(bClip, GES.SourceClip):
+ elif isinstance(ges_clip, GES.SourceClip):
page = 0
- elif isinstance(bClip, GES.TransitionClip):
+ elif isinstance(ges_clip, GES.TransitionClip):
page = 1
else:
- self.warning("Unknown clip type: %s", bClip)
+ self.warning("Unknown clip type: %s", ges_clip)
return
self.context_tabs.set_current_page(page)
diff --git a/pitivi/render.py b/pitivi/render.py
index 500c115..ebf342e 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -747,7 +747,7 @@ class RenderDialog(Loggable):
self.debug("Rendering from proxies, not replacing assets")
return
- for layer in self.app.gui.timeline_ui.bTimeline.get_layers():
+ for layer in self.app.gui.timeline_ui.ges_timeline.get_layers():
for clip in layer.get_clips():
if not isinstance(clip, GES.UriClip):
continue
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 2b1dd0a..64e200c 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -21,11 +21,6 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-"""
-Convention throughout this file:
-Every GES element which name could be mistaken with a UI element
-is prefixed with a little b, example : bTimeline
-"""
import os
from gettext import gettext as _
@@ -215,7 +210,7 @@ class KeyframeCurve(FigureCanvas, Loggable):
# Callbacks
def __controlSourceChangedCb(self, unused_control_source, unused_timed_value):
self.__updatePlots()
- self.__timeline.bTimeline.get_parent().commit_timeline()
+ self.__timeline.ges_timeline.get_parent().commit_timeline()
def __gtkMotionEventCb(self, unused_widget, unused_event):
"""
@@ -351,16 +346,16 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
self.set_name(element.get_name())
self.timeline = timeline
- self._bElement = element
- self._bElement.selected = timelineUtils.Selected()
- self._bElement.selected.connect(
+ self._ges_elem = element
+ self._ges_elem.selected = timelineUtils.Selected()
+ self._ges_elem.selected.connect(
"selected-changed", self.__selectedChangedCb)
self.__width = 0
self.__height = 0
# Needed for effect's keyframe toggling
- self._bElement.ui_element = self
+ self._ges_elem.ui_element = self
self.props.vexpand = True
@@ -380,7 +375,7 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
# and override that one.
self.__controlledProperty = self._getDefaultMixingProperty()
if self.__controlledProperty:
- self.__createControlBinding(self._bElement)
+ self.__createControlBinding(self._ges_elem)
def release(self):
if self.__previewer:
@@ -411,7 +406,7 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
self.__removeKeyframes()
self.__controlledProperty = self._getDefaultMixingProperty()
if self.__controlledProperty:
- self.__createControlBinding(self._bElement)
+ self.__createControlBinding(self._ges_elem)
def __curveEnterCb(self, unused_keyframe_curve):
self.emit("curve-enter")
@@ -440,9 +435,9 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
val = float(self.__controlledProperty.default_value) / \
(self.__controlledProperty.maximum -
self.__controlledProperty.minimum)
- source.set(self._bElement.props.in_point, val)
+ source.set(self._ges_elem.props.in_point, val)
source.set(
- self._bElement.props.duration + self._bElement.props.in_point,
+ self._ges_elem.props.duration + self._ges_elem.props.in_point,
val)
self.__removeKeyframes()
@@ -453,7 +448,7 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
self.__keyframeCurve.connect("leave", self.__curveLeaveCb)
self.add(self.__keyframeCurve)
self.__keyframeCurve.set_size_request(self.__width, self.__height)
- self.__keyframeCurve.props.visible = bool(self._bElement.selected)
+ self.__keyframeCurve.props.visible = bool(self._ges_elem.selected)
self.queue_draw()
def __createControlBinding(self, element):
@@ -473,7 +468,7 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
element.set_control_source(source,
self.__controlledProperty.name, "direct")
- def __controlBindingAddedCb(self, unused_bElement, binding):
+ def __controlBindingAddedCb(self, unused_ges_elem, binding):
if binding.props.name == self.__controlledProperty.name:
self.__createKeyframeCurve(binding)
@@ -492,7 +487,7 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
if len(self.timeline.selection) > 1:
return False
- return self._bElement.selected
+ return self._ges_elem.selected
def do_draw(self, cr):
self.propagate_draw(self.__background, cr)
@@ -505,13 +500,13 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
def do_show_all(self):
for child in self.get_children():
- if bool(self._bElement.selected) or child != self.__keyframeCurve:
+ if bool(self._ges_elem.selected) or child != self.__keyframeCurve:
child.show_all()
self.show()
# Callbacks
- def __selectedChangedCb(self, unused_bElement, selected):
+ def __selectedChangedCb(self, unused_ges_elem, selected):
if self.__keyframeCurve:
self.__keyframeCurve.props.visible = selected
@@ -565,7 +560,7 @@ class TitleSource(VideoSource):
__gtype_name__ = "PitiviTitleSource"
def _getDefaultMixingProperty(self):
- for spec in self._bElement.list_children_properties():
+ for spec in self._ges_elem.list_children_properties():
if spec.name == "alpha":
return spec
@@ -579,13 +574,13 @@ class VideoUriSource(VideoSource):
self.get_style_context().add_class("VideoUriSource")
def _getPreviewer(self):
- previewer = previewers.VideoPreviewer(self._bElement)
+ previewer = previewers.VideoPreviewer(self._ges_elem)
previewer.get_style_context().add_class("VideoUriSource")
return previewer
def _getDefaultMixingProperty(self):
- for spec in self._bElement.list_children_properties():
+ for spec in self._ges_elem.list_children_properties():
if spec.name == "alpha":
return spec
@@ -606,7 +601,7 @@ class AudioUriSource(TimelineElement):
self.get_style_context().add_class("AudioUriSource")
def _getPreviewer(self):
- previewer = previewers.AudioPreviewer(self._bElement)
+ previewer = previewers.AudioPreviewer(self._ges_elem)
previewer.get_style_context().add_class("AudioUriSource")
previewer.startLevelsDiscoveryWhenIdle()
@@ -616,7 +611,7 @@ class AudioUriSource(TimelineElement):
return AudioBackground()
def _getDefaultMixingProperty(self):
- for spec in self._bElement.list_children_properties():
+ for spec in self._ges_elem.list_children_properties():
if spec.name == "volume":
return spec
@@ -672,12 +667,12 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
__gtype_name__ = "PitiviClip"
- def __init__(self, layer, bClip):
+ def __init__(self, layer, ges_clip):
super(Clip, self).__init__()
timelineUtils.Zoomable.__init__(self)
Loggable.__init__(self)
- name = bClip.get_name()
+ name = ges_clip.get_name()
self.set_name(name)
self.get_accessible().set_name(name)
@@ -686,9 +681,9 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.timeline = layer.timeline
self.app = layer.app
- self.bClip = bClip
- self.bClip.ui = self
- self.bClip.selected = timelineUtils.Selected()
+ self.ges_clip = ges_clip
+ self.ges_clip.ui = self
+ self.ges_clip.selected = timelineUtils.Selected()
self._audioSource = None
self._videoSource = None
@@ -696,8 +691,8 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self._setupWidget()
self.__force_position_update = True
- for child in self.bClip.get_children(False):
- self._childAdded(self.bClip, child)
+ for child in self.ges_clip.get_children(False):
+ self._childAdded(self.ges_clip, child)
self.__connectToChild(child)
# Connect to Widget signals.
@@ -705,13 +700,13 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.connect("event", self._eventCb)
# Connect to GES signals.
- self.bClip.connect("notify::start", self._startChangedCb)
- self.bClip.connect("notify::inpoint", self._startChangedCb)
- self.bClip.connect("notify::duration", self._durationChangedCb)
- self.bClip.connect("notify::layer", self._layerChangedCb)
+ self.ges_clip.connect("notify::start", self._startChangedCb)
+ self.ges_clip.connect("notify::inpoint", self._startChangedCb)
+ self.ges_clip.connect("notify::duration", self._durationChangedCb)
+ self.ges_clip.connect("notify::layer", self._layerChangedCb)
- self.bClip.connect_after("child-added", self._childAddedCb)
- self.bClip.connect_after("child-removed", self._childRemovedCb)
+ self.ges_clip.connect_after("child-added", self._childAddedCb)
+ self.ges_clip.connect_after("child-removed", self._childRemovedCb)
# To be able to receive effects dragged on clips.
self.drag_dest_set(0, [ui.EFFECT_TARGET_ENTRY], Gdk.DragAction.COPY)
@@ -719,7 +714,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
@property
def layer(self):
- return self.bClip.get_layer().ui
+ return self.ges_clip.get_layer().ui
def __dragDropCb(self, unused_widget, context, x, y, timestamp):
success = False
@@ -730,11 +725,11 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
if target.name() == ui.EFFECT_TARGET_ENTRY.target:
self.info("Adding effect %s", self.timeline.dropData)
- self.app.gui.clipconfig.effect_expander.addEffectToClip(self.bClip,
+ self.app.gui.clipconfig.effect_expander.addEffectToClip(self.ges_clip,
self.timeline.dropData)
self.timeline.resetSelectionGroup()
- self.timeline.selection.setSelection([self.bClip], timelineUtils.SELECT)
- self.app.gui.switchContextTab(self.bClip)
+ self.timeline.selection.setSelection([self.ges_clip], timelineUtils.SELECT)
+ self.app.gui.switchContextTab(self.ges_clip)
self.timeline.cleanDropData()
success = True
@@ -748,8 +743,8 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
y = 0
height = parent_height
- has_video = self.bClip.find_track_elements(None, GES.TrackType.VIDEO, GObject.TYPE_NONE)
- has_audio = self.bClip.find_track_elements(None, GES.TrackType.AUDIO, GObject.TYPE_NONE)
+ has_video = self.ges_clip.find_track_elements(None, GES.TrackType.VIDEO, GObject.TYPE_NONE)
+ has_audio = self.ges_clip.find_track_elements(None, GES.TrackType.AUDIO, GObject.TYPE_NONE)
if not has_video or not has_audio:
if self.layer and self.layer.media_types == (GES.TrackType.AUDIO | GES.TrackType.VIDEO):
height = parent_height / 2
@@ -764,8 +759,8 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
if not parent or not self.layer:
return
- start = self.bClip.props.start
- duration = self.bClip.props.duration
+ start = self.ges_clip.props.start
+ duration = self.ges_clip.props.duration
x = self.nsToPixel(start)
# The calculation of the width assumes that the start is always
# int(pixels_float). In that case, the rounding can add up and a pixel
@@ -846,22 +841,22 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
if not self.get_state_flags() & Gtk.StateFlags.SELECTED:
mode = timelineUtils.SELECT_ADD
self.timeline.current_group.add(
- self.bClip.get_toplevel_parent())
+ self.ges_clip.get_toplevel_parent())
else:
self.timeline.current_group.remove(
- self.bClip.get_toplevel_parent())
+ self.ges_clip.get_toplevel_parent())
mode = timelineUtils.UNSELECT
elif not self.get_state_flags() & Gtk.StateFlags.SELECTED:
self.timeline.resetSelectionGroup()
self.timeline.current_group.add(
- self.bClip.get_toplevel_parent())
- self.app.gui.switchContextTab(self.bClip)
+ self.ges_clip.get_toplevel_parent())
+ self.app.gui.switchContextTab(self.ges_clip)
else:
self.timeline.resetSelectionGroup()
- parent = self.bClip.get_parent()
+ parent = self.ges_clip.get_parent()
if parent == self.timeline.current_group or parent is None:
- selection = [self.bClip]
+ selection = [self.ges_clip]
else:
while True:
grandparent = parent.get_parent()
@@ -878,14 +873,14 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
return False
def release(self):
- for child in self.bClip.get_children(True):
+ for child in self.ges_clip.get_children(True):
self.__disconnectFromChild(child)
- misc.disconnectAllByFunc(self.bClip, self._startChangedCb)
- misc.disconnectAllByFunc(self.bClip, self._durationChangedCb)
- misc.disconnectAllByFunc(self.bClip, self._layerChangedCb)
- misc.disconnectAllByFunc(self.bClip, self._childAddedCb)
- misc.disconnectAllByFunc(self.bClip, self._childRemovedCb)
+ misc.disconnectAllByFunc(self.ges_clip, self._startChangedCb)
+ misc.disconnectAllByFunc(self.ges_clip, self._durationChangedCb)
+ misc.disconnectAllByFunc(self.ges_clip, self._layerChangedCb)
+ misc.disconnectAllByFunc(self.ges_clip, self._childAddedCb)
+ misc.disconnectAllByFunc(self.ges_clip, self._childRemovedCb)
def __showHandles(self):
for handle in self.handles:
@@ -916,7 +911,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
def _durationChangedCb(self, unused_clip, unused_pspec):
self.updatePosition()
- def _layerChangedCb(self, bClip, unused_pspec):
+ def _layerChangedCb(self, ges_clip, unused_pspec):
self.updatePosition()
def __disconnectFromChild(self, child):
@@ -958,8 +953,8 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
class SourceClip(Clip):
__gtype_name__ = "PitiviSourceClip"
- def __init__(self, layer, bClip):
- super(SourceClip, self).__init__(layer, bClip)
+ def __init__(self, layer, ges_clip):
+ super(SourceClip, self).__init__(layer, ges_clip)
def _setupWidget(self):
self._addTrimHandles()
@@ -975,15 +970,15 @@ class SourceClip(Clip):
class UriClip(SourceClip):
__gtype_name__ = "PitiviUriClip"
- def __init__(self, layer, bClip):
- super(UriClip, self).__init__(layer, bClip)
+ def __init__(self, layer, ges_clip):
+ super(UriClip, self).__init__(layer, ges_clip)
self.props.has_tooltip = True
- self.set_tooltip_markup(misc.filename_from_uri(bClip.get_uri()))
+ self.set_tooltip_markup(misc.filename_from_uri(ges_clip.get_uri()))
def do_query_tooltip(self, x, y, keyboard_mode, tooltip):
tooltip.set_markup(misc.filename_from_uri(
- self.bClip.get_asset().props.id))
+ self.ges_clip.get_asset().props.id))
return True
@@ -1021,10 +1016,10 @@ class TransitionClip(Clip):
__gtype_name__ = "PitiviTransitionClip"
- def __init__(self, layer, bClip):
+ def __init__(self, layer, ges_clip):
self.__has_video = False
- super(TransitionClip, self).__init__(layer, bClip)
+ super(TransitionClip, self).__init__(layer, ges_clip)
if self.__has_video:
self.z_order = 1
@@ -1040,7 +1035,7 @@ class TransitionClip(Clip):
def do_query_tooltip(self, x, y, keyboard_mode, tooltip):
if self.__has_video:
- markup = str(self.bClip.props.vtype.value_nick)
+ markup = str(self.ges_clip.props.vtype.value_nick)
else:
markup = _("Audio crossfade")
tooltip.set_text(markup)
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 84d5f3f..99c4067 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -114,7 +114,7 @@ class LayerControls(Gtk.EventBox, Loggable):
Loggable.__init__(self)
self.bLayer = bLayer
- self.bTimeline = self.bLayer.get_timeline()
+ self.ges_timeline = self.bLayer.get_timeline()
self.app = app
self.props.width_request = ui.CONTROL_WIDTH
@@ -173,8 +173,8 @@ class LayerControls(Gtk.EventBox, Loggable):
vbox.pack_start(self.after_sep, False, False, 0)
self.bLayer.connect("notify::priority", self.__layerPriorityChangedCb)
- self.bTimeline.connect("layer-added", self.__timelineLayerAddedCb)
- self.bTimeline.connect("layer-removed", self.__timelineLayerRemovedCb)
+ self.ges_timeline.connect("layer-added", self.__timelineLayerAddedCb)
+ self.ges_timeline.connect("layer-removed", self.__timelineLayerRemovedCb)
self.__updateActions()
# When the window property is set, specify the mouse cursor.
@@ -186,8 +186,8 @@ class LayerControls(Gtk.EventBox, Loggable):
def __del__(self):
self.name_entry.disconnect_by_func(self.__nameChangedCb)
self.bLayer.disconnect_by_func(self.__layerPriorityChangedCb)
- self.bTimeline.disconnect_by_func(self.__timelineLayerAddedCb)
- self.bTimeline.disconnect_by_func(self.__timelineLayerRemovedCb)
+ self.ges_timeline.disconnect_by_func(self.__timelineLayerAddedCb)
+ self.ges_timeline.disconnect_by_func(self.__timelineLayerRemovedCb)
super(LayerControls, self).__del__()
def __nameChangedCb(self, unused_widget, unused_event):
@@ -209,7 +209,7 @@ class LayerControls(Gtk.EventBox, Loggable):
first = priority == 0
self.__move_layer_up_action.props.enabled = not first
self.__move_layer_top_action.props.enabled = not first
- layers_count = len(self.bTimeline.get_layers())
+ layers_count = len(self.ges_timeline.get_layers())
last = priority == layers_count - 1
self.__move_layer_down_action.props.enabled = not last
self.__move_layer_bottom_action.props.enabled = not last
@@ -256,8 +256,8 @@ class LayerControls(Gtk.EventBox, Loggable):
def _deleteLayerCb(self, unused_action, unused_parametter):
self.app.action_log.begin("delete layer")
- self.bTimeline.remove_layer(self.bLayer)
- self.bTimeline.get_asset().pipeline.commit_timeline()
+ self.ges_timeline.remove_layer(self.bLayer)
+ self.ges_timeline.get_asset().pipeline.commit_timeline()
self.app.action_log.commit()
def _moveLayerCb(self, unused_simple_action, unused_parametter, step):
@@ -267,8 +267,8 @@ class LayerControls(Gtk.EventBox, Loggable):
elif step == -2:
index = 0
else:
- index = len(self.bTimeline.get_layers()) - 1
- self.bTimeline.ui.moveLayer(self.bLayer, index)
+ index = len(self.ges_timeline.get_layers()) - 1
+ self.ges_timeline.ui.moveLayer(self.bLayer, index)
self.app.project_manager.current_project.pipeline.commit_timeline()
def update(self, media_types):
@@ -336,9 +336,9 @@ class LayerLayout(Gtk.Layout, Loggable):
self._changed = False
self.props.width = max(self.timeline.layout.get_allocation().width,
- timelineUtils.Zoomable.nsToPixel(self.timeline.bTimeline.props.duration))
+ timelineUtils.Zoomable.nsToPixel(self.timeline.ges_timeline.props.duration))
self.props.width_request = max(self.timeline.layout.get_allocation().width,
-
timelineUtils.Zoomable.nsToPixel(self.timeline.bTimeline.props.duration))
+
timelineUtils.Zoomable.nsToPixel(self.timeline.ges_timeline.props.duration))
for child in self._children:
self.propagate_draw(child, cr)
@@ -415,9 +415,9 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
return
old_media_types = self.media_types
self.media_types = GES.TrackType(0)
- bClips = self.bLayer.get_clips()
- for bClip in bClips:
- for child in bClip.get_children(False):
+ ges_clips = self.bLayer.get_clips()
+ for ges_clip in ges_clips:
+ for child in ges_clip.get_children(False):
track = child.get_track()
if not track:
continue
@@ -446,59 +446,59 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
def move(self, child, x, y):
self._layout.move(child, x, y)
- def _childAddedToClipCb(self, bClip, child):
+ def _childAddedToClipCb(self, ges_clip, child):
self.checkMediaTypes()
- def _childRemovedFromClipCb(self, bClip, child):
+ def _childRemovedFromClipCb(self, ges_clip, child):
self.checkMediaTypes()
- def _clipAddedCb(self, layer, bClip):
- self._addClip(bClip)
+ def _clipAddedCb(self, layer, ges_clip):
+ self._addClip(ges_clip)
- def _addClip(self, bClip):
- ui_type = elements.GES_TYPE_UI_TYPE.get(bClip.__gtype__, None)
+ def _addClip(self, ges_clip):
+ ui_type = elements.GES_TYPE_UI_TYPE.get(ges_clip.__gtype__, None)
if ui_type is None:
- self.error("Implement UI for type %s?", bClip.__gtype__)
+ self.error("Implement UI for type %s?", ges_clip.__gtype__)
return
- clip = ui_type(self, bClip)
+ clip = ui_type(self, ges_clip)
- self._layout.put(clip, self.nsToPixel(bClip.props.start), 0)
+ self._layout.put(clip, self.nsToPixel(ges_clip.props.start), 0)
self.show_all()
- bClip.connect_after("child-added", self._childAddedToClipCb)
- bClip.connect_after("child-removed", self._childRemovedFromClipCb)
+ ges_clip.connect_after("child-added", self._childAddedToClipCb)
+ ges_clip.connect_after("child-removed", self._childRemovedFromClipCb)
self.checkMediaTypes()
- def _clipRemovedCb(self, bLayer, bClip):
- self._removeClip(bClip)
+ def _clipRemovedCb(self, bLayer, ges_clip):
+ self._removeClip(ges_clip)
- def _removeClip(self, bClip):
- if not bClip.ui:
+ def _removeClip(self, ges_clip):
+ if not ges_clip.ui:
return
- ui_type = elements.GES_TYPE_UI_TYPE.get(bClip.__gtype__, None)
+ ui_type = elements.GES_TYPE_UI_TYPE.get(ges_clip.__gtype__, None)
if ui_type is None:
- self.error("Implement UI for type %s?", bClip.__gtype__)
+ self.error("Implement UI for type %s?", ges_clip.__gtype__)
return
- bClip.ui.release()
- self._layout.remove(bClip.ui)
- self.timeline.selection.unselect([bClip])
+ ges_clip.ui.release()
+ self._layout.remove(ges_clip.ui)
+ self.timeline.selection.unselect([ges_clip])
def __childWidgetRemovedCb(self, layout, clip):
- bClip = clip.bClip
+ ges_clip = clip.ges_clip
if self.timeline.draggingElement is None:
- bClip.ui.release()
- bClip.ui = None
+ ges_clip.ui.release()
+ ges_clip.ui = None
- bClip.disconnect_by_func(self._childAddedToClipCb)
- bClip.disconnect_by_func(self._childRemovedFromClipCb)
+ ges_clip.disconnect_by_func(self._childAddedToClipCb)
+ ges_clip.disconnect_by_func(self._childRemovedFromClipCb)
self.checkMediaTypes()
def updatePosition(self):
- for bClip in self.bLayer.get_clips():
- if hasattr(bClip, "ui"):
- bClip.ui.updatePosition()
+ for ges_clip in self.bLayer.get_clips():
+ if hasattr(ges_clip, "ui"):
+ ges_clip.ui.updatePosition()
def do_draw(self, cr):
Gtk.Box.do_draw(self, cr)
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index b03d4e7..ca8b8cf 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -75,12 +75,6 @@ PREVIEW_GENERATOR_SIGNALS = {
THUMB_HEIGHT = EXPANDED_SIZE - 2 * THUMB_MARGIN_PX
-"""
-Convention throughout this file:
-Every GES element which name could be mistaken with a UI element
-is prefixed with a little b, example : bTimeline
-"""
-
class PreviewerBin(Gst.Bin, Loggable):
"""
@@ -398,21 +392,21 @@ class VideoPreviewer(Previewer, Zoomable, Loggable):
# are ignored.
__gsignals__ = PREVIEW_GENERATOR_SIGNALS
- def __init__(self, bElement):
+ def __init__(self, ges_elem):
"""
- @param bElement : the backend GES.TrackElement
- @param track : the track to which the bElement belongs
+ @param ges_elem : the backend GES.TrackElement
+ @param track : the track to which the ges_elem belongs
"""
Previewer.__init__(self, GES.TrackType.VIDEO)
Zoomable.__init__(self)
Loggable.__init__(self)
# Variables related to the timeline objects
- self.timeline = bElement.get_parent().get_timeline().ui
- self.bElement = bElement
+ self.timeline = ges_elem.get_parent().get_timeline().ui
+ self.ges_elem = ges_elem
# Guard against malformed URIs
- self.uri = quote_uri(get_proxy_target(bElement).props.id)
+ self.uri = quote_uri(get_proxy_target(ges_elem).props.id)
# Variables related to thumbnailing
self.wishlist = []
@@ -434,7 +428,7 @@ class VideoPreviewer(Previewer, Zoomable, Loggable):
self.interval = 500 # Every 0.5 second, reevaluate the situation
# Connect signals and fire things up
- self.bElement.connect("notify::in-point", self._inpointChangedCb)
+ self.ges_elem.connect("notify::in-point", self._inpointChangedCb)
self.pipeline = None
self.gdkpixbufsink = None
@@ -526,24 +520,24 @@ class VideoPreviewer(Previewer, Zoomable, Loggable):
# started this job.
return
- # self.props.width_request =
self.nsToPixel(self.bElement.get_asset().get_filesource_asset().props.duration)
- # self.props.width = self.nsToPixel(self.bElement.get_asset().get_filesource_asset().props.duration)
+ # self.props.width_request =
self.nsToPixel(self.ges_elem.get_asset().get_filesource_asset().props.duration)
+ # self.props.width = self.nsToPixel(self.ges_elem.get_asset().get_filesource_asset().props.duration)
self.debug(
'Now generating thumbnails for: %s', filename_from_uri(self.uri))
query_success, duration = self.pipeline.query_duration(Gst.Format.TIME)
if not query_success or duration == -1:
self.debug("Could not determine duration of: %s", self.uri)
- duration = self.bElement.props.duration
+ duration = self.ges_elem.props.duration
self.queue = list(range(0, duration, self.thumb_period))
self._checkCPU()
- if self.bElement.props.in_point != 0:
+ if self.ges_elem.props.in_point != 0:
adj = self.get_hadjustment()
adj.props.page_size = 1.0
- adj.props.value = Zoomable.nsToPixel(self.bElement.props.in_point)
+ adj.props.value = Zoomable.nsToPixel(self.ges_elem.props.in_point)
# self._addVisibleThumbnails()
# Save periodically to avoid the common situation where the user exits
@@ -618,13 +612,13 @@ class VideoPreviewer(Previewer, Zoomable, Loggable):
thumb_duration = self._get_thumb_duration()
- element_left = self.pixelToNs(rect.x) + self.bElement.props.in_point
+ element_left = self.pixelToNs(rect.x) + self.ges_elem.props.in_point
element_right = element_left + self.pixelToNs(rect.width)
element_left = quantize(element_left, thumb_duration)
for current_time in range(element_left, element_right, thumb_duration):
thumb = Thumbnail(self.thumb_width, self.thumb_height)
- x = Zoomable.nsToPixel(current_time) - self.nsToPixel(self.bElement.props.in_point)
+ x = Zoomable.nsToPixel(current_time) - self.nsToPixel(self.ges_elem.props.in_point)
y = (self.props.height_request - self.thumb_height) / 2
self.put(thumb, x, y)
@@ -704,7 +698,7 @@ class VideoPreviewer(Previewer, Zoomable, Loggable):
def _inpointChangedCb(self, unused_b_element, unused_value):
self.get_hadjustment().set_value(Zoomable.nsToPixel(
- self.bElement.props.in_point))
+ self.ges_elem.props.in_point))
def setSelected(self, selected):
if selected:
@@ -1019,7 +1013,7 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
__gsignals__ = PREVIEW_GENERATOR_SIGNALS
- def __init__(self, bElement):
+ def __init__(self, ges_elem):
Previewer.__init__(self, GES.TrackType.AUDIO)
Zoomable.__init__(self)
Loggable.__init__(self)
@@ -1028,10 +1022,10 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
self._wavebin = None
self.discovered = False
- self.bElement = bElement
- self.timeline = bElement.get_parent().get_timeline().ui
+ self.ges_elem = ges_elem
+ self.timeline = ges_elem.get_parent().get_timeline().ui
- asset = self.bElement.get_parent().get_asset()
+ asset = self.ges_elem.get_parent().get_asset()
self.n_samples = asset.get_duration() / SAMPLE_DURATION
self.samples = None
self.peaks = None
@@ -1041,7 +1035,7 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
# Guard against malformed URIs
self.wavefile = None
- self._uri = quote_uri(get_proxy_target(bElement).props.id)
+ self._uri = quote_uri(get_proxy_target(ges_elem).props.id)
self._num_failures = 0
self.adapter = None
@@ -1049,7 +1043,7 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
self._force_redraw = True
- self.bElement.connect("notify::in-point", self._inpointChangedCb)
+ self.ges_elem.connect("notify::in-point", self._inpointChangedCb)
def _inpointChangedCb(self, unused_b_element, unused_value):
self._force_redraw = True
@@ -1082,7 +1076,7 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
faked = self.pipeline.get_by_name("faked")
faked.props.sync = True
self._wavebin = self.pipeline.get_by_name("wave")
- asset = self.bElement.get_parent().get_asset()
+ asset = self.ges_elem.get_parent().get_asset()
self._wavebin.props.uri = asset.get_id()
self._wavebin.props.duration = asset.get_duration()
decode = self.pipeline.get_by_name("decode")
@@ -1090,7 +1084,7 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
bus = self.pipeline.get_bus()
bus.add_signal_watch()
- asset = self.bElement.get_parent().get_asset()
+ asset = self.ges_elem.get_parent().get_asset()
self.n_samples = asset.get_duration() / SAMPLE_DURATION
bus.connect("message", self._busMessageCb)
self.becomeControlled()
@@ -1166,9 +1160,9 @@ class AudioPreviewer(Previewer, Zoomable, Loggable):
return False
def _get_num_inpoint_samples(self):
- if self.bElement.props.in_point:
- asset_duration = self.bElement.get_asset().get_filesource_asset().get_duration()
- return int(self.n_samples / (float(asset_duration) / float(self.bElement.props.in_point)))
+ if self.ges_elem.props.in_point:
+ asset_duration = self.ges_elem.get_asset().get_filesource_asset().get_duration()
+ return int(self.n_samples / (float(asset_duration) / float(self.ges_elem.props.in_point)))
return 0
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index ff014e4..2df989b 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -88,12 +88,6 @@ PreferencesDialog.addTogglePreference('leftClickAlsoSeeks',
description=_(
"Whether left-clicking also seeks besides selecting and editing
clips."))
-"""
-Convention throughout this file:
-Every GES element which name could be mistaken with a UI element
-is prefixed with a little b, example : bTimeline
-"""
-
class VerticalBar(Gtk.DrawingArea, Loggable):
"""
@@ -170,7 +164,7 @@ class Marquee(Gtk.Box, Loggable):
res = []
w = self.props.width_request
- for layer in self._timeline.bTimeline.get_layers():
+ for layer in self._timeline.ges_timeline.get_layers():
intersects, unused_rect = layer.ui.get_allocation().intersect(self.get_allocation())
if not intersects:
continue
@@ -227,7 +221,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
self.parent = container
self.app = app
self._project = None
- self.bTimeline = None
+ self.ges_timeline = None
self.props.can_focus = False
@@ -359,39 +353,39 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
"""
Connects to the GES.Timeline holding the project.
"""
- if self.bTimeline is not None:
- self.bTimeline.disconnect_by_func(self._durationChangedCb)
- self.bTimeline.disconnect_by_func(self._layerAddedCb)
- self.bTimeline.disconnect_by_func(self._layerRemovedCb)
- self.bTimeline.disconnect_by_func(self._snapCb)
- self.bTimeline.disconnect_by_func(self._snapEndedCb)
- for bLayer in self.bTimeline.get_layers():
+ if self.ges_timeline is not None:
+ self.ges_timeline.disconnect_by_func(self._durationChangedCb)
+ self.ges_timeline.disconnect_by_func(self._layerAddedCb)
+ self.ges_timeline.disconnect_by_func(self._layerRemovedCb)
+ self.ges_timeline.disconnect_by_func(self._snapCb)
+ self.ges_timeline.disconnect_by_func(self._snapEndedCb)
+ for bLayer in self.ges_timeline.get_layers():
self._removeLayer(bLayer)
- self.bTimeline.ui = None
- self.bTimeline = None
+ self.ges_timeline.ui = None
+ self.ges_timeline = None
self._project = project
if self._project:
self._project.pipeline.connect('position', self._positionCb)
- self.bTimeline = self._project.timeline
+ self.ges_timeline = self._project.timeline
- if self.bTimeline is None:
+ if self.ges_timeline is None:
return
- for bLayer in self.bTimeline.get_layers():
+ for bLayer in self.ges_timeline.get_layers():
self._addLayer(bLayer)
- self.bTimeline.connect("notify::duration", self._durationChangedCb)
- self.bTimeline.connect("layer-added", self._layerAddedCb)
- self.bTimeline.connect("layer-removed", self._layerRemovedCb)
- self.bTimeline.connect("snapping-started", self._snapCb)
- self.bTimeline.connect("snapping-ended", self._snapEndedCb)
- self.bTimeline.ui = self
+ self.ges_timeline.connect("notify::duration", self._durationChangedCb)
+ self.ges_timeline.connect("layer-added", self._layerAddedCb)
+ self.ges_timeline.connect("layer-removed", self._layerRemovedCb)
+ self.ges_timeline.connect("snapping-started", self._snapCb)
+ self.ges_timeline.connect("snapping-ended", self._snapEndedCb)
+ self.ges_timeline.ui = self
self.queue_draw()
- def _durationChangedCb(self, bTimeline, pspec):
+ def _durationChangedCb(self, ges_timeline, pspec):
self.queue_draw()
def scrollToPlayhead(self, align=None, when_not_in_view=False):
@@ -455,13 +449,13 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
return LAYER_HEIGHT, natural_height
def __setLayoutSize(self):
- if self.bTimeline:
+ if self.ges_timeline:
width = self._timelineLengthInPixels()
if self.draggingElement:
width = max(width, self.layout.props.width)
self.__layers_vbox.props.width_request = width
- self.layout.set_size(width, len(self.bTimeline.get_layers()) * 200)
+ self.layout.set_size(width, len(self.ges_timeline.get_layers()) * 200)
def do_size_allocate(self, request):
self.__setLayoutSize()
@@ -495,11 +489,11 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
# util methods #
# ------------- #
def _timelineLengthInPixels(self):
- if self.bTimeline is None:
+ if self.ges_timeline is None:
return 100
space_at_the_end = self.layout.get_allocation().width * 2 / 3
- return self.nsToPixel(self.bTimeline.props.duration) + space_at_the_end
+ return self.nsToPixel(self.ges_timeline.props.duration) + space_at_the_end
def _getParentOfType(self, widget, _type):
"""
@@ -748,19 +742,19 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
self.debug("Creating %s at %s", asset.props.id, Gst.TIME_ARGS(placement))
self.app.action_log.begin("add clip")
- bClip = bLayer.add_asset(asset,
+ ges_clip = bLayer.add_asset(asset,
placement,
0,
clip_duration,
asset.get_supported_formats())
placement += clip_duration
- self.current_group.add(bClip.get_toplevel_parent())
+ self.current_group.add(ges_clip.get_toplevel_parent())
self.selection.setSelection([], SELECT_ADD)
self.app.action_log.commit()
self._project.pipeline.commit_timeline()
if not self.draggingElement:
- self.draggingElement = bClip.ui
+ self.draggingElement = ges_clip.ui
self._on_layer = bLayer
self._createdClips = True
@@ -864,7 +858,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
self._addLayer(bLayer)
def moveLayer(self, bLayer, index):
- layers = self.bTimeline.get_layers()
+ layers = self.ges_timeline.get_layers()
layer = layers.pop(bLayer.get_priority())
layers.insert(index, layer)
@@ -896,7 +890,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
bLayer.connect("notify::priority", self.__layerPriorityChangedCb)
def _removeLayerCb(self, layer):
- self.bTimeline.remove_layer(layer.bLayer)
+ self.ges_timeline.remove_layer(layer.bLayer)
def __layerPriorityChangedCb(self, bLayer, pspec):
self.__resetLayersByPriority()
@@ -929,7 +923,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
self.__resetLayersByPriority(True)
- def _layerRemovedCb(self, unused_bTimeline, bLayer):
+ def _layerRemovedCb(self, unused_ges_timeline, bLayer):
self._removeLayer(bLayer)
# Interface Zoomable
@@ -959,7 +953,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
def _getLayerAt(self, y, prefer_bLayer=None, past_middle_when_adjacent=False):
""" Used in the testsuite """
- bLayers = self.bTimeline.get_layers()
+ bLayers = self.ges_timeline.get_layers()
if y < 20:
# The cursor is at the top, above the first layer.
self.debug("Returning very first layer")
@@ -1033,8 +1027,8 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
edit_mode = GES.EditMode.EDIT_NORMAL
dragging_edge = GES.Edge.EDGE_NONE
- self.editing_context = EditingContext(self.draggingElement.bClip,
- self.bTimeline,
+ self.editing_context = EditingContext(self.draggingElement.ges_clip,
+ self.ges_timeline,
edit_mode,
dragging_edge,
None,
@@ -1069,9 +1063,9 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
def createLayer(self, priority):
new_bLayer = GES.Layer.new()
new_bLayer.props.priority = priority
- self.bTimeline.add_layer(new_bLayer)
+ self.ges_timeline.add_layer(new_bLayer)
- bLayers = self.bTimeline.get_layers()
+ bLayers = self.ges_timeline.get_layers()
if priority < len(bLayers):
for bLayer in bLayers:
if bLayer == new_bLayer:
@@ -1106,7 +1100,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
priority = self._on_layer.props.priority + 1
self.createLayer(max(0, priority))
- return self.bTimeline.get_layers()[priority]
+ return self.ges_timeline.get_layers()[priority]
def dragEnd(self):
if self.editing_context:
@@ -1126,7 +1120,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
self.editing_context = None
self.hideSnapBar()
- for layer in self.bTimeline.get_layers():
+ for layer in self.ges_timeline.get_layers():
layer.ui.checkMediaTypes()
self._setSeparatorsPrelight(False)
@@ -1162,7 +1156,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self._projectmanager = None
self._project = None
- self.bTimeline = None
+ self.ges_timeline = None
self.__copiedGroup = None
self._createUi()
@@ -1188,7 +1182,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
proxy_uri)
return
- layers = self.bTimeline.get_layers()
+ layers = self.ges_timeline.get_layers()
for layer in layers:
for clip in layer.get_clips():
if unproxy:
@@ -1214,8 +1208,8 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self._insertClipsAndAssets(clips, position, layer)
def _insertClipsAndAssets(self, objs, position, layer):
- if self.bTimeline is None:
- raise TimelineError("No bTimeline set, this is a bug")
+ if self.ges_timeline is None:
+ raise TimelineError("No ges_timeline set, this is a bug")
# We need to snapshot this value, because we only do the zoom fit at the
# end of clip insertion, but inserting multiple clips eventually changes
@@ -1259,12 +1253,12 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
if position is None:
return self._project.pipeline.getPosition()
if position < 0:
- return self.bTimeline.props.duration
+ return self.ges_timeline.props.duration
return position
def purgeAsset(self, asset_id):
"""Remove all instances of an asset from the timeline."""
- layers = self.bTimeline.get_layers()
+ layers = self.ges_timeline.get_layers()
for layer in layers:
for clip in layer.get_clips():
if asset_id == clip.get_id():
@@ -1301,9 +1295,9 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
if self._project:
self._project.connect("rendering-settings-changed",
self._renderingSettingsChangedCb)
- self.bTimeline = project.timeline
+ self.ges_timeline = project.timeline
else:
- self.bTimeline = None
+ self.ges_timeline = None
self.timeline.setProject(self._project)
self.timeline.selection.connect(
@@ -1391,11 +1385,11 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
@rtype: list of GES.Layer
"""
- layers = self.bTimeline.get_layers()
+ layers = self.ges_timeline.get_layers()
if not layers:
layer = GES.Layer()
layer.props.auto_transition = True
- self.bTimeline.add_layer(layer)
+ self.ges_timeline.add_layer(layer)
return [layer]
return layers
@@ -1500,7 +1494,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
Set the zoom level so that the entire timeline is in view.
"""
ruler_width = self.ruler.get_allocation().width
- duration = 0 if not self.bTimeline else self.bTimeline.get_duration()
+ duration = 0 if not self.ges_timeline else self.ges_timeline.get_duration()
if not duration:
return
@@ -1524,7 +1518,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
return
Zoomable.setZoomLevel(nearest_zoom_level)
- self.bTimeline.set_snapping_distance(
+ self.ges_timeline.set_snapping_distance(
Zoomable.pixelToNs(self._settings.edgeSnapDeadband))
# Only do this at the very end, after updating the other widgets.
@@ -1567,7 +1561,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
return False
def _deleteSelected(self, unused_action, unused_parameter):
- if self.bTimeline:
+ if self.ges_timeline:
self.app.action_log.begin("delete clip")
for clip in self.timeline.selection:
@@ -1582,8 +1576,8 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self.timeline.selection.setSelection([], SELECT)
def _ungroupSelected(self, unused_action, unused_parameter):
- if not self.bTimeline:
- self.info("No bTimeline set yet!")
+ if not self.ges_timeline:
+ self.info("No ges_timeline set yet!")
return
self.app.action_log.begin("ungroup")
@@ -1601,7 +1595,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self._project.pipeline.commit_timeline()
def _groupSelected(self, unused_action, unused_parameter):
- if not self.bTimeline:
+ if not self.ges_timeline:
self.info("No timeline set yet?")
return
@@ -1642,7 +1636,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self._project.pipeline.commit_timeline()
def _alignSelectedCb(self, unused_action, unused_parameter):
- if not self.bTimeline:
+ if not self.ges_timeline:
self.error(
"Trying to use the autoalign feature with an empty timeline")
return
@@ -1680,7 +1674,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
splitting_selection = clips is not None
if clips is None:
clips = []
- for layer in self.timeline.bTimeline.get_layers():
+ for layer in self.timeline.ges_timeline.get_layers():
clips.extend(layer.get_clips())
position = self._project.pipeline.getPosition()
@@ -1738,9 +1732,9 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
# Zoomable
def zoomChanged(self):
- if self.bTimeline:
+ if self.ges_timeline:
# zoomChanged might be called various times before the UI is ready
- self.bTimeline.set_snapping_distance(
+ self.ges_timeline.set_snapping_distance(
Zoomable.pixelToNs(self._settings.edgeSnapDeadband))
self.zoomed_fitted = False
@@ -1813,8 +1807,8 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
project.update_restriction_caps()
def _snapDistanceChangedCb(self, unused_settings):
- if self.bTimeline:
- self.bTimeline.set_snapping_distance(
+ if self.ges_timeline:
+ self.ges_timeline.set_snapping_distance(
Zoomable.pixelToNs(self._settings.edgeSnapDeadband))
def _projectChangedCb(self, unused_app, project, unused_fully_loaded):
@@ -1830,8 +1824,8 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self._renderingSettingsChangedCb(self._project, None, None)
self._setBestZoomRatio()
- if self.bTimeline:
- self.bTimeline.set_snapping_distance(
+ if self.ges_timeline:
+ self.ges_timeline.set_snapping_distance(
Zoomable.pixelToNs(self._settings.edgeSnapDeadband))
def _projectCreatedCb(self, unused_app, project):
diff --git a/tests/common.py b/tests/common.py
index 549bcac..00c6d9a 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -129,21 +129,21 @@ class TestCase(unittest.TestCase, Loggable):
self._result = result
unittest.TestCase.run(self, result)
- def toggleClipSelection(self, bClip, expect_selected):
+ def toggleClipSelection(self, ges_clip, expect_selected):
'''
- Toggle selection state of @bClip.
+ Toggle selection state of @ges_clip.
'''
- selected = bool(bClip.ui.get_state_flags() & Gtk.StateFlags.SELECTED)
- self.assertEqual(bClip.selected.selected, selected)
+ selected = bool(ges_clip.ui.get_state_flags() & Gtk.StateFlags.SELECTED)
+ self.assertEqual(ges_clip.selected.selected, selected)
- bClip.ui.sendFakeEvent(
- Event(Gdk.EventType.BUTTON_PRESS, button=1), bClip.ui)
- bClip.ui.sendFakeEvent(
- Event(Gdk.EventType.BUTTON_RELEASE, button=1), bClip.ui)
+ ges_clip.ui.sendFakeEvent(
+ Event(Gdk.EventType.BUTTON_PRESS, button=1), ges_clip.ui)
+ ges_clip.ui.sendFakeEvent(
+ Event(Gdk.EventType.BUTTON_RELEASE, button=1), ges_clip.ui)
- self.assertEqual(bool(bClip.ui.get_state_flags() & Gtk.StateFlags.SELECTED),
+ self.assertEqual(bool(ges_clip.ui.get_state_flags() & Gtk.StateFlags.SELECTED),
expect_selected)
- self.assertEqual(bClip.selected.selected, expect_selected)
+ self.assertEqual(ges_clip.selected.selected, expect_selected)
def createTempProject(self):
"""
diff --git a/tests/test_timeline_timeline.py b/tests/test_timeline_timeline.py
index b1383e6..99b6b38 100644
--- a/tests/test_timeline_timeline.py
+++ b/tests/test_timeline_timeline.py
@@ -53,7 +53,7 @@ class BaseTestTimeline(common.TestCase):
return timeline
def addClipsSimple(self, timeline, num_clips):
- layer = timeline.bTimeline.append_layer()
+ layer = timeline.ges_timeline.append_layer()
asset = GES.UriClipAsset.request_sync(
common.getSampleUri("tears_of_steel.webm"))
@@ -207,7 +207,7 @@ class TestGrouping(BaseTestTimeline):
def testGroupSelection(self):
num_clips = 2
timeline = self.groupClips(num_clips)
- layer = timeline.bTimeline.get_layers()[0]
+ layer = timeline.ges_timeline.get_layers()[0]
clips = layer.get_clips()
self.assertEqual(len(clips), num_clips)
@@ -226,7 +226,7 @@ class TestGrouping(BaseTestTimeline):
self.assertEqual(len(timeline.selection.selected), num_clips)
timeline.parent.ungroup_action.emit("activate", None)
- layer = timeline.bTimeline.get_layers()[0]
+ layer = timeline.ges_timeline.get_layers()[0]
clips = layer.get_clips()
self.assertEqual(len(clips), num_clips)
@@ -240,8 +240,8 @@ class TestGrouping(BaseTestTimeline):
clips = self.addClipsSimple(timeline, 1)
self.toggleClipSelection(clips[0], expect_selected=True)
- timeline.bTimeline.get_asset().pipeline.getPosition = mock.Mock(return_value=position)
- layer = timeline.bTimeline.get_layers()[0]
+ timeline.ges_timeline.get_asset().pipeline.getPosition = mock.Mock(return_value=position)
+ layer = timeline.ges_timeline.get_layers()[0]
# Split
timeline.parent.split_action.emit("activate", None)
@@ -269,30 +269,30 @@ class TestGrouping(BaseTestTimeline):
def testUngroupClip(self):
timeline = self.createTimeline()
- bClip, = self.addClipsSimple(timeline, 1)
+ ges_clip, = self.addClipsSimple(timeline, 1)
- self.toggleClipSelection(bClip, expect_selected=True)
+ self.toggleClipSelection(ges_clip, expect_selected=True)
timeline.parent.ungroup_action.emit("activate", None)
- layer = timeline.bTimeline.get_layers()[0]
- bClip0, bClip1 = layer.get_clips()
+ layer = timeline.ges_timeline.get_layers()[0]
+ ges_clip0, ges_clip1 = layer.get_clips()
- self.assertEqual(bClip0.props.start, bClip1.props.start)
- self.assertEqual(bClip0.props.duration, bClip1.props.duration)
+ self.assertEqual(ges_clip0.props.start, ges_clip1.props.start)
+ self.assertEqual(ges_clip0.props.duration, ges_clip1.props.duration)
- bTrackElem0, = bClip0.get_children(recursive=False)
- bTrackElem1, = bClip1.get_children(recursive=False)
+ bTrackElem0, = ges_clip0.get_children(recursive=False)
+ bTrackElem1, = ges_clip1.get_children(recursive=False)
if bTrackElem0.get_track_type() == GES.TrackType.AUDIO:
- aclip = bClip0.ui
+ aclip = ges_clip0.ui
atrackelem = bTrackElem0.ui
- vclip = bClip1.ui
+ vclip = ges_clip1.ui
vtrackelem = bTrackElem1.ui
else:
- aclip = bClip1.ui
+ aclip = ges_clip1.ui
atrackelem = bTrackElem1.ui
- vclip = bClip0.ui
+ vclip = ges_clip0.ui
vtrackelem = bTrackElem0.ui
self.assertEqual(aclip._audioSource, atrackelem)
@@ -325,9 +325,9 @@ class TestCopyPaste(BaseTestTimeline):
timeline = self.copyClips(2)
- layer = timeline.bTimeline.get_layers()[0]
+ layer = timeline.ges_timeline.get_layers()[0]
# Monkey patching the pipeline.getPosition method
- project = timeline.bTimeline.get_asset()
+ project = timeline.ges_timeline.get_asset()
project.pipeline.getPosition = mock.Mock(return_value=position)
clips = layer.get_clips()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]