Using liveCaster to multicast textual attributes
(For instructions on how to multicast MPEG audio data,
see here)
When running in 'attribute' mode,
liveCaster uses a multicast channel to 'announce' the contents of a file system
directory (i.e., folder). This directory should contain one or more text files
(with suffix ".txt"), each describing a data record to be announced over the multicast channel. These data records each consist of a set of textual
attributes: (name,value) pairs.
Example 1: Announcing stock prices
In this example, a directory - named "stocks" - contains two files "ACME.txt"
and "RNDM.txt", each describing the stock price of a (hypothetical) company.
Contents of the file "ACME.txt":
info ACME Enterprises, Inc.
high 13.25
low 12.875
last 13.125
time 1/30/1998 3:59pm
Contents of the file "RNDM.txt":
info Random Software Corporation
high 37.5
low 11.25
last ll.25
time 1/30/1998 3:55pm
Example 2: Announcing weather data
In this example, a directory - named "weather" - contains a file "SFO.txt"
describing the current weather conditions in San Francisco.
Contents of the file "SFO.txt":
nickname San Francisco
{current conditions} partly cloudy
tempF 58
Notes
- In each (non-blank) line of the file, the first word (up to white-space)
is the name of an attribute; the remaining words, if any, form
its value. (However, an attribute name containing white-space can be described by enclosing it in braces, as in example 2 above.) Each attribute name
must be followed only by white-space, not a colon or comma.
- The order of attribute lines within a file is unimportant.
- One special attribute - called "nickname" - is defined for every
file. By default, its value is the name of the file, without the ".txt"
suffix. However, the "nickname" attribute can also be redefined explicitly,
as in example 2 above.
- Attributes
of the directory itself are described in a special file called
"SELF.txt". This file is created automatically by liveCaster, but you may
also add more attributes to this file.
You may create and modify these ".txt" files using any method of your choosing.
You could, for example, simply use a text editor.
Alternatively, you could use a separate program - perhaps connected to a
sensor or other data feed - to update these files.
liveCaster will automatically notice when a file has been modified;
it will then start announcing the new attribute value(s).
liveCaster will also notice when new ".txt" files are added, and/or
previously existing ".txt" files are deleted.
At present, liveCaster is intended for multicasting small pieces of textual
information - not large files.
liveCaster will exit with an error message if it sees a ".txt" file that's larger
than a predetermined limit (currently, 2000 bytes).
Specifying a directory to announce
Upon starting liveCaster, you will see a dialog that you can use to navigate to
the directory that you wish to announce.
Once you're inside this directory,
click the "Choose the current directory" button.
(If the directory that you wish to announce does not yet exist, you can create
it - as a subdirectory of the current directory - by clicking the "Create New"
button.)
Alternatively, you can specify the directory to announce by starting liveCaster
with the -d <directory path> command line option.
(<directory path> must be a directory that already exists.)
This option is useful if you wish to launch liveCaster automatically from a script.
Specifying the directory parameters
If the directory is being announced for the first time, you will then
be presented with a second dialog ("Enter directory parameters"),
which will give you the opportunity to set (or change) the network parameters
for the announcement.
This dialog is preset with default values.
If you're happy with these values, click "OK" (or type the
<Enter> or <Return> key).
The parameters are described below:
liveCaster stores these parameters in the directory's
"SELF.txt" file.
When liveCaster is running
In normal operation (after a directory has been selected and its parameters
set up) liveCaster will display a small window,
indicating the directory that is currently being announced.
This window may be minimized (and liveCaster will continue running
in the background).
To exit liveCaster, delete this window, or type
<Control>-q.
Return to the main liveCaster page