Home | Trees | Indices | Help |
---|
|
1 # Elisa - Home multimedia server 2 # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 3 # All rights reserved. 4 # 5 # This file is available under one of two license agreements. 6 # 7 # This file is licensed under the GPL version 3. 8 # See "LICENSE.GPL" in the root of this distribution including a special 9 # exception to use Elisa with Fluendo's plugins. 10 # 11 # The GPL part of Elisa is also available under a commercial licensing 12 # agreement from Fluendo. 13 # See "LICENSE.Elisa" in the root directory of this distribution package 14 # for details on that license. 15 16 17 __maintainer__ = 'Lionel Martin <lionel@fluendo.com>' 18 19 from elisa.core.input_event import * 20 from elisa.core import common 21 from elisa.core import player 22 from elisa.core import plugin_registry 23 PlayerControllerClass = plugin_registry.get_component_class('base:player_controller') 24 from elisa.core.bus.bus_message import DeviceAction 25 26 2729 30 supported_models = ('dvd:dvd_player_model',) 31 bindings = {'last_navigation_action': 'last_navigation_action', 32 'in_menu': 'in_menu', 33 # FIXME: inherited from base:player_controller 34 'playlist': 'playlist', 35 'seek_to': 'seek_to', 36 'volume': 'volume', 37 'muted': 'muted', 38 'pause_requested': 'pause_requested', 39 'uri': 'uri'} 40 41 42 last_navigation_action = None 43 #default_config = {} 44 in_menu = False 4510747 PlayerControllerClass.__init__(self) 48 common.application.bus.register(self._got_bus_message, DeviceAction)4951 if message.action == message.ActionType.LOCATION_ADDED and \ 52 message.fstype == 'dvd': 53 #self.model.state = player.STATES.PLAYING 54 #FIXME : Can't do it because I revieve a signal when the dvd is in the reader at elisa starting 55 self.info("start to play dvd automaticly") 56 if message.action == message.ActionType.EJECT and \ 57 message.fstype == 'dvd': 58 self.model.state = player.STATES.STOPPED59 6062 PlayerControllerClass.attribute_set(self, origin, key, old_value, new_value) 63 if key == 'menu_requested': 64 if new_value: 65 self.model.last_navigation_action = EventAction.DVD_MENU6668 if value == True and self.model.state != player.STATES.PLAYING: 69 self.model.state = player.STATES.PLAYING7072 if input_event.action == EventAction.PLAY: 73 self.stopped = False 74 self.model.state = player.STATES.PLAYING 75 76 elif input_event.action == EventAction.PAUSE: 77 self.stopped = False 78 self.model.state = player.STATES.PAUSED 79 80 elif input_event.action == EventAction.STOP: 81 self.stopped = True 82 self.model.state = player.STATES.STOPPED 83 elif input_event.action == EventAction.VOL_UP: 84 if self.model.volume < 10: 85 self.model.volume += self._volume_increment_step 86 87 elif input_event.action == EventAction.VOL_DOWN: 88 if self.model.volume > 0: 89 self.model.volume -= self._volume_decrement_step 90 91 if input_event.action in (EventAction.GO_LEFT, EventAction.GO_RIGHT): 92 self.model.last_navigation_action = input_event.action 93 elif not self.in_menu: 94 PlayerControllerClass.handle_input(self, input_event) 95 elif input_event.action in (EventAction.GO_UP, EventAction.GO_DOWN, 96 EventAction.OK, EventAction.DVD_MENU): 97 #FIXME : temporary code 98 self.model.last_navigation_action = input_event.action 99 100 return False101
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Jan 16 19:10:10 2008 | http://epydoc.sourceforge.net |