BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html 00002 #ifndef __SFI_GLUE_CODEC_H__ 00003 #define __SFI_GLUE_CODEC_H__ 00004 00005 #include <sfi/sfiglue.hh> 00006 #include <sfi/sficomport.hh> 00007 00008 #ifdef __cplusplus 00009 extern "C" { 00010 #endif /* __cplusplus */ 00011 00012 00013 /* --- encoder API --- */ 00014 typedef struct 00015 { 00016 SfiGlueContext context; 00017 SfiComPort *port; 00018 /*< private >*/ 00019 GValue svalue; 00020 SfiRing *events; 00021 } SfiGlueEncoder; 00022 /* encode glue layer API calls and pass them on to remote server */ 00023 SfiGlueContext* sfi_glue_encoder_context (SfiComPort *port); 00024 00025 00026 /* --- decoder API --- */ 00027 typedef struct _SfiGlueDecoder SfiGlueDecoder; 00028 typedef GValue* (*SfiGlueDecoderClientMsg) (SfiGlueDecoder *decoder, 00029 gpointer user_data, 00030 const gchar *message, 00031 const GValue *value); 00032 struct _SfiGlueDecoder 00033 { 00034 /*< private >*/ 00035 SfiGlueContext *context; 00036 SfiComPort *port; 00037 GValue *incoming; 00038 SfiRing *outgoing; 00039 guint n_chandler; 00040 struct ClientMsg { 00041 SfiGlueDecoderClientMsg client_msg; 00042 gpointer user_data; 00043 } *chandler; 00044 }; 00045 /* receive encoded requests and dispatch them onto a given context */ 00046 SfiGlueDecoder* sfi_glue_context_decoder (SfiComPort *port, 00047 SfiGlueContext *context); 00048 void sfi_glue_decoder_add_handler (SfiGlueDecoder *decoder, 00049 SfiGlueDecoderClientMsg func, 00050 gpointer user_data); 00051 SfiRing* sfi_glue_decoder_list_poll_fds (SfiGlueDecoder *decoder); 00052 gboolean sfi_glue_decoder_pending (SfiGlueDecoder *decoder); 00053 void sfi_glue_decoder_dispatch (SfiGlueDecoder *decoder); 00054 void sfi_glue_decoder_destroy (SfiGlueDecoder *decoder); 00055 00056 00057 /* --- implementation details --- */ 00058 typedef enum /*< skip >*/ 00059 { 00060 SFI_GLUE_CODEC_ASYNC_RETURN = 1, 00061 SFI_GLUE_CODEC_ASYNC_MESSAGE, 00062 SFI_GLUE_CODEC_ASYNC_EVENT, 00063 SFI_GLUE_CODEC_DESCRIBE_IFACE = 129, 00064 SFI_GLUE_CODEC_DESCRIBE_PROC, 00065 SFI_GLUE_CODEC_LIST_PROC_NAMES, 00066 SFI_GLUE_CODEC_LIST_METHOD_NAMES, 00067 SFI_GLUE_CODEC_BASE_IFACE, 00068 SFI_GLUE_CODEC_IFACE_CHILDREN, 00069 SFI_GLUE_CODEC_EXEC_PROC, 00070 SFI_GLUE_CODEC_PROXY_IFACE, 00071 SFI_GLUE_CODEC_PROXY_IS_A, 00072 SFI_GLUE_CODEC_PROXY_LIST_PROPERTIES, 00073 SFI_GLUE_CODEC_PROXY_GET_PSPEC, 00074 SFI_GLUE_CODEC_PROXY_GET_PSPEC_SCATEGORY, 00075 SFI_GLUE_CODEC_PROXY_SET_PROPERTY, /* one-way */ 00076 SFI_GLUE_CODEC_PROXY_GET_PROPERTY, 00077 SFI_GLUE_CODEC_PROXY_WATCH_RELEASE, 00078 SFI_GLUE_CODEC_PROXY_REQUEST_NOTIFY, 00079 SFI_GLUE_CODEC_PROXY_PROCESSED_NOTIFY, /* one-way */ 00080 SFI_GLUE_CODEC_CLIENT_MSG 00081 } SfiGlueCodecCommands; 00082 00083 00084 00085 #ifdef __cplusplus 00086 } 00087 #endif /* __cplusplus */ 00088 00089 #endif /* __SFI_GLUE_CODEC_H__ */ 00090 00091 /* vim:set ts=8 sts=2 sw=2: */