coherence.backends.buzztard_control (module) — Cohen3 0.8.0 documentation

# coherence.backends.buzztard_control (module)

class `BzClient`(*args, **kwargs)

  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`()

    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)

    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)

  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)

    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)

    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`()

    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)
  `sendMessage`(msg)
  `rebrowse`()
  `browse`()

class `BzConnection`(backend=None, host='localhost', port=7654)

  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)

  Bases: `coherence.log.LogAble`

  `logCategory` = 'buzztard_item'
  `remove`(store)
  `add_child`(child, update=False)
  `remove_child`(child)
  `get_children`(start=0, request_count=0)
  `get_child_count`()
  `get_id`()
  `get_update_id`()
  `get_path`()
  `get_name`()
  `get_parent`()
  `get_item`()
  `get_xml`()

class `BuzztardStore`(server, **kwargs)

  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)
  `append`(name, mimetype, parent)
  `remove`(id)
  `clear`()
  `len`()
  `get_by_id`(id)
  `getnextID`()
  `upnp_init`()

    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)

  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)
  `poll_player`()
  `load`(uri, metadata=None)
  `start`(uri)
  `stop`()
  `play`()
  `pause`()
  `seek`(location)

    Parameters: | location (int) – time to seek to, in seconds: +nL = relative seek forward n seconds -nL = relative seek backwards n seconds

  `mute`()
  `unmute`()
  `get_mute`(line)
  `get_repeat`(line)
  `set_repeat`(playmode)
  `get_volume`(line)
  `set_volume`(volume)
  `upnp_init`()
  `upnp_Play`(*args, **kwargs)
  `upnp_Pause`(*args, **kwargs)
  `upnp_Stop`(*args, **kwargs)
  `upnp_SetAVTransportURI`(*args, **kwargs)
  `upnp_SetMute`(*args, **kwargs)
  `upnp_SetVolume`(*args, **kwargs)

`on_init_complete`(backend)

`main`()

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