Monday, May 3, 2010

Re: Tutorial GUI for creating complex lists for XBMC

0 comments
Tutorial - How to create a list for XMBC music

First, lets lay out a couple of ground rules for CommandFusion in it's
current incarnation (Beta 2.3.1.2).

To communicate with XBMC we will be using the http protocol and the
XBMC HTTP API (which can be found at http://wiki.xbmc.org/index.php?title=Web_Server_HTTP_API).
I'm not going to attempt to explain the XBMC HTTP API, just how to
implement it in CommandFusion. iViewer/guiDesigner does not yet
natively support URL requests. You will notice that the URL requests
below start and end the same way. All commands start with GET and
all commands finish with HTTP/1.1\x0AHOST: IPADDRESSOFXBMC:PORT\x0A
\x0A You will need to change the ip address and port that your XBMC
http server is set to. You will need to edit this portion of all
the commands. Contained within the commands are bracketed words
(example [artistid]). These represent variables in CommandFusion.
It is not necessary to use brackets but IMHO it makes variables easier
to find later. This allows us to create dynamic commands. I'll
cover more on these later.

There are two types of HTTP connections you will be making with XBMC.
The first is a simple command where you do not want (or care about)
any feedback from XBMC. These are play, stop, add to playlist, clear
playlist, set playlist ect. The second type is where you are
interested in feedback from XBMC such as requesting the list of
artists, albums and songs.

The second type is a little more troublesome, so lets start with the
easier of the two... simple commands. You will need to know what the
IP address and Port for your XBMC box is. You can find this in XBMC
System/Network.

Open up CommandFusion guiDesigner and open up the demo GUI.

Let's start by examining the systems in System Manager. You will
notice that there are three identical systems (XBMC-Albums, Artists
and Music). When
you are sending an HTTP request and need to parse the feedback you
must create a seperate system for each command. If you create all of
your commands and feedback under one system you will find that your
return values are truncated or abscent as one commands feedback
overwrites the other. You will notice that all three of these systems
"maintain constant connection" and have the same EOM.

Now let's examine the XBMC-Commands system. This system is for
commands where we do not care about the feedback. We only want to
tell XBMC to do something. You can create as many of these types of
commands within this system as you wish. Please notice that in this
systems properties, there is no EO M and the Maintain Constant
Connection is not checked.

The last system I have the "Null System". In CommandFusion you can
now trigger optional target value assignments in commands. To me
this "null system" isn't a system at all. It's simply a way for me to
either set a digital join high or low (make a subpage appear or
dissappear) or a way to clear a list and doesn't actually communicate
with a 3rd party system.

Lastly you have macros which execute commands in succession with
delays. When executing a HTTP command that requires feedback
processing you MUST NOT initiate any page transitions before the
feedback is done being parse and the list is created!!!!

Lets examine the XBMC_SELECT_MUSIC macro

Command 1: XBMC_clear_artist_list (null system)

This command is in the null system. It simply passes the value of 0x
to the Artists list to empty it out.

Command 2: Loading Show (null system)

This causes a subpage to appear with a loading graphic to let the end
user know that CF is busy.

Command 3: XBMC_request_artists (artists system)

This command is being sent out via HTTP to XBMC to ask for a listing
of artists. Notice the 20ms delay? I don't want to start this
command before the loading subpage finishes it's transition.

Command 4: XBMC_Artists_Show (null system)

This command can be found in the null system and causes the subpage
with the list of artists to transition in. Notice the 5000ms delay?
I don't want this command to execute too soon. If it executes before
the data returned from XBMC_request_artists is parsed your remote
could freeze up.

Command 5: Loading Hide (null system)

This causes the loading screen to transition out. You will notice
that I don't use the loading screen in the other macros. This is
because the return value of an albums list for an artist or list of
songs from an album is generally very short and doesn't require long
to process. There is a simple delay of 500ms before showing the
songs list subpage to ensure that feedback is processed before
initiating a page transition.

Now lets look at the XBMC_parse_artists feedback. This feedback
reacts to the information returned from the XBMC_request_artists
command. There are two capture fields in the regex. The first item in
the parse_artists feedback is an "OnMatch". This command says that
"whenever a match occurs, assign the values to the (Target) List Join
(Join) 12002 and that the values represent an item in that list (Value
c). If you now look at the system properties for XBMC-Artists you
will note the EOM.

--
You received this message because you are subscribed to the Google Groups "CommandFusion" group.
To post to this group, send email to commandfusion@googlegroups.com.
To unsubscribe from this group, send email to commandfusion+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.

Comments

0 comments to "Re: Tutorial GUI for creating complex lists for XBMC"

Post a Comment

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com