Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 18eba68202535bfb374b12fad8e3dd84 > files > 23

lash-0.5.4-13.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on February 8, 2011 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>LASH Audio Session Handler: 6. Client reference</title>

<meta name="description" content="LASH Audio Session Handler: 6. Client reference">
<meta name="keywords" content="LASH Audio Session Handler: 6. Client reference">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Client-reference"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="lash-manual_5.html#Server-interface" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Operational-overview" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual_5.html#Server-interface" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Client-reference-1"></a>
<h1 class="chapter">6. Client reference</h1>

<p>This chapter provides a programming guide and library reference for
programmers of LASH clients.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Operational-overview">6.1 Operational overview</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top"> An overview of how servers and clients operate
</td></tr>
<tr><td align="left" valign="top"><a href="#Types-and-functions">6.2 Types and functions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">  A detailed description of types and function that LASH clients can use
</td></tr>
<tr><td align="left" valign="top"><a href="#Event-protocol">6.3 Event protocol</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">       A detailed description of the protocol used for client/server communication
</td></tr>
</table>

<hr size="6">
<a name="Operational-overview"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Client-reference" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Operational-overview-1"></a>
<h2 class="section">6.1 Operational overview</h2>

<p>In this section we give an overview of how the LASH system operates,
describing the server and client objects and operations that make it
work.  The <code>lashd</code> server must be running in order for clients
to participate in the system; clients cannot interoperate soley between
themselves.  The server maintains a list of connected clients and a list
of projects with which these clients are associated.
</p>
<p>The server and clients exchange events and configs over their connections.
There is one, and only one, bi-directional connection between a client
and the server.  The transport for this connection is currently TCP.
</p>
<p>An <em>event</em> is a very simple object having two relevant properties:
a type and an optional arbitrary character string.  The type defines
what the event means to the recipient, and the string allows additional
information to be included with it.  For example, if a client wishes
the server to save the current project, it sends a <code>LASH_Save</code>
event to the server.  While saving the project, the server may wish to
tell a client to save its data in a certain directory.  To so, it sends
a <code>LASH_Save_File</code> event to the client with a string containing
the name of a directory into which the client should save its data files.
</p>
<p>Clients can save data on the server if they wish.  To do this, the
client declares that it wants to save data on the server when it
initialises the server connection and then later sends one or more
<em>config</em>s to the server.  A config is also a very simple object.
It has a client-unique character string key, and a value of arbitrary
size and type (well, almost arbitrary; its size must be able to be
described by a <code>uint32_t</code> integer due to byte-order conversions
done when sending data over the network.)
</p>
<hr size="6">
<a name="Session-example"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Operational-overview" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Starting-up-the-server" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Operational-overview" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">6.1.1 Session example</h3>

<p>In this section we will examine a typical session in some detail,
describing the server and client operations that take place.  In the
session, the server is started, a number of clients connect, the session
is saved and then restored.
</p>
<hr size="6">
<a name="Starting-up-the-server"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Session-example" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#A-client-connection" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.1.1.1 Starting up the server</h4>

<p>Before all else, the user starts the server.  It starts up and begins
listening for connections from clients.  It doesn&rsquo;t do much else.
</p>
<p>To keep track of what is happening with LASH, the user can run the
<code>lash_panel</code> program (though this is not necessary, and it can
be started later at any time).
</p>
<p>Unless the environment variable <code>LASH_NO_START_SERVER</code> is set any
LASH client will automatically start the server if one isn&rsquo;t already running.
Doing this you can simply run applications normally (e.g. from a terminal or
your Applications menu) and have LASH automatically work without having to
remember to start the server manually.
</p>
<p>Starting the server can also be disabled by specifying the
<code>--lash-no-start-server</code> option on the client&rsquo;s command line.
</p>
<p>If you&rsquo;re using a Bourne compatible shell like <code>bash</code> (if you don&rsquo;t
know, you probably are) you can disable auto-start with the following
command:
</p>
<p><code>export LASH_NO_START_SERVER=1</code>
</p>
<p>Some applications may also choose themselves whether to start the
server (or have a configurable option), however risabling the automatic
start (by any method) is not recommended if you want to gain the benefits of
LASH.  With auto launching enabled you don&rsquo;t need to worry about
LASH until you actually want to save a session.
</p>
<hr size="6">
<a name="A-client-connection"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Starting-up-the-server" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Another-client" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.1.1.2 A client connection</h4>

<p>The user then starts a JACK client program.  It opens a connection
to the server and provides it with all information that the server
will need to run the application again.  This information includes:
the current directory that the user was in when they ran the program,
the command line that started the application and the <em>class</em> of
the client (a character string that the client application provides the
initialisation routine that will never change over all initialisations.)
</p>
<p>With this information is included a set of flags that describe the client
to the server.  This particular client saves data to files and wants
the server to tell it where to save files when the project is saved,
so it has the <code>LASH_Config_File</code> flag set.
</p>
<p>The client library starts two threads for communication with the server,
one for sending data and the other for recieving.  It also sends,
along with the client supplied data, a number of parameters that were
extracted from the client&rsquo;s command line options before it checked them.
This optionally includes the name of the project that the client should
initially be associated with and a 128-bit, world-unique identifier for
this particular client instance (the <em>LASH ID</em>.)
</p>
<p>Server-side, the server wakes up to the fact that a new connection has
arrived and immediately adds it to a list of open connections and then
goes back to waiting.  When the client sends the requisite information,
the server looks at it and decides what to do with the client.
This client has not requested a specific project to which it should
be connected.  However, there are no existing projects so the server
creates a new project with the name &lsquo;<samp>project-1</samp>&rsquo; in the directory
&lsquo;<tt>/home/<var>user</var>/audio-projects/project-1</tt>&rsquo; (assuming the user
didn&rsquo;t specify a different default directory when running configure.)
It also generates a new LASH ID for the client.  It then adds the client
to the new project and goes back to listening.
</p>
<p>If the user has the <code>lash_panel</code> client running, the new project
will appear as a tab with the title &lsquo;<samp>project-1</samp>&rsquo;, and the new client
will appear in the client list for that project.
</p>
<p>The client then connects up to the JACK server and, after having done
this, sends a <code>LASH_Jack_Client_Name</code> event to the server with the
name that it registered to JACK with as the string.  This notifies the
server that it is a JACK client and needs its JACK port connections saved
and restored.  The server will now pay attention to any activity regarding
the client (ie, port creation and destruction and port connection and
disconnection.)
</p>

<hr size="6">
<a name="Another-client"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#A-client-connection" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Saving-the-project" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.1.1.3 Another client</h4>

<p>The user then starts a second client that uses the ALSA sequencer
interface and wishes to save data on the server.  It connects to
the server with a different class to the JACK client and with the
<code>LASH_Config_Data_Set</code> flag set.
</p>
<p>The server sees that this client also didn&rsquo;t specify a project, and so
adds it to the first available project; the same one as the previous
project, &lsquo;<samp>project-1</samp>&rsquo;.  It also sees that the client wants to store
data on the server, and so it creates a directory within the project
directory for this data to be stored in and creates a database-style
object to manage the client&rsquo;s data.
</p>
<p>If the user has the <code>lash_panel</code> client running, both clients
will now be visible in the clients list for &lsquo;<samp>project-1</samp>&rsquo;.
</p>
<p>The client then connects to the ALSA sequencer and sends its
client ID to the server in the first character of the string of a
<code>LASH_Alsa_Client_Name</code> event.  The server regards this similarly
to the other client&rsquo;s JACK client name.
</p>
<hr size="6">
<a name="Saving-the-project"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Another-client" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Client-resumption" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.1.1.4 Saving the project</h4>

<p>After the user has done some work in the two clients, they want to
save their work.  They click the Save button in <code>lash_panel</code>
(or use the <code>save</code> command in <code>lash_control</code>), and a
<code>LASH_Save</code> event is sent to the server.  The server recieves this
and then iterates through each client in the project and checks its flags.
The JACK client saves data by itself (it has the <code>LASH_Config_File</code>
flag set,) so the server creates a directory under the project directory
for it to save in and then sends a <code>LASH_Save_File</code> event to the
client with a string containing the name of the directory it made.
The client recieves the event and saves its data into the specified
directory.
</p>
<p>Next, the server examines the ALSA client.  It wishes to save data on the
server, so the server sends a <code>LASH_Save_Data_Set</code> to the client.
With all of the clients iterated through, it now saves all the information
it needs to be able to restore them; their working directory, command
line options, etc.  In order to do this, it asks the JACK server to
find the connections for the JACK client, and asks the ALSA sequencer to
find the connections for the ALSA client.  It uses the client name and
ID that both clients sent to the server after opening their connections
to the respective systems.  All of this information is stored in a file
under the project&rsquo;s directory.  When this is done, the server goes back
to listening for events and configs.
</p>
<p>The client, meanwhile, has recieved the <code>LASH_Save_Data_Set</code> event
and sends back a number of configs to the server.  When it has sent all
the data it wishes to be saved, it sends back a <code>LASH_Save_Data_Set</code>
event.  The server passes all of the configs to the object managing
the data store for the ALSA client.  When the server recieves the
<code>LASH_Save_Data_Set</code> event from the client, it tells the data store
to write the data to disk.  The save is now complete.
</p>
<hr size="6">
<a name="Client-resumption"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Saving-the-project" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Restoring-the-project" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.1.1.5 Client resumption</h4>

<p>Unfortunately for the user, the ALSA client crashes.  The server detects
that the client has disconnected, and puts the client on a list of lost
clients for the project.  The user then starts another copy of the client,
which connects to the server in the same way it did before.  This time,
however, the server checks through the list of lost clients and finds
that the class of the new client matches the class of the lost client
and so it resumes the lost client using the new one.  It gives it the
128-bit ID of the lost client, adds it to the project, and then sends
a <code>LASH_Restore_Data_Set</code> event to the client.  The client then
cleans itself up, ready to recieve the data set.  The server sends the
client the configs, and then another <code>LASH_Restore_Data_Set</code> event.
The client recieves this data and its state has been restored that of
the client that crashed.
</p>
<p>The user can stop this behaviour by specifying the
&lsquo;<samp>--lash-no-autoresume</samp>&rsquo; option on the client&rsquo;s command line.
</p>
<hr size="6">
<a name="Restoring-the-project"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Client-resumption" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Types-and-functions" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Session-example" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.1.1.6 Restoring the project</h4>

<p>The user has to go off and do other things, and so they close down the
clients and the server.  Some time later, the user comes back and wants
to start working again so first, as always, they start up the server.
They then start the <code>lash_panel</code> program.  Using the File-&gt;Open
menu item, the user selects the directory (not file!) where they saved
the project (by default &lsquo;<tt>~/audio-projects/project-1</tt>&rsquo;, but you
can save to a more descriptive name).  The lash_panel client sends a
<code>LASH_Restore</code> event to the server with the specified directory as
the string.  The server opens the file that it saved before, and reads
in all the information about the project and its clients.  It creates
a new project with this information.  The clients are created as lost
clients, however.
</p>
<p>The server then iterates through each client and starts a new copy of
it using the information provided when the original client connected.
It also adds some command line options that are extracted by the client
library.  These specify the LASH ID of the client, the project name
that it should be connecting to and the server&rsquo;s hostname and port.
It then goes back to waiting.
</p>
<p>The new JACK client then connects to the server as normal.  When the
server recieves it connection, it checks the client against the project&rsquo;s
list of lost clients.  This time, however, it has its ID specified, so
the server will only resume a client with a matching ID.  Lo and behold,
such a client exists.  The server resumes the old JACK client, telling it
to load its state from the files in the project directory that the client
previously stored.  It does so with a <code>LASH_Restore_File</code> event with
the string as the directory name.  The ALSA client does exactly the same,
except having its data restored through <code>LASH_Restore_Data_Set</code>
as described above.
</p>
<p>Only one thing remains for the clients to be fully restored: the JACK and
ALSA sequencer connections.  This happens when the clients send their
<code>LASH_Jack_Client_Name</code> and <code>LASH_Alsa_Client_ID</code> events.
The connections are stored with the LASH ID rather than the JACK client
name or ALSA client ID.  When the client registers its name or ID, the
connections are converted from the LASH ID to the JACK client name or ALSA
client ID, and the connections are restored.  It also pays attention to
connections to other clients within the same project, converting between
JACK client names, ALSA client IDs and LASH IDs as appropriate.
</p>
<hr size="6">
<a name="Types-and-functions"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Restoring-the-project" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Server-interaction" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Types-and-functions-1"></a>
<h2 class="section">6.2 Types and functions</h2>

<hr size="6">
<a name="Server-interaction"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Types-and-functions" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Protocol-versioning-1" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Types-and-functions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">6.2.1 Server interaction</h3>

<dl>
<dt><a name="index-lash_005finit"></a><u>Function:</u> lash_client_t * <b>lash_init</b><i> (lash_args_t * <var>args</var>, const char * <var>client_class</var>, int <var>client_flags</var>, lash_protocol_t <var>protocol</var>)</i></dt>
<dd><p>Open a connection to the server.  Returns <code>NULL</code> on failure.
</p>
<p>The <var>args</var> argument must be obtained using <code>lash_extract_args</code>.
</p>
<p>The <var>client_class</var> argument must be a string that will never change over
invocations of the program.  If using GNU automake, the best way to do this is to use
the <code>PACKAGE_NAME</code> macro that is automatically defined.
</p>
<p>The <var>client_flags</var>
argument should be 0 or bitwise-OR&rsquo;d values from this list:
</p>
<dl compact="compact">
<dt> <code>LASH_Config_Data_Set</code></dt>
<dd><p>The client wishes to save its data use the LASH config system.  See <a href="#Configs">Configs</a> and
<a href="#Event-protocol">Event protocol</a>.
</p></dd>
<dt> <code>LASH_Config_File</code></dt>
<dd><p>The client saves its data to a file.  See section <a href="#Event-protocol">Event protocol</a>.
</p></dd>
<dt> <code>LASH_Server_Interface</code></dt>
<dd><p>The client is a server interface.  See section <a href="#Server-interfaces">Server interfaces</a>.
</p></dd>
<dt> <code>LASH_No_Autoresume</code></dt>
<dd><p>This flag is set by the <code>--lash-no-autoresume</code> command line option and
should not normally be set by clients themselves.
</p></dd>
<dt> <code>LASH_Terminal</code></dt>
<dd><p>The client is dependant on being run in a terminal.
</p></dd>
<dt> <code>LASH_No_Start_Server</code></dt>
<dd><p>Do not attempt to start LASH server.
This flag can be set by the <code>--lash-no-start-server</code> command line option.
</p></dd>
</dl>

<p>The <var>protocol</var> argument should be the version of the high-level protocol that the client
implements See <a href="#Protocol-versioning">Protocol versioning</a> for information on how to contruct a <code>lash_protocol_t</code>
variable. 
</p>
</dd></dl>

<dl>
<dt><a name="index-lash_005fextract_005fargs"></a><u>Function:</u> lash_args_t * <b>lash_extract_args</b><i> (int * <var>argc</var>, char *** <var>argv</var>)</i></dt>
<dd><p>Extract LASH-specific arguments from argc/argv for use in <code>lash_init</code>.  This should be done before the
client checks the arguments, obviously.  Returned object must be cleaned up with lash_args_destroy.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fget_005fserver_005fname"></a><u>Function:</u> const char * <b>lash_get_server_name</b><i> (lash_client_t * <var>client</var>)</i></dt>
<dd><p>Get the hostname of the server.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fget_005fpending_005fevent_005fcount"></a><u>Function:</u> unsigned int <b>lash_get_pending_event_count</b><i> (lash_client_t * <var>client</var>)</i></dt>
<dd><p>Get the number of pending events.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fget_005fevent"></a><u>Function:</u> lash_event_t * <b>lash_get_event</b><i> (lash_client_t * <var>client</var>)</i></dt>
<dd><p>Retrieve an event. The event must be freed using <code>lash_event_destroy</code>.
Returns <code>NULL</code> if there are no events pending.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fget_005fpending_005fconfig_005fcount"></a><u>Function:</u> unsigned int <b>lash_get_pending_config_count</b><i> (lash_client_t * <var>client</var>)</i></dt>
<dd><p>Get the number of pending configs.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fget_005fconfig"></a><u>Function:</u> lash_config_t * <b>lash_get_config</b><i> (lash_client_t * <var>client</var>)</i></dt>
<dd><p>Retrieve a config. The config must be freed using <code>lash_config_destroy</code>.
Returns <code>NULL</code> if there are no configs pending.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fsend_005fevent"></a><u>Function:</u> void <b>lash_send_event</b><i> (lash_client_t * <var>client</var>, lash_event_t * <var>event</var>)</i></dt>
<dd><p>Send an event to the server.  The event must be created using
<code>lash_event_new</code> or <code>lash_event_new_with_type</code>.  The library takes over
ownership of the memory and it should not be freed by the client.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fsend_005fconfig"></a><u>Function:</u> void <b>lash_send_config</b><i> (lash_client_t * <var>client</var>, lash_config_t * <var>config</var>)</i></dt>
<dd><p>Send some configuration data to the server.  The config must be created using
<code>lash_config_new</code>, <code>lash_config_new_with_key</code> or
<code>lash_config_dup</code>.  The library takes
over ownership of the memory (including the key, etc) and it should not be freed by the client.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fenabled"></a><u>Macro:</u> <b>lash_enabled</b><i> (client)</i></dt>
<dd><p>Check whether the lash_client_t pointer <var>client</var> is not <code>NULL</code>, and if it
isn&rsquo;t, that the server is still connected.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fserver_005fconnected"></a><u>Function:</u> int <b>lash_server_connected</b><i> (lash_client_t * <var>client</var>)</i></dt>
<dd><p>Check whether the server is connected.  Returns 1 if the server is still
connected or 0 if it isn&rsquo;t
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fjack_005fclient_005fname"></a><u>Function:</u> void <b>lash_jack_client_name</b><i> (lash_client_t * <var>client</var>, const char * <var>name</var>)</i></dt>
<dd><p>Tell the server the client&rsquo;s JACK client name.  This is a convenience function
that just sends a LASH_Jack_Client_Name event to the server.  See <a href="#Normal-LASH_005fJack_005fClient_005fName">Normal LASH_Jack_Client_Name</a>.
</p></dd></dl>

<p><a name="lash_005falsa_005fclient_005fid"></a>
</p><dl>
<dt><a name="index-lash_005falsa_005fclient_005fid"></a><u>Function:</u> void <b>lash_alsa_client_id</b><i> (lash_client_t * <var>client</var>, unsigned char <var>id</var>);</i></dt>
<dd><p>Tell the server the client&rsquo;s ALSA client ID.  This just is a convenience function that
just sends a LASH_Alsa_Client_ID event to the server.  See <a href="#Normal-LASH_005fAlsa_005fClient_005fID">Normal LASH_Alsa_Client_ID</a>.
</p></dd></dl>

<hr size="6">
<a name="Protocol-versioning-1"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Server-interaction" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Events-1" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Types-and-functions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">6.2.2 Protocol versioning</h3>
<p><a name="Protocol-versioning"></a>
The event protocol (See section <a href="#Event-protocol">Event protocol</a>,) is versioned with a major and minor component.
The <code>lash_protocol_t</code> type represents a version number
in a 32-bit unsigned integer split 16:16.  A protocol is comptible with the server&rsquo;s
protocol if the major numbers are the same and the minor number is less than,
or equal to, the server&rsquo;s minor number (ie, 1.0 is compatible with a server
using 1.0, 1.1 is compatible with a server using 1.3, but neither 2.0 or 1.6 are
compatible with a server using 1.4.  The minor component may be dropped in
the future.
</p>
<dl>
<dt><a name="index-LASH_005fPROTOCOL"></a><u>Macro:</u> <b>LASH_PROTOCOL</b><i> (major, minor)</i></dt>
<dd><p>Contruct a protocol version with a major component <var>major</var> and a minor
component <var>minor</var>.
</p></dd></dl>

<dl>
<dt><a name="index-LASH_005fPROTOCOL_005fGET_005fMAJOR"></a><u>Macro:</u> <b>LASH_PROTOCOL_GET_MAJOR</b><i> (protocol)</i></dt>
<dd><p>Obtain the major component of a <code>lash_protocol_t</code> protocol version.
</p></dd></dl>

<dl>
<dt><a name="index-LASH_005fPROTOCOL_005fGET_005fMINOR"></a><u>Macro:</u> <b>LASH_PROTOCOL_GET_MINOR</b><i> (protocol)</i></dt>
<dd><p>Obtain the minor component of a <code>lash_protocol_t</code> protocol version.
</p></dd></dl>

<dl>
<dt><a name="index-char"></a><u>Function:</u> const <b>char</b><i> * lash_protocol_string (lash_protocol_t <var>protocol</var>)</i></dt>
<dd><p>Obtain a string representation of the protocol version <var>protocol</var>. 
String representations are of the form &ldquo;<var>major</var>.<var>minor</var>&rdquo;.
</p></dd></dl>

<hr size="6">
<a name="Events-1"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Protocol-versioning-1" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Server-interface-events-1" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Types-and-functions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">6.2.3 Events</h3>
<p><a name="Events"></a>
</p>
<dl>
<dt><a name="index-lash_005fevent_005fnew"></a><u>Function:</u> lash_event_t * <b>lash_event_new</b><i> (<var>void</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fnew_005fwith_005ftype"></a><u>Function:</u> lash_event_t * <b>lash_event_new_with_type</b><i> (enum LASH_Event_Type <var>type</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fdestroy"></a><u>Function:</u> void <b>lash_event_destroy</b><i> (lash_event_t * <var>event</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fget_005ftype"></a><u>Function:</u> enum LASH_Event_Type <b>lash_event_get_type</b><i> (const lash_event_t * <var>event</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fget_005fstring"></a><u>Function:</u> const char * <b>lash_event_get_string</b><i> (const lash_event_t * <var>event</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fset_005ftype"></a><u>Function:</u> void <b>lash_event_set_type</b><i>  (lash_event_t * <var>event</var>, enum LASH_Event_Type <var>type</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fset_005fstring"></a><u>Function:</u> void <b>lash_event_set_string</b><i> (lash_event_t * <var>event</var>, const char * <var>string</var>);</i></dt>
</dl>

<hr size="6">
<a name="Server-interface-events-1"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Events-1" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Configs-1" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Events-1" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.2.3.1 Server interface events</h4>
<p><a name="Server-interface-events"></a>
</p>
<p>All events have a LASH ID and project name property.  They are only relevant to server
interfaces, however, which need to refer to clients other than themselves and to projects
(server interfaces are never assigned to a project.)
</p>

<dl>
<dt><a name="index-lash_005fevent_005fget_005fclient_005fid"></a><u>Function:</u> void <b>lash_event_get_client_id</b><i> (const lash_event_t * <var>event</var>, uuid_t <var>id</var>)</i></dt>
<dd><p>The event&rsquo;s client ID property will be copied into <var>id</var>.
</p></dd></dl>

<dl>
<dt><a name="index-lash_005fevent_005fget_005fstring-1"></a><u>Function:</u> const char * <b>lash_event_get_string</b><i> (const lash_event_t * <var>event</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fset_005fclient_005fid"></a><u>Function:</u> void <b>lash_event_set_client_id</b><i>  (lash_event_t * <var>event</var>, enum uuid_t <var>id</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fget_005fproject"></a><u>Function:</u> const char * <b>lash_event_get_project</b><i> (const lash_event_t * <var>event</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fevent_005fset_005fproject"></a><u>Function:</u> void <b>lash_event_set_project</b><i> (lash_event_t * <var>event</var>, const char * <var>project_name</var>);</i></dt>
</dl>


<hr size="6">
<a name="Configs-1"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Server-interface-events-1" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Semi_002dtyped-configs" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Types-and-functions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">6.2.4 Configs</h3>
<p><a name="Configs"></a>
</p>
<dl>
<dt><a name="index-lash_005fconfig_005fnew"></a><u>Function:</u> lash_config_t * <b>lash_config_new</b><i> (<var>void</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fdup"></a><u>Function:</u> lash_config_t * <b>lash_config_dup</b><i> (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fnew_005fwith_005fkey"></a><u>Function:</u> lash_config_t * <b>lash_config_new_with_key</b><i> (const char * <var>key</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fdestroy"></a><u>Function:</u> void <b>lash_config_destroy</b><i> (lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fget_005fkey"></a><u>Function:</u> const char * <b>lash_config_get_key</b><i> (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fget_005fvalue"></a><u>Function:</u> const void * <b>lash_config_get_value</b><i> (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fget_005fvalue_005fsize"></a><u>Function:</u> size_t <b>lash_config_get_value_size</b><i> (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fset_005fkey"></a><u>Function:</u> void <b>lash_config_set_key</b><i> (lash_config_t * <var>config</var>, const char * <var>key</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fset_005fvalue"></a><u>Function:</u> void <b>lash_config_set_value</b><i> (lash_config_t * <var>config</var>, const void * <var>value</var>, size_t <var>value_size</var>)</i></dt>
</dl>

<hr size="6">
<a name="Semi_002dtyped-configs"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Configs-1" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Event-protocol" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Configs-1" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h4 class="subsubsection">6.2.4.1 Semi-typed configs</h4>
<p>With these functions, no type checking is done; you can do
<code>lash_config_get_value_int</code> on a config that was set with
<code>lash_config_set_value_float</code>.  The integer values are converted
to and from network byte order as appropriate.
</p>
<dl>
<dt><a name="index-lash_005fconfig_005fget_005fvalue_005fint"></a><u>Function:</u> uint32_t <b>lash_config_get_value_int</b><i> (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fget_005fvalue_005ffloat"></a><u>Function:</u> float <b>lash_config_get_value_float</b><i>  (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fget_005fvalue_005fdouble"></a><u>Function:</u> double <b>lash_config_get_value_double</b><i>  (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fget_005fvalue_005fstring"></a><u>Function:</u> const char * <b>lash_config_get_value_string</b><i> (const lash_config_t * <var>config</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fset_005fvalue_005fint"></a><u>Function:</u> void <b>lash_config_set_value_int</b><i> (lash_config_t * <var>config</var>, uint32_t <var>value</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fset_005fvalue_005ffloat"></a><u>Function:</u> void <b>lash_config_set_value_float</b><i>  (lash_config_t * <var>config</var>, float <var>value</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fset_005fvalue_005fdouble"></a><u>Function:</u> void <b>lash_config_set_value_double</b><i>  (lash_config_t * <var>config</var>, double <var>value</var>)</i></dt>
</dl>

<dl>
<dt><a name="index-lash_005fconfig_005fset_005fvalue_005fstring"></a><u>Function:</u> void <b>lash_config_set_value_string</b><i> (lash_config_t * <var>config</var>, const char * <var>value</var>)</i></dt>
</dl>


<hr size="6">
<a name="Event-protocol"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Semi_002dtyped-configs" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Normal-clients" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Event-protocol-1"></a>
<h2 class="section">6.3 Event protocol</h2>

<p>This section describes version 2.0 of the event protocol.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Normal-clients">6.3.1 Normal clients</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">     The protocol for normal LASH clients
</td></tr>
<tr><td align="left" valign="top"><a href="#Server-interfaces">6.3.2 Server interfaces</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">  The protocol for server interfaces
</td></tr>
</table>


<hr size="6">
<a name="Normal-clients"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Event-protocol" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Server-interfaces" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Event-protocol" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Normal-clients-1"></a>
<h3 class="subsection">6.3.1 Normal clients</h3>

<p>This section deals with normal clients (as opposed to <a href="#Server-interfaces">Server interfaces</a>.)
</p>
<dl compact="compact">
<dt> <code>LASH_Client_Name</code></dt>
<dd><dl compact="compact">
<dt> <em>To server, non-<code>NULL</code> string</em></dt>
<dd><p>Set the client&rsquo;s user-visible name.
</p></dd>
<dt> <em>To server, <code>NULL</code> string</em></dt>
<dd><p>Request the client&rsquo;s user-visible name.
</p></dd>
<dt> <em>From server</em></dt>
<dd><p>This will only be sent in response to a <code>LASH_Client_Name</code> with a
<code>NULL</code> string.  The string will be <code>NULL</code> if the client has not
set a user-visible name, and the name itself if it has.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Jack_Client_Name</code></dt>
<dd><p><a name="Normal-LASH_005fJack_005fClient_005fName"></a>
</p><dl compact="compact">
<dt> <em>To server, non-<code>NULL</code> string</em></dt>
<dd><p>Tell the server what name the client is connected to JACK with.
Clients should only ever send one non-<code>NULL</code> <code>LASH_Jack_Client_Name</code>
event.  Note that you <em>must</em> send this event <em>after</em> calling
<code>jack_activate()</code>; otherwise, the server will not be able to connect
the client&rsquo;s ports.
</p>
</dd>
<dt> <em>To server, <code>NULL</code> string</em></dt>
<dd><p>Request the client name that the server thinks the client is connected to
JACK with.
</p></dd>
<dt> <em>From server</em></dt>
<dd><p>This will only be sent in response to a <code>LASH_Jack_Client_Name</code> with a
<code>NULL</code> string.  The string will be <code>NULL</code> if the client has not
set a JACK client name, and the client name itself if it has.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Alsa_Client_ID</code></dt>
<dd><p><a name="Normal-LASH_005fAlsa_005fClient_005fID"></a>
To communicate ALSA client IDs within events, use the first character
of a two character string of the form <code>{ <var>id</var>, '\0' }</code> as the
event string.  A
convenience function, <code>lash_alsa_client_id</code>, exists to do this for you
(see <a href="#lash_005falsa_005fclient_005fid">lash_alsa_client_id</a>.)
</p>
<dl compact="compact">
<dt> <em>To server, non-<code>NULL</code> string</em></dt>
<dd><p>Tell the server what ID the client is connected to ALSA with.
Clients should only ever send one non-<code>NULL</code> <code>LASH_Alsa_Client_ID</code>
event.
</p>
</dd>
<dt> <em>To server, <code>NULL</code> string</em></dt>
<dd><p>Request the client ID that the server thinks the client is connected to
ALSA with.
</p></dd>
<dt> <em>From server</em></dt>
<dd><p>This will only be sent in response to a <code>LASH_Alsa_Client_ID</code> with a
<code>NULL</code> string.  The string will be <code>NULL</code> if the client has not
set an ALSA client ID, and a string containing the ALSA client ID as described
above if it has.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Save_File</code></dt>
<dd><dl compact="compact">
<dt> <em>From server</em></dt>
<dd><p>Tell the client to save all its data to files within a specific directory. 
The event string will never be <code>NULL</code> and will contain the name of the
directory in which the client should save its data.  Clients must always
send a <code>LASH_Save_File</code> event back to the server when they have finished
saving their data.  The client should not
rely on the directory existing after it has sent its <code>LASH_Save_File</code>
event back.  It is valid behaviour for a client to save no files within the
directory.  Files should always be overwritten (ie, using the &quot;w&quot; flag
with <code>fopen()</code>,) preferably without user confirmation if you care
for their sanity.
</p></dd>
<dt> <em>From client</em></dt>
<dd><p>Tell the server that the client has finished saving its data within the
directory it was told to.  The string is ignored.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Restore_File</code></dt>
<dd><dl compact="compact">
<dt> <em>From server</em></dt>
<dd><p>Tell the client to load all its data from files within a specific directory. 
The event string will never be <code>NULL</code> and will contain the name of the
directory from which the client should load its data.  Clients must always
send a <code>LASH_Restore_File</code> event back to the server when they have finished
restoring their data.  The client should not
rely on the directory existing after it has sent its <code>LASH_Restore_File</code>
event back. 
</p></dd>
<dt> <em>From client</em></dt>
<dd><p>Tell the server that the client has finished restoring its data from within the
directory it was told to.  The string is ignored.
</p></dd>
</dl>


</dd>
<dt> <code>LASH_Save_Data_Set</code></dt>
<dd><dl compact="compact">
<dt> <em>From server</em></dt>
<dd><p>Tell the client to send all its configuration data to the server with a
number of configs.  The client must always send a <code>LASH_Save_Data_Set</code>
event back to the server when it has finished sending its configs.  The
event string will always be <code>NULL</code>.
</p></dd>
<dt> <em>From client</em></dt>
<dd><p>Tell the server that the client has finished sending its configs to the
server.  The event string is ignored.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Restore_Data_Set</code></dt>
<dd><dl compact="compact">
<dt> <em>From server</em></dt>
<dd><p>Tell the client to immediately expect a stream of configs from the server.
This event will only be sent if there are one or more configs to be sent. 
The event string will always be <code>NULL</code>.  The client must always send
a <code>LASH_Restore_Data_Set</code> back to the server when it has recieved
all of its configs.
</p></dd>
<dt> <em>From client</em></dt>
<dd><p>Tell the server that the client has finished recieving its configs from the
server.  The event string is ignored.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Save</code></dt>
<dd><dl compact="compact">
<dt> <em>From client</em></dt>
<dd><p>Tell the server to save the project that the client is attached to.
</p></dd>
<dt> <em>From server</em></dt>
<dd><p>Never occurs.
</p></dd>
</dl>

</dd>
<dt> <code>LASH_Quit</code></dt>
<dd><dl compact="compact">
<dt> <em>From client</em></dt>
<dd><p>Tell the server to close all clients in the project that the client is attached to.
</p></dd>
<dt> <em>From server</em></dt>
<dd><p>The client should immediately quit without saving.  No more events will be
sent by the server and the client&rsquo;s connection will be terminated.
</p></dd>
</dl>
</dd>
</dl>


<hr size="6">
<a name="Server-interfaces"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Normal-clients" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Event-protocol" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Server-interfaces-1"></a>
<h3 class="subsection">6.3.2 Server interfaces</h3>

<p>Server interfaces are treated very differently to normal interfaces.  Events from and
to server interfaces are, for the most part, in order to describe and manipulate existing
projects and clients.  For this reason, the <code>lash_event_t</code> type has
<code>project</code> and <code>client_id</code> properties which facilitate this.  See <a href="#Server-interface-events">Server interface events</a>.  The <code>project</code> property contains the name of the project.
</p>
<p>A server interface should start up with the default assumption that there are no projects.  Upon
connection, the server will send appropriate events (<code>LASH_Project_Add</code>,
<code>LASH_Client_Add</code>, <code>LASH_Client_Name</code>, etc) that describe the current state of the
system.  From then on, events will be sent to keep the interface up to date with the
server&rsquo;s state.
</p>
<dl compact="compact">
<dt> <code>LASH_Project_Add</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface</em></dt>
<dd><p>Restore a project from an existing directory.  The event string should contain the
directory&rsquo;s name.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>Ignored.
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Ignored.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A new project has been added.  The event string will contain the project&rsquo;s name.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p><code>NULL</code>
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>
</dd>
</dl>



</dd>
<dt> <code>LASH_Project_Remove</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface</em></dt>
<dd><p>Close an open project.  All of the project&rsquo;s clients will be told to quit and the
project will be removed from the server&rsquo;s project list.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project to remove.
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Ignored.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A project has been removed.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project that has been removed.
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>
</dd>
</dl>



</dd>
<dt> <code>LASH_Project_Dir</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface, non-<code>NULL</code> string</em></dt>
<dd><p>Move a project to a different directory.  The directory name should be contained in
the event&rsquo;s string.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project to move.
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>

</dd>
<dt> <em>From interface, <code>NULL</code> string</em></dt>
<dd><p>Request a project&rsquo;s directory.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project whose directory is being requested.
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A declaration of the project&rsquo;s directory; either because it has been requested
or because the project has been moved.  The directory name is contained in
the event&rsquo;s string.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project whose directory is being declared.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>
</dd>
</dl>


</dd>
<dt> <code>LASH_Project_Name</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface</em></dt>
<dd><p>Change a project&rsquo;s name.  The new project name should be contained in the
event&rsquo;s string.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project name to change.
</p></dd>
<dt> <code>client_id</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A project&rsquo;s name has changed.  The new project name is contained in the event&rsquo;s
string.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project name that has changed.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>
</dd>
</dl>


</dd>
<dt> <code>LASH_Client_Add</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface</em></dt>
<dd><p>Should not occur
</p>
</dd>
<dt> <em>From server</em></dt>
<dd><p>A new client has been added.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project that the new client has been added to.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The new client&rsquo;s ID.
</p></dd>
</dl>
</dd>
</dl>



</dd>
<dt> <code>LASH_Client_Name</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface, non-<code>NULL</code> string</em></dt>
<dd><p>Should not occur.
</p>
</dd>
<dt> <em>From interface, <code>NULL</code> string</em></dt>
<dd><p>Request a client&rsquo;s name.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The client&rsquo;s project.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The client&rsquo;s ID.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A declaration of a client&rsquo;s name; either because it has been requested
or because the client set the name.  The name is contained in
the event&rsquo;s string.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The client&rsquo;s project.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The client&rsquo;s ID.
</p></dd>
</dl>
</dd>
</dl>



</dd>
<dt> <code>LASH_Jack_Client_Name</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface, non-<code>NULL</code> string</em></dt>
<dd><p>Should not occur.
</p>
</dd>
<dt> <em>From interface, <code>NULL</code> string</em></dt>
<dd><p>Request a client&rsquo;s JACK client name.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The client&rsquo;s project.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The client&rsquo;s ID.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A declaration of a client&rsquo;s JACK client name; either because it has been requested
or because the client set the name.  The client name is contained in
the event&rsquo;s string.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The client&rsquo;s project.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The client&rsquo;s ID.
</p></dd>
</dl>
</dd>
</dl>



</dd>
<dt> <code>LASH_Alsa_Client_ID</code></dt>
<dd><dl compact="compact">
<dt> <em>From interface, non-<code>NULL</code> string</em></dt>
<dd><p>Should not occur.
</p>
</dd>
<dt> <em>From interface, <code>NULL</code> string</em></dt>
<dd><p>Request a client&rsquo;s ALSA client ID.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The client&rsquo;s project.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The client&rsquo;s LASH ID.
</p></dd>
</dl>

</dd>
<dt> <em>From server</em></dt>
<dd><p>A declaration of a client&rsquo;s ALSA client ID; either because it has been requested
or because the client set the ID.  The ALSA client ID is contained in
the event&rsquo;s string, as desribed in <a href="#Normal-LASH_005fAlsa_005fClient_005fID">Normal LASH_Alsa_Client_ID</a>.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The client&rsquo;s project.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>The client&rsquo;s LASH ID.
</p></dd>
</dl>
</dd>
</dl>



</dd>
<dt> <code>LASH_Percentage</code></dt>
<dd><p>This event exists to provide user feedback on the status of save
operations and perhaps other operations in future.  The server will
first send a percentage of 0, then successive percentages up to and
including 100.  When the operation is complete, the server will send
a percentage of 0 again.
</p>
<dl compact="compact">
<dt> <em>From interface</em></dt>
<dd><p>Should not occur.
</p>
</dd>
<dt> <em>From server</em></dt>
<dd><p>The percentage of completion of the current operation.  The percentage
is sent as a string, derived from <code>sprintf</code>ing an <code>int</code>.
</p><dl compact="compact">
<dt> <code>project</code></dt>
<dd><p>The project whose operation is being described.
</p></dd>
<dt> <code>client ID</code></dt>
<dd><p>Undefined.
</p></dd>
</dl>
</dd>
</dl>

</dd>
</dl>

<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Client-reference" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_7.html#GNU-Free-Documentation-License" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="lash-manual.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="lash-manual_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="lash-manual_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated on <i>February 8, 2011</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
 </font>
 <br>

</p>
</body>
</html>