Developer:Davaar:RadioService

From LinnDocs
Revision as of 13:40, 29 August 2012 by Hahnj21 (talk | contribs) (SetId)
Jump to: navigation, search

Architectural Overview

The Radio service provides the means for controlling a Radio source. If a product's Product Service reports a source of type 'Radio', then the device that bears that Product Service is guaranteed to also bears the Radio service.

The heart of the Radio service is the SetChannel action. Call SetChannel with a particular Uri and Metadata, then call Play and the media at the given Uri is played. If the media is an internet radio stream, it will play forever. If it is of finite length, it will play to the end and then stop.

Call the Channel action to report the Uri and Metadata of the current Channel.

The Radio Source also stores a list of channel presets. These can be presented to the user as a list of numbered channels that can easily be selected and played.

This array of channel presets is accessed using an id array mechanism similar to that used in the Playlist Service. The only difference is that the Radio service's id array is a constant length and may contain entries that are zero, which represent empty presets.

Actions

Channel

Report the Uri and Metadata of the current Channel.

SetChannel

Set the Uri and Metadata of the current Channel.

IdArray

Report the current id array. The id array contains 100 presets, but this may change (see ChannelsMax).

The IdArray is an ordered, constant length, array of ids. The first element contains the id for channel preset 1, the second element contains the id for channel Preset 2, etc. If an element is set to zero, then the corresponding channel preset is empty.

This action also reports a Token, which can be used to quickly detect if the id array has changed since it was last read (see IdArrayChanged).

IdArrayChanged

Check to see if the id array has changed since gathering the specified IdArrayToken. This Token must have been previously collected from the IdArray action.

This mechanism is provided specifically for clients unable to partake in UPnP eventing.

ChannelsMax

Report the maximum number of entries in the channel preset id array.

SetId

Set the current Channel using the channel preset represented by the given Id, and using the provided Uri.

It is usual for a Control Point to inspect the res elements of the Channel Metadata and select the appropriate Uri by matching to the renderer's ProtocolInfo.

Id

Report the Id of the current Channel if it is in the Channel Preset list. If the current Channel is not a channel preset, the Id reported is zero.

ProtocolInfo

Report the Radio Source protocol info.

Read

Given a channel preset Id, report its associated Metadata.

ReadList

Given a space separated list of channel preset Ids, report their associated Metadata.

TransportState

Report the current transport state, which can be: 'Playing', 'Paused', 'Stopped', or 'Buffering'.

Play

Play the current channel

Pause

Pause the current channel. This will be converted to Stop if the channel cannot be paused e.g. internet radio.

Stop

Stop the current Channel

SeekSecondsAbsolute

Seek to an absolute second within the current media. This is only available if the current media has a finite length.

SeekSecondsRelative

Seek to a relative second within the current media. This is only available if the current media has a finite length.

Technical Details

   Domain  : av.openhome.org
   Name    : Radio
   Version : 1

Radio Service Description (XML)

Migration Guide From Cara

The domain for the Radio service has changed to av.openhome.org

Actions

Channel

The arguments have changed their names as follows:

  • aChannel -> Channel
  • aUri -> Uri

ChannelsMax

This action has changed its name from IdsMax. The arguments have changed their names as follows:

  • aIdsMax -> Value

Set Channel

The arguments have changed their names as follows:

  • aUri -> Uri
  • aMetadata -> Metadata

IdArray

The arguments have changed their names as follows:

  • aIdArrayToken -> Token
  • aIdArray -> Array

IdArrayChanged

The arguments have changed their names as follows:

  • aIdArrayToken -> Token
  • aIdArrayChanged -> Value

SetId

The arguments have changed their names as follows:

  • aId -> Value
  • aUri -> Uri

Id

The arguments have changed their names as follows:

  • aId -> Value

ProtocolInfo

The arguments have changed their names as follows:

  • aInfo -> Value

Read

The arguments have changed their names as follows:

  • aId -> Id
  • aMetadata -> Metadata

ReadList

The arguments have changed their names as follows:

  • aIdList -> IdList
  • aMetadataList -> ChannelList

The IdList passed in has changed from comma-separated to space-separated.

The xml returned has changed to be of the following form:

 <ChannelList>
   <Entry>
     <Id></Id>
     <Metadata></Metadata>
   </Entry>
 </ChannelList>

TransportState

The arguments have changed their names as follows:

  • aState -> Value

Play

No change

Pause

No change

Stop

No change

SeekSecondsAbsolute

The arguments have changed their names as follows:

  • aSecond -> Value

SeekSecondsRelative

The arguments have changed their names as follows:

  • aSecond -> Value