The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Audio Control schema changes


  • Subject: Re: Audio Control schema changes
  • From: Michael McSharry
  • Date: Sat, 14 Feb 2004 18:44:00 +0000

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<DIV><FONT face="Arial" size="2">I
generally agree with information returned in block format, but at the same
time consideration should be given to low bandwith interfaces as well as
the general proliferation where the "state" of all providers is
clogging up the network.&nbsp; When a query is made it should be
possible to query either a particular key or a group.&nbsp; This will
allow the optimum level of traffic as determined by the unit that is in
need of the information.</FONT></DIV>
<DIV><FONT face="Arial"
size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">Using the
example</FONT></DIV>
<DIV><FONT face="Arial"
size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier
New">[Request]Class=xAP-Audio.QueryPlaylist.Query{&nbsp;&nbsp;&nbsp;
Query=[Track  List  Title  Artist Album  Path  Duration  Index  Tracks 
Genre]&nbsp;&nbsp;&nbsp; Index="index in
playlist"}[Response - where
Query=Track]Class=xAP-Audio.Playlist.InfoTrack.Info{&nbsp;&nbsp;&nbsp;
Title="title"&nbsp;&nbsp;&nbsp;
Artist="artist"&nbsp;&nbsp;&nbsp;
Album="album"&nbsp;&nbsp;&nbsp; Path="path to
current track"&nbsp;&nbsp;&nbsp; Duration="title
duration"&nbsp;&nbsp;&nbsp; Index="playlist
index"&nbsp;&nbsp;&nbsp; Tracks="number of tracks in
the current playlist"&nbsp;&nbsp;&nbsp;
Genre="genre"}</FONT></DIV>
<DIV><FONT face="Courier
New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">[Response - where
Query=Artist]Class=xAP-Audio.Playlist.InfoArtist.Info{&nbsp;&nbsp;&nbsp;
Artist="artist"}</FONT></DIV>
<DIV></DIV>
<BLOCKQUOTE>
<DIV>----- Original Message ----- </DIV>
<DIV><B>From:</B> <A title="lists@xxxxxxx"
href="mailto:lists@xxxxxxx";>Stuart
Booth</A> </DIV>
<DIV><B>To:</B> <A
title="xAP_developer@xxxxxxx" href="mailto:xAP_developer@xxxxxxx";>xAP_developer@xxxxxxx</A>
</DIV>
<DIV><B>Sent:</B> Saturday, February 14, 2004 10:08
AM</DIV>
<DIV><B>Subject:</B> Re: [xAP_developer] Audio Control
schema changes</DIV>
<DIV></DIV><TT>[ Oops, this got long! ]In the current
audio control schema as published, audio items such asVolume, Balance etc
are queried individually. So to get all theinformation you have to
send/receive several messages. The sampleapplies for details on the current
playlist track where even morerequests are required. A bit nasty
really!Edward suggested combining these into one query fetches all
relevantdata message. For
example:Class=xAP-Audio.QueryAudio.Query{}Audio.Info{&nbsp;&nbsp;&nbsp;
Volume=&nbsp;&nbsp;&nbsp;
Balance=&nbsp;&nbsp;&nbsp; Bass=&nbsp;&nbsp;&nbsp;
Treble=}This is a great plan in general I think. However, it does
meanAudio.Info is a 'kitchen sink' block where the possible set of
valuescould be quite wide ranging. For example, the Audio settings that
canbe configured are:Class=xAP-Audio.Audio[.Event]Audio.Mute{Mute=[On  Off 
Toggle]}Audio.Mixer{Volume=[0...100  +nn 
-nn]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -
-- optionalBalance=[-100...0...+100  +nn 
-nn]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---
optionalBass=[0...100  +nn 
-nn]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---
optionalTreble=[0...100  +nn 
-nn]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---
optional}Audio.SourceSelect{&nbsp;&nbsp;&nbsp; Input=[name]}We
could extend Audio.Info whenever the audio control schema ischanged and
requires it, such as the example
below:Class=xAP-Audio.QueryAudio.Query{}Audio.Info{&nbsp;&nbsp;&nbsp;
Volume=&nbsp;&nbsp;&nbsp;
Balance=&nbsp;&nbsp;&nbsp; Bass=&nbsp;&nbsp;&nbsp;
Treble=&nbsp;&nbsp;&nbsp; Mute=&nbsp;&nbsp;&nbsp;
Input=}Using Audio.Info you can see that we need to pack everything into
theone block, and hence it doesn't implicitly support future
enhancements(such as the recently added Audio.SourceSelect) so well:- there
might be a field name clash in future.- it might get rather large over
time.- the condi
tions where certain values are valid may get overcomplicated.In some cases
a compound block containing all information makes anawful lot of sense,
such as Track.Info describing the current playlistsong.I was wondering
though - since there is an event message sent out whensomething changes, it
seems we should reuse a similarstyle/name/content for the response message
to the query, and reusethe periodic "xAP-Audio.[Category].Info"
messages for the responseinformation. This can reuse a lot of code on both
sides and issupported in some respects by the Exstreamer already..Info
blocks are sent periodically with state UNchanged information..Event block
on the other hand are sent only when a state changes.This has the effect of
removing the response block from the Queryclass in some cases at least.So
how about:Class=xAP-Audio.QueryAudio.Query{&nbsp;&nbsp;&nbsp;
Query=[ Mute  Mixer  SourceSelect ]}[Other queryable items such as Playlist
and Track omitted for brevity]As an example, examine the fo
llowing. I have annotated the request andresponse messages as you can
see.[Request]Class=xAP-Audio.QueryAudio.Query{&nbsp;&nbsp;&nbsp;
Query=Mixer}[Response]Class=xAP-Audio.Audio.InfoAudio.Mixer{Volume=Balance=Bass=Treble=}and
also...[Request]Class=xAP-Audio.QueryAudio.Query{&nbsp;&nbsp;&nbsp;
Query=SourceSelect}[Response]Class=xAP-Audio.Audio.InfoAudio.SourceSelect{&nbsp;&nbsp;&nbsp;
Input=[name]}This does require processing of the Query line inside the
initialquery block. But this is consistent with Playlist.Query. Some
don'teven have any query block
content:[Request]Class=xAP-Audio.QueryTransport.Query{}[Response - a
compound block in this
case]Class=xAP-Audio.Transport.InfoTransport.Info{&nbsp;&nbsp;&nbsp;
Mode=[Play  Pause  Stop]&nbsp;&nbsp;&nbsp; Sleep=[Yes 
No]&nbsp;&nbsp;&nbsp; Power=[On 
Off]&nbsp;&nbsp;&nbsp;
Length="Length"&nbsp;&nbsp;&nbsp;
Position="Position"&nbsp;&nbsp;&am
p;nbsp; Index="playlist index"&nbsp;&nbsp;&nbsp;
Decoder="encoding:bit-rate:sample-rate"}and[Request]Class=xAP-Audio.QueryPlaylist.Query{&nbsp;&nbsp;&nbsp;
Query=[Track  List]&nbsp;&nbsp;&nbsp; Index="index in
playlist"}[Response - where
Query=Track]Class=xAP-Audio.Playlist.InfoTrack.Info{&nbsp;&nbsp;&nbsp;
Title="title"&nbsp;&nbsp;&nbsp;
Artist="artist"&nbsp;&nbsp;&nbsp;
Album="album"&nbsp;&nbsp;&nbsp; Path="path to
current track"&nbsp;&nbsp;&nbsp; Duration="title
duration"&nbsp;&nbsp;&nbsp; Index="playlist
index"&nbsp;&nbsp;&nbsp; Tracks="number of tracks in
the current playlist"&nbsp;&nbsp;&nbsp;
Genre="genre"}or[Response - where
Query=List]Class=xAP-Audio.Playlist.InfoPlaylist.Info{&nbsp;&nbsp;&nbsp;
Tracks="length of play list"&nbsp;&nb
sp;&nbsp; Index="index of current
track"&nbsp;&nbsp;&nbsp; Shuffle=[On 
Off]&nbsp;&nbsp;&nbsp; Repeat=[Stop  Track  Playlist]}It has
the advantage of a query mechanism falling out of an existinginformational
broadcast system and can be easily extended.I did wonder about changing the
query from:Class=xAP-Audio.QueryAudio.Query{&nbsp;&nbsp;&nbsp;
Query=[ Mute  Mixer  SourceSelect  ... ]}Where the Query values are fixed,
making this free-text and specifyingthe block name that we're interested
in. Although this does mean theblocks have to be kept unique unless the
class name is specified tooe.g.:Query{&nbsp;&nbsp;&nbsp;
Query=xAP-Audio.Audio[.Info?]:Audio.Mixer}Hopefully all these changes will
fix a few flaws in the schema whichhas been fairly static for almost a year
now.SPS - congrats for reading this far! ;-)-- Stuart Booth
<stuart@xxxxxxx>xAPFramework.net - a xAP software development
framework for .net<A href="http://www.xapautomation.org/";>http://www.xapautomation.org/</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A href="http://www.xapframework.net/";>http://www.xapframework.net/</A></TT>




xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.