[pitivi] effect: Serialize effect related actions
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] effect: Serialize effect related actions
- Date: Sat, 15 Nov 2014 10:33:04 +0000 (UTC)
commit e2adfa2d59c625bffae69d714ab4e113469bb16c
Author: Thibault Saunier <tsaunier gnome org>
Date: Fri Sep 26 18:36:34 2014 +0200
effect: Serialize effect related actions
https://bugzilla.gnome.org/show_bug.cgi?id=739251
pitivi/undo/effect.py | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/undo/effect.py b/pitivi/undo/effect.py
index 3b423d9..5471bf4 100644
--- a/pitivi/undo/effect.py
+++ b/pitivi/undo/effect.py
@@ -22,6 +22,7 @@
# any later version.
from gi.repository import GObject
+from gi.repository import Gst
from pitivi.undo.undo import UndoableAction
from pitivi.effects import PROPS_TO_IGNORE
@@ -44,6 +45,14 @@ class EffectPropertyChanged(UndoableAction):
self.effect.set_child_property(self.property_name, self.old_value)
self._undone()
+ def serializeLastAction(self):
+ st = Gst.Structure.new_empty("set-child-property")
+ st['element-name'] = self.effect.get_name()
+ st['property'] = self.property_name
+ st['value'] = self.new_value
+
+ return st
+
# FIXME We should refactor pitivi.undo.PropertyChangeTracker so we can use it as
# a baseclass here!
@@ -123,6 +132,14 @@ class EffectAdded(UndoableAction):
self.effect = None
self._undone()
+ def serializeLastAction(self):
+ st = Gst.Structure.new_empty("container-add-child")
+ st["container-name"] = self.clip.get_name()
+ st["asset-id"] = self.effect.get_id()
+ st["child-type"] = GObject.type_name(self.effect.get_asset().get_extractable_type())
+
+ return st
+
class EffectRemoved(UndoableAction):
@@ -158,3 +175,10 @@ class EffectRemoved(UndoableAction):
self.clip.get_layer().get_timeline().commit()
self._props_changed = []
self._undone()
+
+ def serializeLastAction(self):
+ st = Gst.Structure.new_empty("container-remove-child")
+ st["container-name"] = self.clip.get_name()
+ st["child-name"] = self.effect.get_name()
+
+ return st
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]