From OpenHome
Contents |
Transport Service
Overview
The Transport service provides source-independent control of play, pause, stop, skip and seek.
If a device's Product service reports an attribute "Transport", then that device is guaranteed to bear the Transport service. If the Transport service is available, all its properties and actions must be fully implemented.
Evented Properties
Modes
Space separated list of available modes.
NextAvailable
true if the Next (skip forwards) action is currently available; false otherwise.
Any mode that is sometimes capable of changing stream as a consequence of Next will always report NextAvailable as true.
PreviousAvailable
true if the Previous (skip backwards) action is currently available; false otherwise.
Any mode that is sometimes capable of changing stream as a consequence of Prev will always report PreviousAvailable as true.
RepeatAvailable
true if the SetRepeat action is currently available; false otherwise.
ShuffleAvailable
true if the SetShuffle action is currently available; false otherwise.
StreamId
Integer id, uniquely identifying the current stream.
Seekable
true if the SeekSecondAbsolute and SeekSecondRelative actions are available for the current stream; false otherwise.
Pausable
true if the stream can be paused (so is not being played at a rate determined by a remote sender); false otherwise.
TransportState
One of
- Playing
- Paused
- Stopped
- Buffering
- Waiting
Repeat
0 if repeat mode is currently disabled.
>0 if repeat mode is currently enabled (i.e. playing content will loop endlessly).
A value of 1 implies that all content available to the current mode will be repeated. Larger values are reserved for future use and may imply new repeat modes (e.g. repeat a selection of tracks only).
Shuffle
0 if shuffle mode is currently disabled.
>0 if shuffle mode is currently enabled.
A value of 1 implies that all content available to the current mode will be shuffled. Larger values are reserved for future use and may imply new shuffle modes (e.g. play only a single album, randomising its tracks).
Actions
PlayAs
Arguments: (in string mode, in string command)
Start a new stream playing, specifying both a mode (source) to be used and a mode-specific command which describes the track to be played. Common options for modes and commands are documented separately.
Play
Arguments: None
Start a pending stream playing.
A stream must be ready to play. Possibly via calls to another network service.
Behaviour when a stream is already playing varies depending on the active modes (source).
Pause
Arguments: None
Pause the current stream.
Returns a 801 fault code if the current channel does not support being paused (is being played at a rate determined by a remote sender).
Stop
Arguments: None Stop the current stream.
Next
Arguments: None
Move to the next stream (i.e. skip forwards). Determination of what comes next may vary between sources/modes. If TransportState is Stopped or Paused, try to start playing.
Previous
Arguments: None
Move to the previous stream (i.e. skip backwards). If TransportState is Stopped or Paused, try to start playing.
Returns a 801 fault code if the current channel does not support skipping backwards.
SetRepeat
Arguments: (in uint repeat)
Sets the Repeat state of the device, affecting all sources that are capable of implementing a repeat feature.
Only states 0 (repeat off) and 1 (repeat on, all tracks) are currently supported.
SetShuffle
Arguments: (in uint shuffle)
Sets the Shuffle state of the device, affecting all sources that are capable of implementing a randomise feature.
Only states 0 (shuffle off) and 1 (shuffle on, all tracks) are currently supported.
SeekSecondAbsolute
Arguments: (in uint streamId, in uint secondsAbsolute)
Seek to an absolute position in the current stream. If TransportState is Stopped or Paused, try to start playing.
Returns a 801 fault code if the current stream does not support seek. brReturns a 803 fault code if the seek position is beyond the end of the stream.
SeekSecondRelative
Arguments: (in uint streamId, in int secondsRelative)
Seek to a position relative to what's currently playing in the current stream. If TransportState is Stopped or Paused, try to start playing.
Returns a 801 fault code if the current stream does not support seek. brReturns a 803 fault code if the seek position is beyond the end of the stream.
TransportState
Arguments: (out string state)
Read the current value of the TransportState property.
Modes
Arguments: (out string modes)
Return the value of the Modes property.
ModeInfo
Arguments: (out string mode, out bool nextAvailable, out bool previousAvailable, out bool repeatAvailable, out bool shuffleAvailable)
Reports the values of the Mode, NextAvailable, PrevAvailable, RepeatAvailable and ShuffleAvailable properties.
StreamInfo
Arguments:
(out uint streamId, out bool seekable, out bool pausable)
Reports current stream information:
- StreamId
- Seekable
- Pausable
StreamId
Arguments: (out uint streamId)
Read the current value of the StreamId property.
Repeat
Arguments: (out uint repeat)
Read the current value of the Repeat property.
Shuffle
Arguments: (out uint shuffle)
Read the current value of the Shuffle property.
UPnP Service Description
For devices supporting the UPnP protocol, the service description is
name: "Transport"
domain: "av.openhome.org"
version: "1"
<?xml version="1.0" encoding="utf-8"?> <scpd xmlns="urn:schemas-upnp-org:service-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <actionList> <action> <name>PlayAs</name> <argumentList> <argument> <name>Mode</name> <direction>in</direction> <relatedStateVariable>A_ARG_TYPE_string</relatedStateVariable> </argument> <argument> <name>Command</name> <direction>in</direction> <relatedStateVariable>A_ARG_TYPE_string</relatedStateVariable> </argument> </argumentList> </action> <action> <name>Play</name> </action> <action> <name>Pause</name> </action> <action> <name>Stop</name> </action> <action> <name>Next</name> </action> <action> <name>Prev</name> </action> <action> <name>SetRepeat</name> <argumentList> <argument> <name>Repeat</name> <direction>in</direction> <relatedStateVariable>A_ARG_TYPE_boolean</relatedStateVariable> </argument> </argumentList> </action> <action> <name>SetRandom</name> <argumentList> <argument> <name>Random</name> <direction>in</direction> <relatedStateVariable>A_ARG_TYPE_boolean</relatedStateVariable> </argument> </argumentList> </action> <action> <name>SeekSecondsAbsolute</name> <argumentList> <argument> <name>StreamId</name> <direction>in</direction> <relatedStateVariable>StreamId</relatedStateVariable> </argument> <argument> <name>SecondsAbsolute</name> <direction>in</direction> <relatedStateVariable>A_ARG_TYPE_uint</relatedStateVariable> </argument> </argumentList> </action> <action> <name>SeekSecondsRelative</name> <argumentList> <argument> <name>StreamId</name> <direction>in</direction> <relatedStateVariable>StreamId</relatedStateVariable> </argument> <argument> <name>SecondsRelative</name> <direction>in</direction> <relatedStateVariable>A_ARG_TYPE_int</relatedStateVariable> </argument> </argumentList> </action> <action> <name>TransportState</name> <argumentList> <argument> <name>State</name> <direction>out</direction> <relatedStateVariable>TransportState</relatedStateVariable> </argument> </argumentList> </action> <action> <name>Modes</name> <argumentList> <argument> <name>Modes</name> <direction>out</direction> <relatedStateVariable>Modes</relatedStateVariable> </argument> </argumentList> </action> <action> <name>ModeInfo</name> <argumentList> <argument> <name>NextAvailable</name> <direction>out</direction> <relatedStateVariable>NextAvailable</relatedStateVariable> </argument> <argument> <name>PrevAvailable</name> <direction>out</direction> <relatedStateVariable>PrevAvailable</relatedStateVariable> </argument> <argument> <name>RepeatAvailable</name> <direction>out</direction> <relatedStateVariable>RepeatAvailable</relatedStateVariable> </argument> <argument> <name>RandomAvailable</name> <direction>out</direction> <relatedStateVariable>RandomAvailable</relatedStateVariable> </argument> </argumentList> </action> <action> <name>StreamInfo</name> <argumentList> <argument> <name>StreamId</name> <direction>out</direction> <relatedStateVariable>StreamId</relatedStateVariable> </argument> <argument> <name>Seekable</name> <direction>out</direction> <relatedStateVariable>Seekable</relatedStateVariable> </argument> <argument> <name>Pausable</name> <direction>out</direction> <relatedStateVariable>Pausable</relatedStateVariable> </argument> </argumentList> </action> <action> <name>StreamId</name> <argumentList> <argument> <name>StreamId</name> <direction>out</direction> <relatedStateVariable>StreamId</relatedStateVariable> </argument> </argumentList> </action> <action> <name>Repeat</name> <argumentList> <argument> <name>Repeat</name> <direction>out</direction> <relatedStateVariable>Repeat</relatedStateVariable> </argument> </argumentList> </action> <action> <name>Random</name> <argumentList> <argument> <name>Random</name> <direction>out</direction> <relatedStateVariable>Random</relatedStateVariable> </argument> </argumentList> </action> </actionList> <serviceStateTable> <stateVariable sendEvents="yes"> <name>Modes</name> <dataType>string</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>NextAvailable</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>PrevAvailable</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>RepeatAvailable</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>RandomAvailable</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>StreamId</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Seekable</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Pausable</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>TransportState</name> <dataType>string</dataType> <allowedValueList> <allowedValue>Playing</allowedValue> <allowedValue>Paused</allowedValue> <allowedValue>Stopped</allowedValue> <allowedValue>Buffering</allowedValue> <allowedValue>Waiting</allowedValue> </allowedValueList> </stateVariable> <stateVariable sendEvents="yes"> <name>Repeat</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Random</name> <dataType>boolean</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>A_ARG_TYPE_uint</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>A_ARG_TYPE_int</name> <dataType>i4</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>A_ARG_TYPE_string</name> <dataType>string</dataType> </stateVariable> <stateVariable sendEvents="no"> <name>A_ARG_TYPE_boolean</name> <dataType>boolean</dataType> </stateVariable> </serviceStateTable> </scpd>