Package brisa :: Package upnp :: Package control_point :: Module control_point_av :: Class ControlPointAV
[hide private]
[frames] | no frames]

Class ControlPointAV

source code

                object --+    
                         |    
control_point.ControlPoint --+
                             |
                            ControlPointAV

This class extends ControlPoint and add basic AV functionality.

Basic usage is to set a server and/or renderer device with set_current_server() and/or set_current_renderer() to work on, then use the available A/V methods which are listed below.

Media servers:

Media renderer:

Instance Methods [hide private]
 
__init__(self, receive_notify=True)
Constructor for the ControlPointAV class.
source code
 
get_current_server(self)
Returns the current selected server.
source code
 
set_current_server(self, server_device)
Sets the current server.
source code
 
get_current_renderer(self)
Returns the current selected renderer.
source code
 
set_current_renderer(self, renderer_device)
Sets the current renderer.
source code
 
get_cd_service(self)
Returns the Content Directory service from the selected server.
source code
 
get_avt_service(self)
Returns the AV Transport service from the selected renderer.
source code
list
browse(self, object_id, browse_flag, filter, starting_index, requested_count, sort_criteria="dc:title")
Browses media servers.
source code
dict
search(self, container_id, search_criteria, filter, starting_index, requested_count, sort_criteria)
Search items in Media Server.
source code
dict
get_search_capabilites(self)
Return the fields supported by the server for searching.
source code
dict
get_sort_capabilities(self)
Returns a list of fields supported by the server for sorting.
source code
 
av_play(self, id=0, uri='')
Tells the selected media renderer to play an item given its id or media URI.
source code
 
av_stop(self)
Stops the rendering.
source code
 
av_pause(self)
Pauses the rendering.
source code
 
av_next(self)
Requests play on the next track.
source code
 
av_previous(self)
Requests play on the previous track.
source code

Inherited from control_point.ControlPoint: destroy, force_discovery, get_devices, is_msearch_running, is_running, start, start_search, stop, stop_search, subscribe, unsubscribe

Inherited from control_point.ControlPoint (private): _callback, _cleanup, _get_recv_notify, _new_device_event, _new_device_event_impl, _on_event, _removed_device_event, _set_recv_notify

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

Class Variables [hide private]
  CDS_namespace = 'urn:schemas-upnp-org:service:ContentDirectory:1'
  AVT_namespace = 'urn:schemas-upnp-org:service:AVTransport:1'
  DMS_type = 'urn:schemas-upnp-org:device:MediaServer:'
  DMR_type = 'urn:schemas-upnp-org:device:MediaRenderer:'
  msg_invalid_server = 'server_device parameter must be a Device'
  msg_invalid_renderer = 'renderer_device parameter must be a De...
  msg_select_server = 'media server not set. Set it with ' 'set_...
  msg_select_renderer = 'media renderer not set. Set it with ' '...

Inherited from control_point.ControlPoint: msg_already_started, msg_already_stopped, receive_notify

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, receive_notify=True)
(Constructor)

source code 

Constructor for the ControlPointAV class.

Parameters:
  • receive_notify (bool) - if False, disables notify handling. This means it will only listen for MSearch responses.
Overrides: object.__init__

set_current_server(self, server_device)

source code 

Sets the current server. Required before performing any action on the Content Directory service.

Parameters:
  • server_device (Device) - server

set_current_renderer(self, renderer_device)

source code 

Sets the current renderer. Required before performing any action on the AV Transport service.

Parameters:
  • renderer_device (Device) - renderer

browse(self, object_id, browse_flag, filter, starting_index, requested_count, sort_criteria="dc:title")

source code 

Browses media servers.

Parameters:
  • object_id (string) - object id
  • browse_flag (string) - BrowseDirectChildren or BrowseMetadata
  • filter (string) - a filter to indicate which metadata properties are to be returned. Usually "*".
  • starting_index (int) - starting index to consider the requested count
  • requested_count (int) - requested number of entries
  • sort_criteria (string) - sorting criteria
Returns: list
a list of containers and items

search(self, container_id, search_criteria, filter, starting_index, requested_count, sort_criteria)

source code 

Search items in Media Server.

This method search items with search_criteria key in the container_id of current media server.

Parameters:
  • container_id (string) - unique identifier of the container in which to begin searching.
  • search_criteria (string) - search criteria
  • filter (string) - a filter to indicate which metadata properties are to be returned.
  • starting_index (int) - starting index to consider the requested count
  • requested_count (int) - requested number of entries under the object specified by container_id
  • sort_criteria (string) - sorting criteria
Returns: dict
search result

av_play(self, id=0, uri='')

source code 

Tells the selected media renderer to play an item given its id or media URI.

Parameters:
  • id (string) - id of the media on the media server
  • uri (string) - URI where the media is available

Class Variable Details [hide private]

msg_invalid_renderer

Value:
'renderer_device parameter must be a Device'

msg_select_server

Value:
'media server not set. Set it with ' 'set_current_server().'

msg_select_renderer

Value:
'media renderer not set. Set it with ' 'set_current_renderer().'