Package elisa :: Package plugins :: Package bad :: Package raval_frontend :: Module transitions
[hide private]
[frames] | no frames]

Source Code for Module elisa.plugins.bad.raval_frontend.transitions

 1  # -*- coding: utf-8 -*- 
 2  # Elisa - Home multimedia server 
 3  # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 
 4  # All rights reserved. 
 5  # 
 6  # This file is available under one of two license agreements. 
 7  # 
 8  # This file is licensed under the GPL version 2. 
 9  # See "LICENSE.GPL" in the root of this distribution including a special 
10  # exception to use Elisa with Fluendo's plugins. 
11  # 
12  # The GPL part of Elisa is also available under a commercial licensing 
13  # agreement from Fluendo. 
14  # See "LICENSE.Elisa" in the root directory of this distribution package 
15  # for details on that license. 
16   
17  from elisa.core import common 
18  from pgm.timing import implicit 
19   
20  plugin_registry = common.application.plugin_registry 
21  PigmentTransition = plugin_registry.get_component_class('pigment:pigment_transition') 
22   
23 -class PlayerOutTransition(PigmentTransition):
24
25 - def apply(self, view, end_callback=None):
26 PigmentTransition.apply(self, view, end_callback=end_callback) 27 canvas = view.frontend.context.viewport_handle.get_canvas() 28 29 params = {"duration": 500, 30 "transformation": implicit.DECELERATE, 31 "end_callback": lambda x: self.stop()} 32 self.implicit.setup_next_animations(**params) 33 34 position = (canvas.width *0.7, canvas.height * 0.7, 20) 35 size = (canvas.width * 0.2, canvas.height * 0.2) 36 37 self.implicit.opacity = 30 38 self.implicit.position = position 39 self.implicit.size = size
40
41 -class PlayerInTransition(PigmentTransition):
42
43 - def apply(self, view, end_callback=None):
44 PigmentTransition.apply(self, view, end_callback=end_callback) 45 canvas = view.frontend.context.viewport_handle.get_canvas() 46 47 params = {"duration": 500, 48 "transformation": implicit.DECELERATE, 49 "end_callback": lambda x: self.stop()} 50 self.implicit.setup_next_animations(**params) 51 52 self.implicit.opacity = 255 53 self.implicit.position = (0, 0, 0) 54 self.implicit.size = (canvas.width, canvas.height)
55 56
57 -class UnfocusTransition(PigmentTransition):
58
59 - def apply(self, view, end_callback=None):
60 PigmentTransition.apply(self, view, end_callback) 61 62 params = {"duration": 500, 63 "transformation": implicit.DECELERATE, 64 "end_callback": lambda x: self.stop()} 65 self.implicit.setup_next_animations(**params) 66 67 self.implicit.opacity = 50
68
69 -class FocusTransition(PigmentTransition):
70
71 - def apply(self, view, end_callback=None):
72 PigmentTransition.apply(self, view, end_callback) 73 74 params = {"duration": 500, 75 "transformation": implicit.DECELERATE, 76 "end_callback": lambda x: self.stop()} 77 self.implicit.setup_next_animations(**params) 78 79 self.implicit.opacity = 255
80