Set mlt_log level verbose in test mode.
[melted] / docs / libmvcp.txt
1 MLT libmvcp API Documentation 
2
3 Copyright (C) 2004-2009 Ushodaya Enterprised Limited 
4 Author: Charles Yates <charles.yates@pandora.be> 
5 Last Revision: 2009-05-15
6
7
8 TABLE OF CONTENTS
9 -----------------
10
11         0. Overview 
12         0.1. Intended Audience
13         0.2. Terminology
14         1. Definition of a Parser 
15         1.1. Construction of a Local Parser 
16         1.2. Construction of a Remote Parser
17         1.3. Using the Parser
18         1.4. Closing the Parser
19         2. The High Level Parser Wrapper
20         2.1. Connecting
21         2.2. mvcp_error_code
22         2.3. Using the High Level Wrapper
23         2.4. Obtaining Directory Contents
24         2.5. Obtaining the Node List
25         2.6. Obtaining the Unit List
26         2.7. Unit Status Information
27         2.8. Server Side Queuing APIs
28         2.9. Accessing the Low Level Parser Directly
29         2.10. Cleaning up
30         2.11. Examples
31         3. The Low Level Parser API
32         3.1. Executing a Command
33         3.2. Interpreting mvcp_response
34         3.3. Accessing Unit Status
35         APPENDIX A - COMPILATION AND LINKING
36         APPENDIX B - COMPLETE HIGH LEVEL PARSER WRAPPER API LISTING
37         APPENDIX C - COMPLETE LOW LEVEL PARSER API LISTING
38         APPENDIX D - REFERENCES
39         
40
41 0. Overview 
42 -----------
43
44         This document details how applications interface to MVCP functionality. 
45
46
47 0.1. Intended Audience
48 ----------------------
49
50         This document draws heavily upon the MVCP design (1) and assumes a basic 
51         knowledge of the functionality provided by the MVCP core. 
52
53         It is aimed at developers who wish to use or maintain the API.
54
55
56 0.2. Terminology
57 ----------------
58
59         The API is designed to allow client applications the ability to communicate
60         to a standalone melted server or entirely embed the MVCP core in an 
61         instance of a client application. 
62
63         The distinction between the two is defined by the construction of the 
64         'parser'. 
65
66         This 'parser' can be used to issue MVCP commands and receive responses and 
67         a 'high level parser wrapper' is provided to simplify the usage and 
68         decouple the application from the MVCP command set.
69
70
71 1. Definition of a Parser 
72 ------------------------- 
73
74         The parser provides a low level API which allows text MVCP commands to be 
75         executed with responses being returned to the caller. Commands and 
76         responses are ASCII formatted text. 
77
78         Two parsers are provided - local and remote. 
79
80         The local parser is the physical implementation which takes commands and 
81         executes them. 
82
83         The remote parser is a network abstraction that forwards commands to a 
84         melted instance that hosts a local parser. 
85
86
87 1.1. Construction of a Local Parser 
88 ----------------------------------- 
89
90         To construct a local parser you must have:
91
92             #include <melted/melted_local.h>
93
94         and code to initialise the parser is as follows:
95
96             mvcp_parser parser = melted_parser_init_local( );
97
98         See Appendix A for compilation and linking details.
99
100
101 1.2. Construction of a Remote Parser
102 ------------------------------------
103
104         To construct a remote parser you must have:
105
106             #include <mvcp/mvcp_remote.h>
107
108         and code to initialise the parser is as follows:
109
110             mvcp_parser parser = mvcp_parser_init_remote( "server", port );
111
112         See Appendix A for compilation and linking details.
113
114
115 1.3. Using the Parser
116 ---------------------
117
118         Although the parser can be used directly to send commands and receive 
119         responses, this low level usage puts the onus on the developer to parse the 
120         responses in a meaningful way. 
121
122         Although this usage is not strictly forbidden by applications, it is 
123         discouraged as construction of commands and meaningful parsing of responses 
124         leads to the clients being unnecessarily dependent on the servers input and 
125         output. 
126
127         As a result, a higher level Parser Wrapper API is provided - this API 
128         encapsulates the command construction and response parsing.
129
130         The following 2 sections provide details on these modes of access.
131
132
133 1.4. Closing the Parser
134 -----------------------
135
136         Regardless of use, it is the constructors responsibility to close the 
137         parser before it goes out of scope. This is done via:
138
139             mvcp_parser_close( parser );
140
141
142 2. The High Level Parser Wrapper
143 --------------------------------
144
145         The recommended way to access the parser, is via the mvcp API. To use 
146         this API, you must have:
147
148             #include <mvcp/mvcp.h>
149
150         and code to construct the wrapper is:
151
152             mvcp client = mvcp_init( parser );
153
154         Note that either remote or local parsers can be used here and there is no 
155         difference in usage, though some error returns will not be applicable to 
156         both. 
157
158         It is recommended that applications honour and deal with the error returns 
159         of both as this allows applications to interchange parsers.
160
161         Also note that mvcp is not threadsafe, so you should not use the same 
162         structure in multiple threads. The correct solution to this is to create a
163         mvcp per thread - you may safely use the same parser for each thread ie:
164
165             /* mvcp for the application */
166             mvcp client = mvcp_init( parser );
167             /* mvcp for the status handling thread. */
168             mvcp client_status = mvcp_init( parser );
169
170         For the purposes of simplification, the remainder of this section assumes 
171         that a remote parser is in use. 
172
173
174 2.1. Connecting
175 ---------------
176
177         Once constructed, the next thing to do is 'connect':
178
179             mvcp_error_code error = mvcp_connect( client );
180
181         This function call initialises the parser (ie: if it's remote, it 
182         establishes a connection to the server, or if it's local, it initialises 
183         the state of the units and supporting objects).
184
185         Note that if you have multiple mvcp instances on the same parser you 
186         should only connect one of the instances.
187
188
189 2.2. mvcp_error_code
190 ----------------------
191
192         All but a couple of the functions that make up the mvcp API return a 
193         mvcp_error_code.
194
195         These are defined as follows:
196
197             mvcp_ok = 0,
198             mvcp_malloc_failed,
199             mvcp_unknown_error,
200             mvcp_no_response,
201             mvcp_invalid_command,
202             mvcp_server_timeout,
203             mvcp_missing_argument,
204             mvcp_server_unavailable,
205             mvcp_unit_creation_failed,
206             mvcp_unit_unavailable,
207             mvcp_invalid_file,
208             mvcp_invalid_position
209
210         In most cases, it is sufficient to check on a return of mvcp_ok.
211
212         To obtain a textual description of a particular error, you can use:
213
214             char *mvcp_error_description( mvcp_error_code );
215
216
217 2.3. Using the High Level Wrapper
218 ---------------------------------
219
220         The following code snippet assumes that client is an initialised and connected 
221         mvcp structure:
222
223             mvcp_error_code error = mvcp_unit_play( client, 0 );
224             if ( error == mvcp_ok )
225                 fprintf( stderr, "Unit 0 is now playing\n" );
226             else
227                 fprintf( stderr, "Play on unit 0 failed: %s\n",
228                              mvcp_error_description( error ) );
229
230         The complete interface to mvcp is listed in Appendix B of this document.
231
232
233 2.4. Obtaining Directory Contents
234 --------------------------------
235
236         To obtain a list of files and subdirectories in a given directory relative 
237         to the ROOT property of the server, MVCP provides the CLS command. 
238
239         A valid execution of CLS would be something like:
240
241             CLS "/Stuff"
242
243         would provide a response formatted as follows:
244
245             201 OK
246             "More Stuff/"
247             "file0001.dv" 15552000
248             "file0002.dv" 15552000
249
250         with a trailing empty line.
251
252         The first line indicates the error value, the second line shows an example 
253         of a subdirectory and the 3rd and 4th line lists two files that happen to 
254         exist in the directory.
255
256         mvcp provides a high level view on this which automatically parses the 
257         response from the server correctly via the mvcp_dir structures and 
258         related functions. 
259
260         An example of use is as follows:
261         
262             mvcp_dir dir = mvcp_dir_init( client, "/Stuff" );
263             mvcp_error_code error = mvcp_dir_get_error_code( dir );
264             if ( error == mvcp_ok )
265             {
266                 if ( mvcp_dir_count( dir ) > 0 )
267                 {
268                     mvcp_dir_entry_t entry;
269                     int index = 0;
270                     for ( index = 0; index < mvcp_dir_count( dir ); index ++ )
271                     {
272                         mvcp_dir_get( dir, index, &entry );
273                         if ( entry.dir )
274                             printf( "<%s>\n", entry.name );
275                         else
276                             printf( "%30s %8d", entry.name, entry.size );
277                     }
278                 }
279                 else
280                 {
281                     fprintf( stderr, "Directory is empty\n" );
282                 }
283             }
284             else
285             {
286                 fprintf( stderr, "Directory listing failed: %s\n",
287                                  mvcp_error_description( error ) );
288             }
289             mvcp_dir_close( dir );
290
291         Note that entry.name provides the name of the file or directory without the 
292         directory prefix. As a convenience, entry.full provides the prefixed name, 
293         so you could subsequently use:
294
295             error = mvcp_unit_load( client, 0, entry.full );
296
297         to load unit 0 with an entry.
298
299
300 2.5. Obtaining the Node List
301 ----------------------------
302
303         Currently not defined by melted.
304
305 2.6. Obtaining the Unit List
306 ----------------------------
307
308         To obtain a list of defined units, MVCP provides the ULS command.
309         
310         A valid execution of ULS would be:
311         
312             ULS
313         
314         and would provide a response formatted as follows:
315         
316             201 OK
317             U0 00 sdl:360x288 1
318         
319         with a trailing empty line.
320         
321         The fields of each record in the response dictate unit, node, mlt consumer and 
322         online status respectively.
323         
324         mvcp provides a high level view on this which automatically parses the 
325         response from the server correctly via the mvcp_units structures and 
326         related functions. 
327         
328         An example of use is as follows:
329         
330             mvcp_units units = mvcp_units_init( client );
331             mvcp_error_code error = mvcp_units_get_error_code( units );
332             if ( error == mvcp_ok )
333             {
334                 if ( mvcp_units_count( units ) > 0 )
335                 {
336                     mvcp_unit_entry_t entry;
337                     int index = 0;
338                     for ( index = 0; index < mvcp_units_count( units ); index ++ )
339                     {
340                         mvcp_units_get( units, index, &entry );
341                         printf( "U%d %02d %s %s\n", 
342                                 entry.unit,
343                                 entry.node,
344                                 entry.guid,
345                                 entry.online ? "online" : "offline" );
346                     }
347                 }
348                 else
349                 {
350                     fprintf( stderr, "Unit list is empty\n" );
351                 }
352             }
353             else
354             {
355                 fprintf( stderr, "Unit listing failed: %s\n",
356                                  mvcp_error_description( error ) );
357             }
358             mvcp_units_close( units );
359         
360
361 2.7. Unit Status Information
362 ----------------------------
363
364         There are two methods for a client to obtain unit status information.
365         
366         The first is via the MVCP USTA command, which would normally be accessed 
367         via: 
368
369             USTA U0
370         
371         and would provide a response formated as follows:
372         
373             202 OK
374             0 playing "a.dv" 58 1000 25.00 0 6999 7000 "a.dv" 157 0 6999 7000 1 4 0
375         
376         with no trailing empty line.
377         
378         The entries in the record are:
379         
380         * Unit
381         * State (undefined, offline, not_loaded, stopped, playing, 
382                  paused, disconnected [when server dies])
383         * Name of Clip
384         * Position in clip
385         * Speed * 1000
386         * Frames per second
387         * Start of clip (in point)
388         * End of clip (out point)
389         * Length of clip
390         * Read ahead clip
391         * Read ahead position 
392         * Read ahead clip in
393         * Read ahead clip out
394         * Read ahead clip length
395         * Seekable flag
396         * Playlist generation
397         * Clip index
398         
399         Again, mvcp provides a high level means for obtaining this via the 
400         mvcp_unit_status function and mvcp_status structures:
401         
402             mvcp_status_t status;
403             mvcp_error_code error = mvcp_unit_status( client, 0, &status );
404             if ( error == mvcp_ok )
405             {
406                 switch( status.status )
407                 {
408                     case unit_offline:
409                         printf( "offline   " );
410                         break;
411                     case unit_undefined:
412                         printf( "undefined " );
413                         break;
414                     case unit_not_loaded:
415                         printf( "unloaded  " );
416                         break;
417                     case unit_stopped:
418                         printf( "stopped   " );
419                         break;
420                     case unit_playing:
421                         printf( "playing   " );
422                         break;
423                     default:
424                         printf( "unknown   " );
425                         break;
426                 }
427         
428                 printf( "%06lld %06lld %06lld %s\n", status.in,
429                                                      status.position,
430                                                      status.out,
431                                                      status.clip );
432             }
433             else
434             {
435                 fprintf( stderr, "Unit status failed: %s\n",
436                                  mvcp_error_description( error ) );
437             }
438         
439         The second approach for obtaining a units status is via automatic 
440         notification.
441         
442         This is done via the mvcp_notifier API. To obtain the notifier from the 
443         high level API, you can use:
444         
445             mvcp_notifier notifier = mvcp_get_notifier( client );
446         
447         To obtain the last status associated to a unit, you can use:
448         
449             int unit = 1;
450             mvcp_status_t status;
451             mvcp_notifier_get( notifier, &status, unit );
452         
453         To wait for the next status from any unit, you can use:
454         
455             mvcp_notifier_wait( notifier, &status );
456         
457         If you wish to trigger the action associated to your applications wait 
458         handling of a particular unit, you can use:
459         
460             mvcp_notifier_get( notifier, &status, unit );
461             mvcp_notifier_put( notifier, &status );
462         
463         See Examples below for details on this.
464
465         The complete list of fields in the status structure are:
466
467             int unit;
468             unit_status status;
469             char clip[ 2048 ];
470             int64_t position;
471             int speed;
472             double fps;
473             int64_t in;
474             int64_t out;
475             int64_t length;
476             char tail_clip[ 2048 ];
477             int64_t tail_position;
478             int64_t tail_in;
479             int64_t tail_out;
480             int64_t tail_length;
481             int seekable;
482             int generation;
483             int clip_index;
484         
485         You will always receive a status record for every frame output.
486
487         The read ahead information is provided for client side queuing. Client side
488         queuing assumes that uset eof=pause is applied to the unit. A client can 
489         detect when the previously scheduled clip is played out by using the read 
490         ahead information and schedule the next clip. While this mode of operation
491         is still supported, it is recommended that new clients use the server side
492         queuing mechanism which is described in the following section.
493         
494
495 2.8. Server Side Queueing APIs
496 ------------------------------
497
498         This section describes the APIs available to provide server side queueing. 
499         
500         The concept is that each unit maintains its own playlist, containing multiple
501         clips. Associated to the playlist is a generation number which is incremented 
502         on each modification to the playlist. The current playlist generation is
503         provided in the status record in order for a client to know when to refresh
504         its presentation of the list. The status record also indicates which clip is 
505         currently active.
506         
507         Actions that can be carried out on the playlist are summarised as:
508         
509         * list - list all the clips and associated in/out points and size
510         * loading a clip - a load will wipe the current list and replace it with the
511           specified clip
512         * appending a clip - append will always place the specified clip at the end 
513           of the playlist
514         * inserting a clip - insert will place a new clip at the specified position 
515           in the playlist
516         * moving a clip - move will allow clips can be moved in the playlist
517         * removing a clip - remove will remove the specified clip from the playlist
518         * clean - clean will remove all but the playing clip from the playlist
519         
520         Additionally, the following existing actions are clip aware:
521         
522         * goto allows you to move the current play position to a specific clip position
523         * set in/out points allows you to modify clip in and out points
524         
525         Backward compatability has been maintained by the addition of a clip-aware 
526         family of APIs which have the naming convention of mvcp_unit_clip_*.
527         
528         These are listed in Appendix B.
529         
530         The following shows an example of obtaining the clips queued on unit 0:
531         
532             mvcp_list list = mvcp_list_init( client, 0 );
533             mvcp_list_entry_t entry;
534             int index;
535             
536             printf( "Generation = %d\n", list->generation );
537             for ( index = 0; index < mvcp_list_count( list ); index ++ )
538             {
539                 mvcp_list_get( list, index, &entry );
540                 printf( "%d %s %d %d %d %d\n", 
541                         entry.clip, 
542                         entry.full,
543                         entry.in,
544                         entry.out,
545                         entry.max,
546                         entry.size );
547             }
548             mvcp_list_close( list );
549             
550         To load a clip on unit 0:
551         
552             mvcp_unit_load( client, 0, "/path/clip.dv" );
553             
554         To append a clip on unit 0:
555         
556             mvcp_unit_append( client, 0, "/path/clip.dv", -1, -1 );
557             
558         Note that the last two arguments specify the in and out points of the clip
559         with -1 denoting dfaults of the entirety of the file.
560         
561         To insert a clip at position 0 on unit 0, we can use the following:
562         
563             mvcp_unit_clip_insert( client, 0, clip_absolute, 0, "/path/clip.dv", -1, -1 );
564             
565         The 3rd and 4th arguments here are common to all the mvcp_unit_clip functions.
566         They take the form of either [clip_absolute, n] to indicate an absolute clip
567         index, or [clip_relative, n] to indicate a clip index relative to the 
568         currently playing clip.
569         
570         So, to insert a clip immediately before the currently playing clip, we can
571         use:
572         
573             mvcp_unit_clip_insert( client, 0, clip_relative, -1, "/path/clip.dv", -1, -1 );
574             
575         To move the current clip to the next position in the list:
576         
577             mvcp_unit_clip_move( client, 0, clip_relative, 0, clip_relative, 1 );
578             
579         To remove a specific clip:
580         
581             mvcp_unit_clip_remove( client, 0, clip_absolute, index );
582             
583         To remove all but the currently playing clip:
584         
585             mvcp_unit_clean( client, 0 );
586             
587         To goto the first frame in the first clip, you can use:
588         
589             mvcp_unit_clip_goto( client, 0, clip_absolute, 0, 0 );
590             
591         To set the in and out points on the current clip:
592         
593             mvcp_unit_clip_set_in( client, 0, clip_relative, 0, 0 );
594             mvcp_unit_clip_set_out( client, 0, clip_relative, 0, 1000 );
595             
596         A more complete example of use of the server side can queuing can be found
597         at:
598         
599             http://users.pandora.be/acp/rugen
600             
601         The demo client provided with mvcp is used for retaining backward 
602         compatability with the client side queuing API.
603
604         
605 2.9. Accessing the Low Level Parser Directly
606 --------------------------------------------
607
608         The low level parser and its associated structures can be accessed directly 
609         from the high level API, but is very occasionally actually needed.
610         
611         The methods are provided via a pair of high level methods:
612         
613             mvcp_error_code error = mvcp_execute( client, 1024, "USTA U%d", unit );
614             mvcp_response response = mvcp_get_last_response( client );
615             int index = 0;
616             for ( index = 0; index < mvcp_response_count( response ); index ++ )
617                 printf( "%d: %s\n", index, mvcp_response_get_line( response,index ) );
618         
619         More details on the mvcp_response structure can be found in section 3 of this
620         document.
621         
622
623 2.10. Cleaning up
624 -----------------
625
626         Before the mvcp and parser go out of scope, you need to run:
627         
628             mvcp_close( client );
629             mvcp_parser_close( parser );
630         
631         Note that you should close all mvcp instances before closing the parser.
632         
633
634 2.11. Examples
635 --------------
636
637         Please refer to mvcp-console and mvcp-client source for examples provided with
638         the project. Rugen is another example:
639  
640                 http://users.pandora.be/acp/rugen
641
642
643 3. The Low Level Parser API
644 ---------------------------
645
646         The low level parser API provides a very simple mechanism for constructing 
647         commands and receiving responses.
648         
649         As described in section 2, a parser is constructed as local or remote and 
650         this is sufficient for constructing the low level parser.
651         
652
653 3.1. Executing a Command
654 ------------------------
655
656         All commands can be executed via the single variable argument function
657         mvcp_parser_executef and this function returns a mvcp_response, ie:
658         
659             mvcp_response response = mvcp_parser_executef( parser, "CLS \"%s\"", dir );
660         
661         Note that no carriage return/line feed is required (adding this is 
662         erroneous).
663         
664         It is the receiver of the response who is responsible for closing it.
665         
666             mvcp_response_close( response );
667         
668
669 3.2. Interpreting mvcp_response
670 -----------------------------
671
672         The response received can be NULL, but it is safe to call:
673         
674             int error = mvcp_response_get_error_code( response );
675         
676         which will return:
677         
678         * -1 if response is NULL, 
679         * -2 if there is no content to the response, 
680         * 0 if the responses first line does not correspond to a valid MVCP response
681         * or the MVCP protocol error code returned on the first line of the response
682         
683         A simple use of a mvcp_response structure is as follows:
684         
685             mvcp_response response = mvcp_parser_executef( parser, "CLS \"%s\"", dir );
686             int error = mvcp_response_get_error_code( response );
687             if ( error >= 0 )
688             {
689                 int index = 0;
690                 for ( index = 0; index < mvcp_response_count( response ); index ++ )
691                     printf( "%3d: %s\n", index, mvcp_response_get_line( response, index ) );
692             }
693             else
694             {
695                 /* interpret error */
696             }
697             mvcp_response_close( response );
698         
699         Note that it is safe to call mvcp_response_close regardless of the error 
700         condition indicated.
701         
702
703 3.3. Accessing Unit Status
704 --------------------------
705
706         As with the high level parser, there are two alternatives to obtain unit 
707         status information - either via the USTA MVCP command or via the 
708         mvcp_notifier.
709         
710         The latter is the recommended way for any applications which wish to extract
711         meaningful information from the status while avoiding the requirement to 
712         duplicate the parsing process in a specific client.
713         
714         The notifier can be obtained by:
715         
716         mvcp_notifier notifier = mvcp_parser_get_notifier( parser );
717         
718         The use of the notifier with the low level parser is identical to that 
719         dictated in Section 2 - to obtain the last status associated to a unit, 
720         you can use: 
721
722             int unit = 1;
723             mvcp_status_t status;
724             mvcp_notifier_get( notifier, &status, unit );
725             
726         To wait for the next status from any unit, you can use:
727         
728             mvcp_notifier_wait( notifier, &status );
729         
730
731 APPENDIX A - COMPILATION AND LINKING
732 ------------------------------------
733
734         Compilation flags are:
735
736             -I <prefix>/include
737
738         where prefix defaults to /usr/local.
739
740         Linking flags for a client are:
741
742             -L <prefix>/lib/ -lmvcp
743
744         Or for a local parser:
745
746             -L <prefix>/lib/ -lmelted
747
748         Note that you never need both libs.
749
750
751 APPENDIX B - COMPLETE HIGH LEVEL PARSER WRAPPER API LISTING
752 -----------------------------------------------------------
753
754         mvcp mvcp_init( mvcp_parser );
755         
756         mvcp_error_code mvcp_connect( mvcp );
757         
758         mvcp_error_code mvcp_set( mvcp, char *, char * );
759         mvcp_error_code mvcp_get( mvcp, char *, char *, int );
760         
761         mvcp_error_code mvcp_unit_add( mvcp, char * );
762         mvcp_error_code mvcp_unit_load( mvcp, int, char * );
763         mvcp_error_code mvcp_unit_load_clipped( mvcp,int,char *,long,long );
764         mvcp_error_code mvcp_unit_load_back( mvcp, int, char * );
765         mvcp_error_code mvcp_unit_load_back_clipped(mvcp,int,char *,long,long)
766         mvcp_error_code mvcp_unit_play( mvcp, int );
767         mvcp_error_code mvcp_unit_play_at_speed( mvcp, int, int );
768         mvcp_error_code mvcp_unit_stop( mvcp, int );
769         mvcp_error_code mvcp_unit_pause( mvcp, int );
770         mvcp_error_code mvcp_unit_rewind( mvcp, int );
771         mvcp_error_code mvcp_unit_fast_forward( mvcp, int );
772         mvcp_error_code mvcp_unit_step( mvcp, int, int );
773         mvcp_error_code mvcp_unit_goto( mvcp, int, int );
774         mvcp_error_code mvcp_unit_set_in( mvcp, int, int );
775         mvcp_error_code mvcp_unit_set_out( mvcp, int, int );
776         mvcp_error_code mvcp_unit_clear_in( mvcp, int );
777         mvcp_error_code mvcp_unit_clear_out( mvcp, int );
778         mvcp_error_code mvcp_unit_clear_in_out( mvcp, int );
779         mvcp_error_code mvcp_unit_set( mvcp, int, char *, char * );
780         mvcp_error_code mvcp_unit_get( mvcp, int, char * );
781         
782         mvcp_error_code mvcp_unit_status( mvcp, int, mvcp_status );
783         mvcp_notifier mvcp_get_notifier( mvcp );
784         
785         mvcp_dir mvcp_dir_init( mvcp, char * );
786         mvcp_error_code mvcp_dir_get( mvcp_dir, int, mvcp_dir_entry );
787         int mvcp_dir_count( mvcp_dir );
788         void mvcp_dir_close( mvcp_dir );
789         
790         mvcp_nodes mvcp_nodes_init( mvcp );
791         mvcp_error_code mvcp_nodes_get(mvcp_nodes,int,mvcp_node_entry);
792         int mvcp_nodes_count( mvcp_nodes );
793         void mvcp_nodes_close( mvcp_nodes );
794         
795         mvcp_units mvcp_units_init( mvcp );
796         mvcp_error_code mvcp_units_get(mvcp_units,int,mvcp_unit_entry);
797         int mvcp_units_count( mvcp_units );
798         void mvcp_units_close( mvcp_units );
799         
800         mvcp_response mvcp_get_last_response( mvcp );
801         
802         mvcp_error_code mvcp_execute( mvcp, size_t, char *, ... );
803         
804         void mvcp_close( mvcp );
805         
806         Notifier Functions
807         ------------------
808         
809         void mvcp_notifier_get( mvcp_notifier, mvcp_status, int );
810         void mvcp_notifier_put( mvcp_notifier, mvcp_status );
811         int mvcp_notifier_wait( mvcp_notifier, mvcp_status );
812         void mvcp_notifier_close( mvcp_notifier );
813         
814         Server Side Queuing
815         -------------------
816
817         mvcp_list mvcp_list_init( mvcp, int )
818         mvcp_error_code mvcp_list_get_error_code( mvcp_list )
819         mvcp_error_code mvcp_list_get( mvcp_list, int, mvcp_list_entry )
820         int mvcp_list_count( mvcp_list )
821         void mvcp_list_close( mvcp_list )
822         
823         mvcp_error_code mvcp_unit_clean( mvcp client, int unit )
824         mvcp_error_code mvcp_unit_append( mvcp client, int unit, char *file, int in, int out )
825         mvcp_error_code mvcp_unit_remove_current_clip( mvcp client, int unit )
826         
827         mvcp_error_code mvcp_unit_clip_goto( mvcp client, int unit, mvcp_clip_offset offset, int clip, int position )
828         mvcp_error_code mvcp_unit_clip_set_in( mvcp client, int unit, mvcp_clip_offset offset, int clip, int in )
829         mvcp_error_code mvcp_unit_clip_set_out( mvcp client, int unit, mvcp_clip_offset offset, int clip, int in )
830         mvcp_error_code mvcp_unit_clip_move( mvcp client, int unit, mvcp_clip_offset offset, int src, mvcp_clip_offset offset, int dest )
831         mvcp_error_code mvcp_unit_clip_remove( mvcp client, int unit, mvcp_clip_offset offset, int clip )
832         mvcp_error_code mvcp_unit_clip_insert( mvcp client, int unit, mvcp_clip_offset offset, int clip, char *file, int in, int out )
833
834         
835
836 APPENDIX C - COMPLETE LOW LEVEL PARSER API LISTING
837 --------------------------------------------------
838
839         mvcp_response mvcp_parser_connect( mvcp_parser );
840         mvcp_response mvcp_parser_execute( mvcp_parser, char * );
841         mvcp_response mvcp_parser_executef( mvcp_parser, char *, ... );
842         mvcp_response mvcp_parser_run( mvcp_parser, char * );
843         mvcp_notifier mvcp_parser_get_notifier( mvcp_parser );
844         void mvcp_parser_close( mvcp_parser );
845         
846         mvcp_response mvcp_response_init( );
847         mvcp_response mvcp_response_clone( mvcp_response );
848         int mvcp_response_get_error_code( mvcp_response );
849         char *mvcp_response_get_error_string( mvcp_response );
850         char *mvcp_response_get_line( mvcp_response, int );
851         int mvcp_response_count( mvcp_response );
852         void mvcp_response_set_error( mvcp_response, int, char * );
853         int mvcp_response_printf( mvcp_response, size_t, char *, ... );
854         int mvcp_response_write( mvcp_response, char *, int );
855         void mvcp_response_close( mvcp_response );
856         
857
858 APPENDIX D - REFERENCES
859 -----------------------
860
861         (1) doc/mvcp.txt - MVCP protocol
862         (2) doc/testing.txt - Test procedures