1 /*
2 *  Copyright (C) 2004 Jack O'Quin
3 *  
4 *  This program is free software; you can redistribute it and/or modify
5 *  it under the terms of the GNU Lesser General Public License as published by
6 *  the Free Software Foundation; either version 2.1 of the License, or
7 *  (at your option) any later version.
8 *  
9 *  This program is distributed in the hope that it will be useful,
10 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *  GNU Lesser General Public License for more details.
13 *  
14 *  You should have received a copy of the GNU Lesser General Public License
15 *  along with this program; if not, write to the Free Software 
16 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 module jack.c.intclient;
21 public import jack.c.types;
22 
23 extern(C)
24 {
25 
26 /**
27  * Get an internal client's name.  This is useful when @ref
28  * JackUseExactName was not specified on jack_internal_client_load()
29  * and @ref JackNameNotUnique status was returned.  In that case, the
30  * actual name will differ from the @a client_name requested.
31  *
32  * @param client requesting JACK client's handle.
33  *
34  * @param intclient handle returned from jack_internal_client_load()
35  * or jack_internal_client_handle().
36  *
37  * @return NULL if unsuccessful, otherwise pointer to the internal
38  * client name obtained from the heap via malloc().  The caller should
39  * jack_free() this storage when no longer needed.
40  */
41 char *jack_get_internal_client_name (jack_client_t *client,
42                                      jack_intclient_t intclient);
43 
44 /**
45  * Return the @ref jack_intclient_t handle for an internal client
46  * running in the JACK server.
47  *
48  * @param client requesting JACK client's handle.
49  *
50  * @param client_name for the internal client of no more than
51  * jack_client_name_size() characters.  The name scope is local to the
52  * current server.
53  *
54  * @param status (if non-NULL) an address for JACK to return
55  * information from this operation.  This status word is formed by
56  * OR-ing together the relevant @ref JackStatus bits.
57  *
58  * @return Opaque internal client handle if successful.  If 0, the
59  * internal client was not found, and @a *status includes the @ref
60  * JackNoSuchClient and @ref JackFailure bits.
61  */
62 jack_intclient_t jack_internal_client_handle (jack_client_t *client,
63         const(char) *client_name,
64         jack_status_t *status);
65 
66 /**
67  * Load an internal client into the JACK server.
68  *
69  * Internal clients run inside the JACK server process.  They can use
70  * most of the same functions as external clients.  Each internal
71  * client is built as a shared object module, which must declare
72  * jack_initialize() and jack_finish() entry points called at load and
73  * unload times.  See @ref inprocess.c for an example.
74  *
75  * @param client loading JACK client's handle.
76  *
77  * @param client_name of at most jack_client_name_size() characters
78  * for the internal client to load.  The name scope is local to the
79  * current server.
80  *
81  * @param options formed by OR-ing together @ref JackOptions bits.
82  * Only the @ref JackLoadOptions bits are valid.
83  *
84  * @param status (if non-NULL) an address for JACK to return
85  * information from the load operation.  This status word is formed by
86  * OR-ing together the relevant @ref JackStatus bits.
87  *
88  * <b>Optional parameters:</b> depending on corresponding [@a options
89  * bits] additional parameters may follow @a status (in this order).
90  *
91  * @arg [@ref JackLoadName] <em>(char *) load_name</em> is the shared
92  * object file from which to load the new internal client (otherwise
93  * use the @a client_name).
94  *
95  * @arg [@ref JackLoadInit] <em>(char *) load_init</em> an arbitary
96  * string passed to the internal client's jack_initialize() routine
97  * (otherwise NULL), of no more than @ref JACK_LOAD_INIT_LIMIT bytes.
98  *
99  * @return Opaque internal client handle if successful.  If this is 0,
100  * the load operation failed, the internal client was not loaded, and
101  * @a *status includes the @ref JackFailure bit.
102  */
103 jack_intclient_t jack_internal_client_load (jack_client_t *client,
104         const(char) *client_name,
105         jack_options_t options,
106         jack_status_t *status, ...);
107 /**
108  * Unload an internal client from a JACK server.  This calls the
109  * intclient's jack_finish() entry point then removes it.  See @ref
110  * inprocess.c for an example.
111  *
112  * @param client unloading JACK client's handle.
113  *
114  * @param intclient handle returned from jack_internal_client_load() or
115  * jack_internal_client_handle().
116  *
117  * @return 0 if successful, otherwise @ref JackStatus bits.
118  */
119 jack_status_t jack_internal_client_unload (jack_client_t *client,
120         jack_intclient_t intclient);
121 
122 }