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

Source Code for Module elisa.plugins.bad.raval_frontend.actions.show_player_action

 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 3. 
 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   
18  __maintainer__ = 'Lionel Martin <lionel@fluendo.com>' 
19   
20  from elisa.base_components.action import Action 
21  from elisa.core import plugin_registry 
22  from elisa.core import player 
23   
24   
25 -class ShowPlayerAction(Action):
26 """ 27 Hide the menu and show the current player (player or slideshow) 28 """ 29 30 # FIXME: what is it used for ? 31 label='show player' 32 supported_file_types=() 33 34 elisa_model = None 35 play_when_visible = False 36 player_model = None 37 38
39 - def __call__(self, controller, origin):
40 """ 41 @raise TypeError: When action has incorrect parameters 42 """ 43 ElisaModelClass = plugin_registry.get_component_class('base:elisa_model') 44 PlayerModelClass = plugin_registry.get_component_class('base:player_model') 45 if isinstance(self.elisa_model, ElisaModelClass): 46 self.elisa_model.menu_visible = False 47 if self.play_when_visible == True and isinstance(self.player_model, PlayerModelClass): 48 self.player_model.state = player.STATES.PLAYING 49 50 else: 51 raise TypeError("action %s have incorrect parameters" % self.name)
52