Package elisa :: Package base_components :: Module player_engine :: Class PlayerEngine
[hide private]
[frames] | no frames]

Class PlayerEngine

source code


A PlayerEngine provides various media playback related functionalities. It declares the uri schemes it supports and will be automatically instantiated by the elisa.core.player_engine_registry.PlayerEngineRegistry if needed.

Messages listed at elisa.core.player have to be sent by the engine at appropriate times.

Nested Classes [hide private]

Inherited from core.component.Component: __metaclass__

Instance Methods [hide private]
 
__init__(self)
Lazily set name from class name styled with underscores (class ComponentBar -> name component_bar.
source code
 
play(self, trigger_message=True)
Play the media.
source code
 
pause(self, trigger_message=True)
Pause the playback.
source code
 
stop(self, trigger_message=True)
Stop the playback.
source code
 
volume__set(self, volume) source code
 
volume__get(self) source code
 
uri__set(self, uri) source code
 
position__get(self) source code
 
position__set(self, position) source code
 
state__get(self) source code
 
duration__get(self) source code
 
speed__get(self) source code
 
speed_set(self, speed) source code
 
video_sink__get(self) source code
 
video_sink__set(self, sink) source code
 
audio_sink__get(self) source code
 
audio_sink__set(self, sink) source code
 
visualisation__get(self) source code
 
visualisation__set(self, gst_element) source code
 
_send_msg(self, message)
Makes it easier to send a message for the developers...
source code
 
_seek_to_location(self, location)
seek to the given location with self.speed
source code
 
_pipeline_set_state(self, state)
Set the state of the pipeline asynchronisly
source code

Inherited from core.component.Component: clean, initialize, load_config, save_config

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods [hide private]

Inherited from core.component.Component: __classinit__

Class Variables [hide private]
dict uri_schemes = {}
the uri-schemes this engine supports associated with their ranking value between 0 (highest rank) and 255 (lowest rank)
string name = 'player_engine'
Component's name

Inherited from core.component.Component: checked, config_doc, default_config, id, plugin

Inherited from extern.log.log.Loggable: logCategory

Instance Variables [hide private]
gst.Pipeline _pipeline
the internally used pipeline
gst.BaseSink audio_sink
the audiosink of this player engine
float duration
(read-only) the total length of the loaded uri in nanoseconds
instance message_sender
who is the sender of messages (per default it is self)
float position
the position we are currently playing in nanoseconds
float speed
The speed of the current playback:
elisa.core.player.STATES state
(read-only) The current state.
elisa.core.media_uri.Mediauri uri
(write-only) change the engine to be able to play the set uri.
gst.BaseSink video_sink
the videosink of this player engine
gst.Element visualisation
the visualisation element for the player engine
float volume
a value between 0 and 10

Inherited from core.component.Component: config, path

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Lazily set name from class name styled with underscores (class ComponentBar -> name component_bar. Also set log category based on component name, with a 'comp_' prefix.
Overrides: core.component.Component.__init__
(inherited documentation)

play(self, trigger_message=True)

source code 
Play the media. If trigger_message is set to True, this triggers first the message elisa.core.player.PlayerLoading message and if the playback is really starting, it triggers elisa.core.player.PlayerPlaying. Otherwise it does not trigger any messages.
Parameters:
  • trigger_message (bool) - should the player trigger messages here

pause(self, trigger_message=True)

source code 
Pause the playback. If trigger_message is set to True, this triggers the elisa.core.player.PlayerPausing message.
Parameters:
  • trigger_message (bool) - should the player trigger a message here

stop(self, trigger_message=True)

source code 
Stop the playback. If trigger_message is set, this method triggers the elisa.core.player.PlayerStopping message.
Parameters:
  • trigger_message (bool) - should the player trigger a message here

_send_msg(self, message)

source code 
Makes it easier to send a message for the developers...
Parameters:

Instance Variable Details [hide private]

audio_sink

the audiosink of this player engine
Get Method:
elisa.base_components.player_engine.PlayerEngine.audio_sink__get(self)
Set Method:
elisa.base_components.player_engine.PlayerEngine.audio_sink__set(self, sink)
Delete Method:
'frontend'

duration

(read-only) the total length of the loaded uri in nanoseconds
Get Method:
elisa.base_components.player_engine.PlayerEngine.duration__get(self)
Set Method:
'frontend'
Delete Method:
'frontend'

position

the position we are currently playing in nanoseconds
Get Method:
elisa.base_components.player_engine.PlayerEngine.position__get(self)
Set Method:
elisa.base_components.player_engine.PlayerEngine.position__set(self, position)
Delete Method:
'frontend'

speed

The speed of the current playback:
  • Normal playback is 1.0
  • a positive value means forward
  • a negative one backward
  • a value bigger (+/-) 1.0 means faster
  • a value smaller (+/-) 1.0 means slower
  • the value 0.0 (equivalent to pause) is not allowed
Get Method:
elisa.base_components.player_engine.PlayerEngine.speed__get(self)
Set Method:
'frontend'
Delete Method:
'frontend'

state

(read-only) The current state.
Get Method:
elisa.base_components.player_engine.PlayerEngine.state__get(self)
Set Method:
'frontend'
Delete Method:
'frontend'

uri

(write-only) change the engine to be able to play the set uri.
Get Method:
'frontend'
Set Method:
elisa.base_components.player_engine.PlayerEngine.uri__set(self, uri)
Delete Method:
'frontend'

video_sink

the videosink of this player engine
Get Method:
elisa.base_components.player_engine.PlayerEngine.video_sink__get(self)
Set Method:
elisa.base_components.player_engine.PlayerEngine.video_sink__set(self, sink)
Delete Method:
'frontend'

visualisation

the visualisation element for the player engine
Get Method:
elisa.base_components.player_engine.PlayerEngine.visualisation__get(self)
Set Method:
elisa.base_components.player_engine.PlayerEngine.visualisation__set(self, gst_element)
Delete Method:
'frontend'

volume

a value between 0 and 10
Get Method:
elisa.base_components.player_engine.PlayerEngine.volume__get(self)
Set Method:
elisa.base_components.player_engine.PlayerEngine.volume__set(self, volume)
Delete Method:
'frontend'