naspro

view naspro-core/include/NASPRO/core/bridge.h @ 174:4f7243a606b1

Updated copyright notices and build system
author Stefano D'Angelo <zanga.mail@gmail.com>
date Sat May 01 21:51:33 2010 +0300 (2010-05-01)
parents 71372f617827
children
line source
1 /*
2 * NASPRO - NASPRO Architecture for Sound Processing
3 * Core library
4 *
5 * Copyright (C) 2007-2010 Stefano D'Angelo <zanga.mail@gmail.com>
6 *
7 * See the COPYING file for license conditions.
8 */
10 #ifndef _NACORE_BRIDGE_H
11 #define _NACORE_BRIDGE_H
13 #include <stdlib.h>
14 #include <stdio.h>
15 #include <stdint.h>
17 #include <lv2.h>
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 /*
24 * Plugin descriptor class values
25 *
26 * Plugins beloging to a subclass should have the superclass disabled:
27 * e.g. if NACORE_DESCRIPTOR_CLASS_INSTRUMENT is on, then
28 * NACORE_DESCRIPTOR_CLASS_GENERATOR must be off.
29 */
31 /* Values for the classes_1 field */
32 #define NACORE_DESCRIPTOR_CLASS_GENERATOR (1)
33 #define NACORE_DESCRIPTOR_CLASS_INSTRUMENT (1 << 1)
34 #define NACORE_DESCRIPTOR_CLASS_OSCILLATOR (1 << 2)
35 #define NACORE_DESCRIPTOR_CLASS_UTILITY (1 << 3)
36 #define NACORE_DESCRIPTOR_CLASS_CONVERTER (1 << 4)
37 #define NACORE_DESCRIPTOR_CLASS_ANALYSER (1 << 5)
38 #define NACORE_DESCRIPTOR_CLASS_MIXER (1 << 6)
39 #define NACORE_DESCRIPTOR_CLASS_SIMULATOR (1 << 7)
40 #define NACORE_DESCRIPTOR_CLASS_DELAY (1 << 8)
41 #define NACORE_DESCRIPTOR_CLASS_MODULATOR (1 << 9)
42 #define NACORE_DESCRIPTOR_CLASS_REVERB (1 << 10)
43 #define NACORE_DESCRIPTOR_CLASS_PHASER (1 << 11)
44 #define NACORE_DESCRIPTOR_CLASS_FLANGER (1 << 12)
45 #define NACORE_DESCRIPTOR_CLASS_CHORUS (1 << 13)
46 #define NACORE_DESCRIPTOR_CLASS_FILTER (1 << 14)
47 #define NACORE_DESCRIPTOR_CLASS_LOWPASS (1 << 15)
48 #define NACORE_DESCRIPTOR_CLASS_BANDPASS (1 << 16)
49 #define NACORE_DESCRIPTOR_CLASS_HIGHPASS (1 << 17)
50 #define NACORE_DESCRIPTOR_CLASS_COMB (1 << 18)
51 #define NACORE_DESCRIPTOR_CLASS_ALLPASS (1 << 19)
52 #define NACORE_DESCRIPTOR_CLASS_EQ (1 << 20)
53 #define NACORE_DESCRIPTOR_CLASS_PARAEQ (1 << 21)
54 #define NACORE_DESCRIPTOR_CLASS_MULTIEQ (1 << 22)
55 #define NACORE_DESCRIPTOR_CLASS_SPECTRAL (1 << 23)
56 #define NACORE_DESCRIPTOR_CLASS_PITCH (1 << 24)
57 #define NACORE_DESCRIPTOR_CLASS_AMPLIFIER (1 << 25)
58 #define NACORE_DESCRIPTOR_CLASS_DISTORTION (1 << 26)
59 #define NACORE_DESCRIPTOR_CLASS_WAVESHAPER (1 << 27)
61 /* Values for the classes_2 field */
62 #define NACORE_DESCRIPTOR_CLASS_DYNAMICS (1)
63 #define NACORE_DESCRIPTOR_CLASS_COMPRESSOR (1 << 1)
64 #define NACORE_DESCRIPTOR_CLASS_EXPANDER (1 << 2)
65 #define NACORE_DESCRIPTOR_CLASS_LIMITER (1 << 3)
66 #define NACORE_DESCRIPTOR_CLASS_GATE (1 << 4)
68 /*
69 * Plugin descriptor property values
70 */
72 /* Values for the properties field */
73 #define NACORE_DESCRIPTOR_HAS_LIVE_DEP (1)
74 #define NACORE_DESCRIPTOR_INPLACE_BROKEN (1 << 1)
75 #define NACORE_DESCRIPTOR_HARD_RT_CAPABLE (1 << 2)
77 /*
78 * Port descriptor property values
79 */
81 /* Values for the properties field */
82 #define NACORE_PORT_IS_OUTPUT (1)
83 #define NACORE_PORT_IS_AUDIO (1 << 1)
84 #define NACORE_PORT_IS_MIDI (1 << 2)
85 #define NACORE_PORT_CONNECTION_OPTIONAL (1 << 3)
86 #define NACORE_PORT_REPORTS_LATENCY (1 << 4)
87 #define NACORE_PORT_TOGGLED (1 << 5)
88 #define NACORE_PORT_SAMPLE_RATE (1 << 6)
89 #define NACORE_PORT_INTEGER (1 << 7)
90 #define NACORE_PORT_LOGARITHMIC (1 << 8)
92 /*
93 * Port descriptor scale values
94 */
96 /* Values for the properties field */
97 #define NACORE_SCALE_HAS_MIN (1)
98 #define NACORE_SCALE_HAS_MAX (1 << 1)
99 #define NACORE_SCALE_HAS_DEFAULT (1 << 2)
101 /* Scale units */
102 enum nacore_scale_unit
103 {
104 nacore_scale_unit_none = 0,
105 nacore_scale_unit_bar,
106 nacore_scale_unit_beat,
107 nacore_scale_unit_bpm,
108 nacore_scale_unit_cent,
109 nacore_scale_unit_cm,
110 nacore_scale_unit_coeff,
111 nacore_scale_unit_db,
112 nacore_scale_unit_deg,
113 nacore_scale_unit_hz,
114 nacore_scale_unit_inch,
115 nacore_scale_unit_khz,
116 nacore_scale_unit_km,
117 nacore_scale_unit_m,
118 nacore_scale_unit_mhz,
119 nacore_scale_unit_midi_note,
120 nacore_scale_unit_mi,
121 nacore_scale_unit_min,
122 nacore_scale_unit_mm,
123 nacore_scale_unit_ms,
124 nacore_scale_unit_oct,
125 nacore_scale_unit_pc,
126 nacore_scale_unit_s,
127 nacore_scale_unit_semitone
128 };
130 /* Scale points */
131 struct nacore_scale_point
132 {
133 char *label;
134 float value;
135 };
137 /* Scale values for a port descriptor */
138 struct nacore_port_scale
139 {
140 uint32_t properties;
141 float min;
142 float max;
143 float defaultv;
144 enum nacore_scale_unit unit;
145 struct nacore_scale_point *points;
146 size_t points_count;
147 };
149 /* Port descriptor */
150 struct nacore_port_descriptor
151 {
152 char *name;
153 uint32_t properties;
154 struct nacore_port_scale scale;
155 void *data;
156 };
158 /* Plugin descriptor */
159 struct nacore_descriptor
160 {
161 char *name;
162 char *uri;
163 char *creator;
164 char *rights;
165 struct nacore_port_descriptor *port_descs;
166 size_t port_descs_count;
167 uint32_t properties;
168 uint32_t classes_1;
169 uint32_t classes_2;
170 void *data;
172 LV2_Handle (*instantiate) (const LV2_Descriptor *descriptor,
173 double sample_rate,
174 const char *bundle_path,
175 const LV2_Feature * const *features);
176 void (*connect_port) (LV2_Handle instance, uint32_t port,
177 void *data_location);
178 void (*activate) (LV2_Handle instance);
179 void (*run) (LV2_Handle instance,
180 uint32_t sample_count);
181 void (*deactivate) (LV2_Handle instance);
182 void (*cleanup) (LV2_Handle instance);
183 const void * (*extension_data)(const char *uri);
184 };
186 #ifdef __cplusplus
187 }
188 #endif
190 #endif /* !_NACORE_BRIDGE_H */