From OpenHome

(Difference between revisions)
Jump to: navigation, search
(Remove streamId from Next, Prev actions)
Line 14: Line 14:
Any mode that is sometimes capable of changing stream as a consequence of <tt>Next</tt> will always report <tt>NextAvailable</tt> as <tt>true</tt>.
Any mode that is sometimes capable of changing stream as a consequence of <tt>Next</tt> will always report <tt>NextAvailable</tt> as <tt>true</tt>.
-
=== PrevAvailable ===
+
=== PreviousAvailable ===
-
<tt>true</tt> if the <tt>Prev</tt> (skip backwards) action is currently available; <tt>false</tt> otherwise.
+
<tt>true</tt> if the <tt>Previous</tt> (skip backwards) action is currently available; <tt>false</tt> otherwise.
-
Any mode that is sometimes capable of changing stream as a consequence of <tt>Prev</tt> will always report <tt>PrevAvailable</tt> as <tt>true</tt>.
+
Any mode that is sometimes capable of changing stream as a consequence of <tt>Prev</tt> will always report <tt>PreviousAvailable</tt> as <tt>true</tt>.
=== RepeatAvailable ===
=== RepeatAvailable ===
<tt>true</tt> if the <tt>SetRepeat</tt> action is currently available; <tt>false</tt> otherwise.
<tt>true</tt> if the <tt>SetRepeat</tt> action is currently available; <tt>false</tt> otherwise.
-
=== RandomAvailable ===
+
=== ShuffleAvailable ===
-
<tt>true</tt> if the <tt>SetRandom</tt> action is currently available; <tt>false</tt> otherwise.
+
<tt>true</tt> if the <tt>SetShuffle</tt> action is currently available; <tt>false</tt> otherwise.
=== StreamId ===
=== StreamId ===
Line 29: Line 29:
=== Seekable ===
=== Seekable ===
-
<tt>true</tt> if the <tt>SeekSecondsAbsolute</tt> and <tt>SeekSecondsRelative</tt> actions are available for the current stream; <tt>false</tt> otherwise.
+
<tt>true</tt> if the <tt>SeekSecondAbsolute</tt> and <tt>SeekSecondRelative</tt> actions are available for the current stream; <tt>false</tt> otherwise.
=== Pausable ===
=== Pausable ===
Line 43: Line 43:
=== Repeat ===
=== Repeat ===
-
<tt>true</tt> if repeat mode is currently enabled (i.e. playing content will loop endlessly).
+
<tt>0</tt> if repeat mode is currently disabled.
 +
<br><tt>>0</tt> if repeat mode is currently enabled (i.e. playing content will loop endlessly).
 +
<br>A value of <tt>1</tt> 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).
-
=== Random ===
+
=== Shuffle ===
-
<tt>true</tt> if random (aka shuffle) mode is currently enabled.
+
<tt>0</tt> if shuffle mode is currently disabled.
 +
<br><tt>>0</tt> if shuffle mode is currently enabled.
 +
<br>A value of <tt>1</tt> 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 ==
== Actions ==
Line 85: Line 89:
Move to the next stream (i.e. skip forwards).  Determination of what comes next may vary between sources/modes.  If <tt>TransportState</tt> is <tt>Stopped</tt> or <tt>Paused</tt>, try to start playing.
Move to the next stream (i.e. skip forwards).  Determination of what comes next may vary between sources/modes.  If <tt>TransportState</tt> is <tt>Stopped</tt> or <tt>Paused</tt>, try to start playing.
-
=== Prev ===
+
=== Previous ===
<tt>
<tt>
Arguments: None
Arguments: None
Line 95: Line 99:
=== SetRepeat ===
=== SetRepeat ===
<tt>
<tt>
-
Arguments: (in bool repeat)
+
Arguments: (in uint repeat)
</tt><br>
</tt><br>
Sets the Repeat state of the device, affecting all sources that are capable of implementing a repeat feature.
Sets the Repeat state of the device, affecting all sources that are capable of implementing a repeat feature.
 +
<br>Only states <tt>0</tt> (repeat off) and <tt>1</tt> (repeat on, all tracks) are currently supported.
-
=== SetRandom ===
+
=== SetShuffle ===
<tt>
<tt>
-
Arguments: (in bool random)
+
Arguments: (in uint shuffle)
</tt><br>
</tt><br>
-
Sets the Random (aka Shuffle) state of the device, affecting all sources that are capable of implementing a randomise feature.
+
Sets the Shuffle state of the device, affecting all sources that are capable of implementing a randomise feature.
 +
<br>Only states <tt>0</tt> (shuffle off) and <tt>1</tt> (shuffle on, all tracks) are currently supported.
-
=== SeekSecondsAbsolute ===
+
=== SeekSecondAbsolute ===
<tt>
<tt>
Arguments: (in uint streamId, in uint secondsAbsolute)
Arguments: (in uint streamId, in uint secondsAbsolute)
Line 114: Line 120:
[[br]]Returns a <tt>803</tt> fault code if the seek position is beyond the end of the stream.
[[br]]Returns a <tt>803</tt> fault code if the seek position is beyond the end of the stream.
-
=== SeekSecondsRelative ===
+
=== SeekSecondRelative ===
<tt>
<tt>
Arguments: (in uint streamId, in int secondsRelative)
Arguments: (in uint streamId, in int secondsRelative)
Line 137: Line 143:
=== ModeInfo ===
=== ModeInfo ===
<tt>
<tt>
-
Arguments: (out string mode, out bool nextAvailable, out bool prevAvailable)
+
Arguments: (out string mode, out bool nextAvailable, out bool previousAvailable, out bool repeatAvailable, out bool shuffleAvailable)
</tt><br>
</tt><br>
-
Reports the values of the <tt>Mode</tt>, <tt>NextAvailable</tt> and <tt>PrevAvailable</tt> properties.
+
Reports the values of the <tt>Mode</tt>, <tt>NextAvailable</tt>, <tt>PrevAvailable</tt>, <tt>RepeatAvailable</tt> and <tt>ShuffleAvailable</tt> properties.
=== StreamInfo ===
=== StreamInfo ===
Line 160: Line 166:
=== Repeat ===
=== Repeat ===
<tt>
<tt>
-
Arguments: (out bool repeat)
+
Arguments: (out uint repeat)
</tt><br>
</tt><br>
Read the current value of the <tt>Repeat</tt> property.
Read the current value of the <tt>Repeat</tt> property.
-
=== Random ===
+
=== Shuffle ===
<tt>
<tt>
-
Arguments: (out bool random)
+
Arguments: (out uint shuffle)
</tt><br>
</tt><br>
-
Read the current value of the <tt>Random</tt> property.
+
Read the current value of the <tt>Shuffle</tt> property.
== UPnP Service Description ==
== UPnP Service Description ==

Revision as of 10:47, 26 April 2017

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>