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 __BSE_EXPORTS_H__ 00003 #define __BSE_EXPORTS_H__ 00004 00005 #include <bse/bseprocedure.hh> 00006 00007 G_BEGIN_DECLS 00008 00009 /* --- export node types --- */ 00010 typedef enum { 00011 BSE_EXPORT_NODE_NONE, 00012 BSE_EXPORT_NODE_LINK, 00013 BSE_EXPORT_NODE_HOOK, 00014 BSE_EXPORT_NODE_ENUM, 00015 BSE_EXPORT_NODE_RECORD, 00016 BSE_EXPORT_NODE_SEQUENCE, 00017 BSE_EXPORT_NODE_CLASS, 00018 BSE_EXPORT_NODE_PROC 00019 } BseExportNodeType; 00020 00021 /* --- common export node data --- */ 00022 typedef struct { 00023 /* strings which need to be looked up from catalogs after 00024 * initialization (usually i18n strings). 00025 */ 00026 const char *blurb; 00027 const char *authors; 00028 const char *license; 00029 const char *i18n_category; 00030 /* definition location */ 00031 const char *file; 00032 guint line; 00033 } BseExportStrings; 00034 typedef void (*BseExportStringsFunc) (BseExportStrings *strings); 00035 00036 /* --- basic export node --- */ 00037 struct _BseExportNode { 00038 BseExportNode *next; 00039 BseExportNodeType ntype; 00040 const char *name; 00041 const char *options; 00042 const char *category; 00043 const guint8 *pixstream; 00044 BseExportStringsFunc fill_strings; 00045 GType type; 00046 }; 00047 00048 /* --- hook export node --- */ 00049 typedef void (*BseExportHook) (void *data); 00050 typedef struct { 00051 BseExportNode node; 00052 bool make_static; 00053 BseExportHook hook; 00054 void *data; 00055 } BseExportNodeHook; 00056 00057 /* --- enum export node --- */ 00058 typedef GEnumValue* (*BseExportGetEnumValues) (void); 00059 typedef SfiChoiceValues (*BseExportGetChoiceValues) (void); 00060 typedef struct { 00061 BseExportNode node; 00062 BseExportGetEnumValues get_enum_values; 00063 BseExportGetChoiceValues get_choice_values; 00064 } BseExportNodeEnum; 00065 00066 /* --- boxed export node --- */ 00067 typedef SfiRecFields (*BseExportGetRecordFields) (void); 00068 typedef GParamSpec* (*BseExportGetSequenceElement) (void); 00069 struct _BseExportNodeBoxed { 00070 BseExportNode node; 00071 GBoxedCopyFunc copy; 00072 GBoxedFreeFunc free; 00073 GValueTransform boxed2recseq; 00074 GValueTransform seqrec2boxed; 00075 union { 00076 BseExportGetRecordFields get_fields; 00077 BseExportGetSequenceElement get_element; 00078 } func; 00079 }; 00080 00081 /* --- class export node --- */ 00082 typedef struct { 00083 BseExportNode node; 00084 const char *parent; 00085 /* GTypeInfo fields */ 00086 guint16 class_size; 00087 GClassInitFunc class_init; 00088 GClassFinalizeFunc class_finalize; 00089 guint16 instance_size; 00090 GInstanceInitFunc instance_init; 00091 } BseExportNodeClass; 00092 00093 /* --- procedure export node --- */ 00094 typedef struct { 00095 BseExportNode node; 00096 guint private_id; 00097 BseProcedureInit init; 00098 BseProcedureExec exec; 00099 } BseExportNodeProc; 00100 00101 /* --- plugin identity export --- */ 00102 /* plugin export identity (name, bse-version and actual types) */ 00103 #define BSE_EXPORT_IDENTITY_SYMBOL bse_export__identity 00104 #define BSE_EXPORT_IDENTITY_STRING "bse_export__identity" 00105 typedef struct { 00106 guint major, minor, micro; 00107 guint binary_age, interface_age; 00108 guint dummy1, dummy2, dummy3; 00109 guint64 export_flags; 00110 BseExportNode *export_chain; 00111 } BseExportIdentity; 00112 #define BSE_EXPORT_IDENTITY(HEAD) \ 00113 { BSE_MAJOR_VERSION, BSE_MINOR_VERSION, BSE_MICRO_VERSION, \ 00114 BSE_BINARY_AGE, BSE_INTERFACE_AGE, 0, 0, 0, \ 00115 BSE_EXPORT_CONFIG, &HEAD } 00116 00117 #define BSE_EXPORT_FLAG_MMX (0x1ull << 0) 00118 #define BSE_EXPORT_FLAG_MMXEXT (0x1ull << 1) 00119 #define BSE_EXPORT_FLAG_3DNOW (0x1ull << 2) 00120 #define BSE_EXPORT_FLAG_3DNOWEXT (0x1ull << 3) 00121 #define BSE_EXPORT_FLAG_SSE (0x1ull << 4) 00122 #define BSE_EXPORT_FLAG_SSE2 (0x1ull << 5) 00123 #define BSE_EXPORT_FLAG_SSE3 (0x1ull << 6) 00124 #define BSE_EXPORT_FLAG_SSE4 (0x1ull << 7) 00125 00126 #define BSE_EXPORT_CONFIG (BSE_EXPORT_CONFIG__MMX | BSE_EXPORT_CONFIG__3DNOW | \ 00127 BSE_EXPORT_CONFIG__SSE | BSE_EXPORT_CONFIG__SSE2 | \ 00128 BSE_EXPORT_CONFIG__SSE3) 00129 00130 00131 00132 BsePlugin* bse_exports__add_node (const BseExportIdentity *identity, // bseplugin.cc 00133 BseExportNode *enode); 00134 void bse_exports__del_node (BsePlugin *plugin, // bseplugin.cc 00135 BseExportNode *enode); 00136 00137 /* implementation prototype */ 00138 void bse_procedure_complete_info (const BseExportNodeProc *pnode, 00139 GTypeInfo *info); 00140 00141 /* --- export config --- */ 00142 #ifdef __MMX__ 00143 #define BSE_EXPORT_CONFIG__MMX BSE_EXPORT_FLAG_MMX 00144 #else 00145 #define BSE_EXPORT_CONFIG__MMX 0 00146 #endif 00147 #ifdef __3dNOW__ 00148 #define BSE_EXPORT_CONFIG__3DNOW BSE_EXPORT_FLAG_3DNOW 00149 #else 00150 #define BSE_EXPORT_CONFIG__3DNOW 0 00151 #endif 00152 #ifdef __SSE__ 00153 #define BSE_EXPORT_CONFIG__SSE BSE_EXPORT_FLAG_SSE 00154 #else 00155 #define BSE_EXPORT_CONFIG__SSE 0 00156 #endif 00157 #ifdef __SSE2__ 00158 #define BSE_EXPORT_CONFIG__SSE2 BSE_EXPORT_FLAG_SSE2 00159 #else 00160 #define BSE_EXPORT_CONFIG__SSE2 0 00161 #endif 00162 #ifdef __SSE3__ 00163 #define BSE_EXPORT_CONFIG__SSE3 BSE_EXPORT_FLAG_SSE3 00164 #else 00165 #define BSE_EXPORT_CONFIG__SSE3 0 00166 #endif 00167 00168 G_END_DECLS 00169 00170 #endif /* __BSE_EXPORTS_H__ */