coherence.backends.buzztard_control (module)

class BzClient(*args, **kwargs)[source]

Bases: twisted.protocols.basic.LineReceiver, eventdispatcher.eventdispatcher.EventDispatcher, coherence.log.LogAble

    Changed in version 0.9.0:
  • Migrated from louie/dispatcher to EventDispatcher

  • The emitted events changed:

    • Buzztard.Response.flush => response_flush

    • Buzztard.Response.event => response_event

    • Buzztard.Response.volume => response_volume

    • Buzztard.Response.mute=> response_mute

    • Buzztard.Response.repeat => response_repeat

    • Buzztard.Response.browse => response_browse

logCategory = 'buzztard_client'
factory = None
connectionMade()[source]

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

lineReceived(line)[source]

Override this for when each line is received.

@param line: The line which was received with the delimiter removed. @type line: C{bytes}

class BzFactory(backend)[source]

Bases: twisted.internet.protocol.ClientFactory, coherence.log.LogAble

Changed in version 0.9.0: Migrated from louie/dispatcher to EventDispatcher

logCategory = 'buzztard_factory'
protocol

alias of BzClient

clientConnectionFailed(connector, reason)[source]

Called when a connection has failed to connect.

It may be useful to call connector.connect() - this will reconnect.

@type reason: L{twisted.python.failure.Failure}

clientConnectionLost(connector, reason)[source]

Called when an established connection is lost.

It may be useful to call connector.connect() - this will reconnect.

@type reason: L{twisted.python.failure.Failure}

startFactory()[source]

This will be called before I begin listening on a Port or Connector.

It will only be called once, even if the factory is connected to multiple ports.

This can be used to perform ‘unserialization’ tasks that are best put off until things are actually running, such as connecting to a database, opening files, etcetera.

clientReady(instance)[source]
sendMessage(msg)[source]
rebrowse()[source]
browse()[source]
class BzConnection(backend=None, host='localhost', port=7654)[source]

Bases: coherence.log.LogAble

A singleton class

Changed in version 0.9.0: Migrated from louie/dispatcher to EventDispatcher

logCategory = 'buzztard_connection'
connection = None
class BuzztardItem(id, name, parent, mimetype, urlbase, host, update=False)[source]

Bases: coherence.log.LogAble

logCategory = 'buzztard_item'
remove(store)[source]
add_child(child, update=False)[source]
remove_child(child)[source]
get_children(start=0, request_count=0)[source]
get_child_count()[source]
get_id()[source]
get_update_id()[source]
get_path()[source]
get_name()[source]
get_parent()[source]
get_item()[source]
get_xml()[source]
class BuzztardStore(server, **kwargs)[source]

Bases: coherence.backend.Backend

    Changed in version 0.9.0:
  • Migrated from louie/dispatcher to EventDispatcher

  • Introduced Backend’s inheritance

logCategory = 'buzztard_store'
implements = ['MediaServer']
add_content(line)[source]
append(name, mimetype, parent)[source]
remove(id)[source]
clear()[source]
len()[source]
get_by_id(id)[source]
getnextID()[source]
upnp_init()[source]

This method gets called after the device is fired, here all initializations of service related state variables should happen, as the services aren’t available before that point.

class BuzztardPlayer(device, **kwargs)[source]

Bases: coherence.log.LogAble

Changed in version 0.9.0: Migrated from louie/dispatcher to EventDispatcher

logCategory = 'buzztard_player'
implements = ['MediaRenderer']
vendor_value_defaults = {'RenderingControl': {'A_ARG_TYPE_Channel': 'Master'}}
vendor_range_defaults = {'RenderingControl': {'Volume': {'maximum': 100}}}
event(line)[source]
poll_player()[source]
load(uri, metadata=None)[source]
start(uri)[source]
stop()[source]
play()[source]
pause()[source]
seek(location)[source]
Parameters

location (int) –

time to seek to, in seconds:

  • +nL = relative seek forward n seconds

  • -nL = relative seek backwards n seconds

mute()[source]
unmute()[source]
get_mute(line)[source]
get_repeat(line)[source]
set_repeat(playmode)[source]
get_volume(line)[source]
set_volume(volume)[source]
upnp_init()[source]
upnp_Play(*args, **kwargs)[source]
upnp_Pause(*args, **kwargs)[source]
upnp_Stop(*args, **kwargs)[source]
upnp_SetAVTransportURI(*args, **kwargs)[source]
upnp_SetMute(*args, **kwargs)[source]
upnp_SetVolume(*args, **kwargs)[source]
on_init_complete(backend)[source]
main()[source]

Changed in version 0.9.0: Migrated from louie/dispatcher to EventDispatcher