Home | Trees | Indices | Help |
---|
|
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 __maintainer2__ = 'Florian Boucault <florian@fluendo.com>' 20 21 22 from elisa.base_components.action import Action 23 from elisa.core.media_uri import MediaUri 24 from elisa.core import media_uri, player 25 from elisa.core import plugin_registry 26 2729 """ 30 Play mediafile 31 """ 32 33 # FIXME: what is it used for ? 34 label='play' 35 supported_file_types=('audio', 'video') 36 37 # Attribute to set at initialization 38 # MediaURI instance 39 uri = None 40 media_type = None 41 player_model = None 42 erase_playlist = True 436645 """ 46 @raise TypeError: When action has incorrect parameters 47 """ 48 PlayerModelClass = plugin_registry.get_component_class('base:player_model') 49 50 # FIXME: move that to dvd:menu_action 51 DvdModelClass = plugin_registry.get_component_class('dvd:dvd_player_model') 52 53 self.debug("Loading %r in %r", self.uri, self.player_model) 54 55 if isinstance(self.uri, MediaUri) and \ 56 isinstance(self.player_model, (PlayerModelClass, DvdModelClass)): 57 self.player_model.preview_mode = False 58 self.player_model.media_type = self.media_type 59 self.player_model.uri = self.uri 60 self.player_model.state = player.STATES.PLAYING 61 62 if self.erase_playlist and self.player_model.playlist: 63 self.player_model.playlist.activity.empty() 64 else: 65 raise TypeError("action %s have incorrect parameters" % self.name)
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Jan 16 19:10:25 2008 | http://epydoc.sourceforge.net |