From OpenHome
(→Technical Details) |
(→Architectural Overview) |
||
(5 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | = | + | = Overview = |
- | The Time service reports the duration of the currently playing track and the number of seconds so far played. | + | The Time service reports the duration of the currently playing track and the number of seconds played so far. It also maintains a count of the total number of tracks played. |
- | This service is intentionally separated from the Info service. When a track is being played, this service delivers an event every second, which can overwhelm some primitive control points. The Time service is kept separate from the Info service so that control points can decide to subscribe to it independently. | + | This service is intentionally separated from the [[Developer:InfoService|Info]] service. When a track is being played, this service delivers an event every second, which can overwhelm some primitive control points. The <tt>Time</tt> service is kept separate from the [[Developer:InfoService|Info]] service so that control points can decide to subscribe to it independently. |
+ | |||
+ | = State Variables = | ||
+ | == Track Count == | ||
+ | The number of tracks that have been played, including any currently playing one. | ||
+ | |||
+ | == Duration == | ||
+ | The total length of the current track in seconds. Zero for live streams. | ||
+ | |||
+ | == Seconds == | ||
+ | The total length of time in seconds for which the current track has been playing. | ||
= Actions = | = Actions = | ||
- | ==Time== | + | == Time == |
- | This reports TrackCount, which increments each time a new track is played; Duration, which is the duration of the current track in seconds; and Seconds, which is the number of seconds so far played. | + | This reports <tt>TrackCount</tt>, which increments each time a new track is played; <tt>Duration</tt>, which is the duration of the current track in seconds; and <tt>Seconds</tt>, which is the number of seconds so far played. |
- | TrackCount corresponds with TrackCount reported in the Info | + | <tt>TrackCount</tt> corresponds with <tt>TrackCount</tt> reported in the [[Developer:InfoService|Info]] service, but bears no relation to a Track Id or Preset Id reported from the [[Developer:Davaar:PlaylistService|Playlist]] or [[Developer:Davaar:RadioService|Radio]] services. |
= Technical Details = | = Technical Details = | ||
Line 18: | Line 28: | ||
== Time Service Description (XML) == | == Time Service Description (XML) == | ||
- | < | + | <syntaxhighlight lang="xml"> |
- | </ | + | <?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>Time</name> | ||
+ | <argumentList> | ||
+ | <argument> | ||
+ | <name>TrackCount</name> | ||
+ | <direction>out</direction> | ||
+ | <relatedStateVariable>TrackCount</relatedStateVariable> | ||
+ | </argument> | ||
+ | <argument> | ||
+ | <name>Duration</name> | ||
+ | <direction>out</direction> | ||
+ | <relatedStateVariable>Duration</relatedStateVariable> | ||
+ | </argument> | ||
+ | <argument> | ||
+ | <name>Seconds</name> | ||
+ | <direction>out</direction> | ||
+ | <relatedStateVariable>Seconds</relatedStateVariable> | ||
+ | </argument> | ||
+ | </argumentList> | ||
+ | </action> | ||
+ | </actionList> | ||
+ | <serviceStateTable> | ||
+ | <stateVariable sendEvents="yes"> | ||
+ | <name>TrackCount</name> | ||
+ | <dataType>ui4</dataType> | ||
+ | </stateVariable> | ||
+ | <stateVariable sendEvents="yes"> | ||
+ | <name>Duration</name> | ||
+ | <dataType>ui4</dataType> | ||
+ | </stateVariable> | ||
+ | <stateVariable sendEvents="yes"> | ||
+ | <name>Seconds</name> | ||
+ | <dataType>ui4</dataType> | ||
+ | </stateVariable> | ||
+ | </serviceStateTable> | ||
+ | </scpd> | ||
+ | </syntaxhighlight> |
Latest revision as of 10:58, 2 August 2013
Contents |
Overview
The Time service reports the duration of the currently playing track and the number of seconds played so far. It also maintains a count of the total number of tracks played.
This service is intentionally separated from the Info service. When a track is being played, this service delivers an event every second, which can overwhelm some primitive control points. The Time service is kept separate from the Info service so that control points can decide to subscribe to it independently.
State Variables
Track Count
The number of tracks that have been played, including any currently playing one.
Duration
The total length of the current track in seconds. Zero for live streams.
Seconds
The total length of time in seconds for which the current track has been playing.
Actions
Time
This reports TrackCount, which increments each time a new track is played; Duration, which is the duration of the current track in seconds; and Seconds, which is the number of seconds so far played.
TrackCount corresponds with TrackCount reported in the Info service, but bears no relation to a Track Id or Preset Id reported from the Playlist or Radio services.
Technical Details
Domain : av.openhome.org Name : Time Version : 1
Time Service Description (XML)
<?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>Time</name> <argumentList> <argument> <name>TrackCount</name> <direction>out</direction> <relatedStateVariable>TrackCount</relatedStateVariable> </argument> <argument> <name>Duration</name> <direction>out</direction> <relatedStateVariable>Duration</relatedStateVariable> </argument> <argument> <name>Seconds</name> <direction>out</direction> <relatedStateVariable>Seconds</relatedStateVariable> </argument> </argumentList> </action> </actionList> <serviceStateTable> <stateVariable sendEvents="yes"> <name>TrackCount</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Duration</name> <dataType>ui4</dataType> </stateVariable> <stateVariable sendEvents="yes"> <name>Seconds</name> <dataType>ui4</dataType> </stateVariable> </serviceStateTable> </scpd>