Package elisa :: Package plugins :: Package good :: Package audiocd :: Module cdda_engine
[hide private]
[frames] | no frames]

Source Code for Module elisa.plugins.good.audiocd.cdda_engine

 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  __maintainer__ = 'Benjamin Kampmann <benjamin@fluendo.com>' 
18   
19  from elisa.core.media_uri import MediaUri 
20  from elisa.core import plugin_registry 
21   
22  import gst 
23   
24  PlaybinEngine = plugin_registry.get_component_class('base:playbin_engine') 
25 -class CddaEngine(PlaybinEngine):
26 """ 27 This class implements a player engine for cdda (inheriting from 28 PlaybinEngine) 29 """ 30 31 uri_schemes = {'cdda' : 0} 32
33 - def uri__set(self, uri):
34 if not self._pipeline: 35 self._create_pipeline() 36 self._pipeline.set_state(gst.STATE_READY) 37 states = self._pipeline.get_state(3000 * gst.MSECOND) 38 39 if states[1] == gst.STATE_READY: 40 41 source = self._pipeline.get_property('source') 42 if source: 43 track = uri.host 44 self.debug("Loading track %s" % track) 45 source.set_property('track', track) 46 self.debug("Ready to play track %s" % track) 47 self._current_uri = uri 48 else: 49 PlaybinEngine.uri__set(self, uri)
50