BEAST - Free Software Audio Synthesizer and Tracker  0.10.0
sfigluecodec.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __SFI_GLUE_CODEC_H__
3 #define __SFI_GLUE_CODEC_H__
4 
5 #include <sfi/sfiglue.hh>
6 #include <sfi/sficomport.hh>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif /* __cplusplus */
11 
12 
13 /* --- encoder API --- */
14 typedef struct
15 {
16  SfiGlueContext context;
17  SfiComPort *port;
18  /*< private >*/
19  GValue svalue;
20  SfiRing *events;
22 /* encode glue layer API calls and pass them on to remote server */
23 SfiGlueContext* sfi_glue_encoder_context (SfiComPort *port);
24 
25 
26 /* --- decoder API --- */
27 typedef struct _SfiGlueDecoder SfiGlueDecoder;
28 typedef GValue* (*SfiGlueDecoderClientMsg) (SfiGlueDecoder *decoder,
29  gpointer user_data,
30  const gchar *message,
31  const GValue *value);
33 {
34  /*< private >*/
35  SfiGlueContext *context;
36  SfiComPort *port;
37  GValue *incoming;
38  SfiRing *outgoing;
39  guint n_chandler;
40  struct ClientMsg {
41  SfiGlueDecoderClientMsg client_msg;
42  gpointer user_data;
43  } *chandler;
44 };
45 /* receive encoded requests and dispatch them onto a given context */
46 SfiGlueDecoder* sfi_glue_context_decoder (SfiComPort *port,
47  SfiGlueContext *context);
48 void sfi_glue_decoder_add_handler (SfiGlueDecoder *decoder,
49  SfiGlueDecoderClientMsg func,
50  gpointer user_data);
51 SfiRing* sfi_glue_decoder_list_poll_fds (SfiGlueDecoder *decoder);
52 gboolean sfi_glue_decoder_pending (SfiGlueDecoder *decoder);
53 void sfi_glue_decoder_dispatch (SfiGlueDecoder *decoder);
54 void sfi_glue_decoder_destroy (SfiGlueDecoder *decoder);
55 
56 
57 /* --- implementation details --- */
58 typedef enum /*< skip >*/
59 {
60  SFI_GLUE_CODEC_ASYNC_RETURN = 1,
61  SFI_GLUE_CODEC_ASYNC_MESSAGE,
62  SFI_GLUE_CODEC_ASYNC_EVENT,
63  SFI_GLUE_CODEC_DESCRIBE_IFACE = 129,
64  SFI_GLUE_CODEC_DESCRIBE_PROC,
65  SFI_GLUE_CODEC_LIST_PROC_NAMES,
66  SFI_GLUE_CODEC_LIST_METHOD_NAMES,
67  SFI_GLUE_CODEC_BASE_IFACE,
68  SFI_GLUE_CODEC_IFACE_CHILDREN,
69  SFI_GLUE_CODEC_EXEC_PROC,
70  SFI_GLUE_CODEC_PROXY_IFACE,
71  SFI_GLUE_CODEC_PROXY_IS_A,
72  SFI_GLUE_CODEC_PROXY_LIST_PROPERTIES,
73  SFI_GLUE_CODEC_PROXY_GET_PSPEC,
74  SFI_GLUE_CODEC_PROXY_GET_PSPEC_SCATEGORY,
75  SFI_GLUE_CODEC_PROXY_SET_PROPERTY, /* one-way */
76  SFI_GLUE_CODEC_PROXY_GET_PROPERTY,
77  SFI_GLUE_CODEC_PROXY_WATCH_RELEASE,
78  SFI_GLUE_CODEC_PROXY_REQUEST_NOTIFY,
79  SFI_GLUE_CODEC_PROXY_PROCESSED_NOTIFY, /* one-way */
80  SFI_GLUE_CODEC_CLIENT_MSG
81 } SfiGlueCodecCommands;
82 
83 
84 
85 #ifdef __cplusplus
86 }
87 #endif /* __cplusplus */
88 
89 #endif /* __SFI_GLUE_CODEC_H__ */
90 
91 /* vim:set ts=8 sts=2 sw=2: */
Definition: sfigluecodec.hh:32
Definition: sficomport.hh:16
Definition: sfigluecodec.hh:40
Definition: sfiring.hh:23
Definition: sfigluecodec.hh:14