<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Framerowk for Project/Session management proposal(draft).</TITLE> <META NAME="description" CONTENT="Framerowk for Project/Session management proposal(draft)."> <META NAME="keywords" CONTENT="api"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="api.css"> </HEAD> <BODY > <!--Navigation Panel--> <IMG WIDTH="81" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next_inactive" SRC="/usr/share/latex2html/icons/nx_grp_g.png"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="/usr/share/latex2html/icons/up_g.png"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="/usr/share/latex2html/icons/prev_g.png"> <BR> <BR> <BR> <!--End of Navigation Panel--> <P> <P> <H1 ALIGN="CENTER"><B><U>Framerowk for Project/Session management proposal(draft).</U></B></H1> <P> <H1><A NAME="SECTION00010000000000000000"> <U>Introduction:</U></A> </H1> <P> <H3><A NAME="SECTION00010100000000000000"> Problematic of the IPC distibuted app framework approach:</A> </H3> <P> The Unix environment has allways characterized itself for it's high amount of versatility. This is done by following a philosophy based on ``make small apps, and make them interoperate as much as possible''. Unix has so far achieved this interoperation through pipes and very versatile command line environments. Nowadays, the new APIs found in recent apps also gear for this. A good example is the audio area, where transport APIs such JACK or ALSAseq proovide great interoperatibility between applications. This way, the user is able to do, with many programs interconnected through IPC means, the same as it's done on other plataforms (such as Windows/Mac) with big monolithic programs with follow the host-app approach. The IPC approach gives users and programmers more freedom when writing applications, since it doesnt expect a certain program to run on a specific framework ,host app or library, and frees the ``controller'' programs from tasks such as routing, control and interconnection. However this approach as it is now has a problem; it often becomes hard or almost impossible to keep ``projects'' organized, or as something heterogeneous. Every app saves it's own file format or project files, and many dont even support saving, since they are run from commandline. It is clear that becomes impossible to store a ``project'' in a single file, either a reference or description of what was worked on, or even a simple compressed file containing all the data from the applications, details of api routing, etc which could be zipped and archived for later work, sent to a friend, or just ready for usage in another workstation. <P> <H3><A NAME="SECTION00010200000000000000"> Proposed solution:</A> </H3> <P> This proposal aims to proovide a way to organize the multiple applications managed by the user when working on a project. In other words the aim is to create a workspace where the user can launch as many ``client'' applications as needed from a ``server'' application, which will be able to store and retrieve the configuration of any ``client'' application at the user will. This framework will also be able to save current layout state of all ``clients'' running (including the ones in charge of interconnection) into single project file. Basically the usre will be able to ``suspend'' and ``restore'' sessions at anytime, and in different locations as if it was a simple program status file. The creation of this api also encourages further usage of IPC frameworks by prooviding an easy way of managing complex application interconnection layouts. <P> <H3><A NAME="SECTION00010300000000000000"> Implementation Overview:</A> </H3> <P> The implementation of such system would involve the creation of the following modules: <P> <UL> <LI>Application server. </LI> <LI>Application server interface </LI> <LI>Client library </LI> </UL> <P> <H2><A NAME="SECTION00011000000000000000"> <U>Implementation:</U></A> </H2> <P> <U>Application server:</U> <P> The application server is the program in charge of launching and talking to the applictions. The natural steps for it's usage are the following: <P> <OL> <LI><U>Configure an application entry:</U> This mean defining the file to execute, the parameters and a priority. The priority affects the order in which programs are launched when opening an existing project (ie: server apps first, client apps second and routing apps last). Also for the interface, defining an icon (xpm?) can be useful. </LI> <LI><U>Launching the application:</U> When the user needs an application, it will launch it from the server. There are several reasons why this has to be done this way, instead of launching an application first and register it to the project later. </LI> <LI><U>Configure the applications</U>: If a project was loaded, applications need to be configured, the server will send to the applications the information they need. (This information is supposed to have been previously sent to the server on a previous save). Notice that not all applications need to be use this method. Many applications (and specially the command-line based ones) are configured by passing a command-line parameter at start, and their status wont change over time. For these, the server only needs to save which parameters were passed. An example of such kind of application would be jackd, timidity, or iiwusynth. </LI> <LI><U>Trace the work:</U> While the user works on a project, the application server mantains a log of applications being loaded/quit. It may eventually have autosave features. </LI> <LI><U>Save the work:</U> When the user decies it's time to stop working on the project, it tells the application manager to save the layout. The following basic options should be proovided: <P> <OL> <LI><U>Soft status save:</U> The server will ask the user to save the files individually for each project (if they werent saved, or if they were just loaded.. most apps already keep track of the current working files), then the applications will tell the server which files were being worked on. Applications can decide wether doing this or, (if due to the simplicity of the application, it doesnt save status because not much data is used) send the current status to the server for adding into the project file (a simple special format -xml compatible?- will be proovided for apps to write a status layout). </LI> <LI><U>Project save:</U> The server will ask all the applications to save to a certain directory (and with a specific name?) instead of just performing a normal save, so at least the base project can be contained in a single dir (or file if ziped). </LI> <LI><U>Hard save:</U> This is like a project save, but it includes _all_ the data used, even if it takes large amounts of megabytes of data. Samplers/disk recorders may be asked to save all their tracks/patchsets in use to the project directory. This is good for project backups. Also, for commandline programs which are not state-managed, the server proovides the user with a list of files which are going to be used. </LI> </OL> </LI> <LI><U>Quit:</U> At quit time, the server can deinitialize/quit all the applications in order (inverse priority order) to avoid the user to have to close them one by one. </LI> </OL> <P> <H2><A NAME="SECTION00012000000000000000"> <U>Client library:</U></A> </H2> <P> Applications which are going to be state-managed need will be proovided of a library. This library is intended for reducing the programmer's work to a minimum of just polling commands from the server and calling the respective functions for sending/retrieving data. One thing to be noticed is that the server will need to pass the application (at launch time) information about its name and where to connect to the server (this way multiple projects can be opened), this information will be simply passed through special command line options, which will be grabbed by the library at runtime (api_init), and then argc/argv will be modified as if these parameters didnt exist. <P> <H3><A NAME="SECTION00012100000000000000"> <U>API Function Reference:</U></A> </H3> <P> <H3><A NAME="SECTION00012200000000000000"> <U>Api init/finish:</U></A> </H3> <P> These are called when loading/quiting the app. <P> <TABLE CELLPADDING=3 BORDER="1"> <TR><TH ALIGN="LEFT"><B><U>Function:</U></B></TH> <TH ALIGN="LEFT"><B><U>Description:</U></B></TH> </TR> <TR><TD ALIGN="LEFT">void api_init(int *argc, char *argv[]);</TD> <TD ALIGN="LEFT">Session init, call in your main() function _before_ anything else</TD> </TR> <TR><TD ALIGN="LEFT">void api_finish();</TD> <TD ALIGN="LEFT">Call at exit.</TD> </TR> </TABLE> <P> <H3><A NAME="SECTION00012300000000000000"> <U>Session Management:</U></A> </H3> <P> These take care of communicating with the server. <P> <H3><A NAME="SECTION00012400000000000000"> <TABLE CELLPADDING=3 BORDER="1"> <TR><TH ALIGN="LEFT"><B><U>Function:</U></B></TH> <TH ALIGN="LEFT"><B><U>Description:</U></B></TH> </TR> <TR><TD ALIGN="LEFT">int api_get_current_session(api_session_t *session);</TD> <TD ALIGN="LEFT">Get session object instance - return 0 on success 0 on error</TD> </TR> <TR><TD ALIGN="LEFT">int api_get_event(api_session_t *session,api_event_t *event);</TD> <TD ALIGN="LEFT">Get an event, return 0 on succes 0 on certain error conditions - commands are treated later</TD> </TR> <TR><TD ALIGN="LEFT">int api_get_pending_event_count(api_session_t *session);</TD> <TD ALIGN="LEFT">Returns the pending events count, if 0, no events are pending.</TD> </TR> <TR><TD ALIGN="LEFT">int api_get_configuration_data(api_session_t *session, api_config_t *config);</TD> <TD ALIGN="LEFT">Get configuration data, return 0 on succes 0 on certain error conditions - how to create/read cnfigs is treated later</TD> </TR> <TR><TD ALIGN="LEFT">int api_send_configuration_data(api_session_t *session, api_config_t *config);</TD> <TD ALIGN="LEFT">Send configuration data to server, return 0 on certain error conditions - how to create/read configs is treated later</TD> </TR> <TR><TD ALIGN="LEFT">char * api_get_working_project_directory(api_session_t);</TD> <TD ALIGN="LEFT">Ask the api for the working directory to where saving files, NULL</TD> </TR> </TABLE>E<U>Event:</U></A> </H3> <P> One can get info about the event with this function, for example, the event type may be something like ``load project'',``save small'', ``save medium'', ``save big'', ``server requests, quit'', etc. I think it has to be better defined what exactly goes here. <P> <TABLE CELLPADDING=3 BORDER="1"> <TR><TH ALIGN="CENTER"><B><U>Function:</U></B></TH> <TH ALIGN="CENTER"><B><U>Description:</U></B></TH> </TR> <TR><TD ALIGN="CENTER">api_event_type_t api_get_event_type(api_event_t *event);</TD> <TD ALIGN="CENTER">Get event type, so far should return events for loading,saving data (location/project/all), quit and alive check notifications</TD> </TR> </TABLE> <P> <H3><A NAME="SECTION00012500000000000000"> <U>Config:</U></A> </H3> <P> I think the config_t should be treated like something xmlish, using some xml lib. Is this the best way? <H1><A NAME="SECTION00020000000000000000"> About this document ...</A> </H1> <STRONG><B><U>Framerowk for Project/Session management proposal(draft).</U></B></STRONG><P> This document was generated using the <A HREF="http://www-texdev.mpce.mq.edu.au/l2h/docs/manual/"><STRONG>LaTeX</STRONG>2<tt>HTML</tt></A> translator Version 2K.1beta (1.48) <P> Copyright © 1993, 1994, 1995, 1996, <A HREF="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos Drakos</A>, Computer Based Learning Unit, University of Leeds. <BR> Copyright © 1997, 1998, 1999, <A HREF="http://www.maths.mq.edu.au/~ross/">Ross Moore</A>, Mathematics Department, Macquarie University, Sydney. <P> The command line arguments were: <BR> <STRONG>latex2html</STRONG> <TT>-split 0 api.tex</TT> <P> The translation was initiated by Juan Rojo on 2002-07-23<HR> <!--Navigation Panel--> <IMG WIDTH="81" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next_inactive" SRC="/usr/share/latex2html/icons/nx_grp_g.png"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="/usr/share/latex2html/icons/up_g.png"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="/usr/share/latex2html/icons/prev_g.png"> <BR> <!--End of Navigation Panel--> <ADDRESS> Juan Rojo 2002-07-23 </ADDRESS> </BODY> </HTML>