summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Fujii Pontello <luciana@fujii.eti.br>2010-06-24 22:22:44 (GMT)
committerLuciana Fujii Pontello <luciana@fujii.eti.br>2010-07-09 22:40:43 (GMT)
commit55be11524fe754f7cab1a1fa759deb70978fcd35 (patch)
treeae28fa1a3c7de220575dd28e1689aee3cf31574a
parent664bcea0f51e6ff88b96b2f1e53e0163195f2cd4 (diff)
downloadsltv-55be11524fe754f7cab1a1fa759deb70978fcd35.tar.gz
sltv-55be11524fe754f7cab1a1fa759deb70978fcd35.tar.xz
watermark: Setting alpha in sltv
-rw-r--r--sltv/sltv.py6
-rw-r--r--sltv/ui/watermark.py4
2 files changed, 10 insertions, 0 deletions
diff --git a/sltv/sltv.py b/sltv/sltv.py
index c2a5d17..fcf07bb 100644
--- a/sltv/sltv.py
+++ b/sltv/sltv.py
@@ -103,6 +103,7 @@ class Sltv(gobject.GObject):
self.pending_state = None
self.watermark_location = None
self.watermark_size = 0.5
+ self.watermark_alpha = None
self.watermark_selected = 0
self.input_type = 0
@@ -141,6 +142,9 @@ class Sltv(gobject.GObject):
def set_watermark_size(self, size):
self.watermark_size = size
+ def set_watermark_alpha(self, alpha):
+ self.watermark_alpha = alpha
+
def set_watermark_position(self, selected):
self.watermark_selected = selected
@@ -148,6 +152,8 @@ class Sltv(gobject.GObject):
if self.watermark_location:
self.watermark.set_property("location", self.watermark_location)
+ if self.watermark_alpha:
+ self.watermark.set_property("image-alpha", self.watermark_alpha)
wm_width = self.watermark_size * video_width
wm_height = self.watermark_size * video_height
diff --git a/sltv/ui/watermark.py b/sltv/ui/watermark.py
index 3a529f2..818f085 100644
--- a/sltv/ui/watermark.py
+++ b/sltv/ui/watermark.py
@@ -50,6 +50,7 @@ class WaterMarkUI:
self.button.connect("file-set", self._on_file_set)
self.size_scale.connect("value-changed", self._on_size_changed)
+ self.alpha_scale.connect("value-changed", self._on_alpha_changed)
self.position_selector.connect("changed", self._on_position_changed)
def _on_file_set(self, button):
@@ -58,6 +59,9 @@ class WaterMarkUI:
def _on_size_changed(self, adjustment):
self.sltv.set_watermark_size(self.size_scale.get_value())
+ def _on_alpha_changed(self, adjustment):
+ self.sltv.set_watermark_alpha(self.alpha_scale.get_value())
+
def _on_position_changed(self, widget, selected):
self.sltv.set_watermark_position(selected)