naspro

view naspro-core/include/NASPRO/core/bridge.h @ 163:d7568c8379c1

Initiial DSSI support + reorganization
author Stefano D'Angelo <zanga.mail@gmail.com>
date Fri Sep 11 13:31:52 2009 +0200 (2009-09-11)
parents include/NASPRO/core/bridge.h@cc067fdfbaf4
children 71372f617827
line source
1 /*
2 * NASPRO - NASPRO Architecture for Sound Processing
3 * Core library
4 *
5 * Copyright (C) 2007-2009 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 /* Plugins beloging to a subclass should have the superclass disabled:
24 * e.g. if NACORE_DESCRIPTOR_CLASS_INSTRUMENT is on, then
25 * NACORE_DESCRIPTOR_CLASS_GENERATOR must be off. */
27 /* descriptor.classes_1 */
28 #define NACORE_DESCRIPTOR_CLASS_GENERATOR (1)
29 #define NACORE_DESCRIPTOR_CLASS_INSTRUMENT (1 << 1)
30 #define NACORE_DESCRIPTOR_CLASS_OSCILLATOR (1 << 2)
31 #define NACORE_DESCRIPTOR_CLASS_UTILITY (1 << 3)
32 #define NACORE_DESCRIPTOR_CLASS_CONVERTER (1 << 4)
33 #define NACORE_DESCRIPTOR_CLASS_ANALYSER (1 << 5)
34 #define NACORE_DESCRIPTOR_CLASS_MIXER (1 << 6)
35 #define NACORE_DESCRIPTOR_CLASS_SIMULATOR (1 << 7)
36 #define NACORE_DESCRIPTOR_CLASS_DELAY (1 << 8)
37 #define NACORE_DESCRIPTOR_CLASS_MODULATOR (1 << 9)
38 #define NACORE_DESCRIPTOR_CLASS_REVERB (1 << 10)
39 #define NACORE_DESCRIPTOR_CLASS_PHASER (1 << 11)
40 #define NACORE_DESCRIPTOR_CLASS_FLANGER (1 << 12)
41 #define NACORE_DESCRIPTOR_CLASS_CHORUS (1 << 13)
42 #define NACORE_DESCRIPTOR_CLASS_FILTER (1 << 14)
43 #define NACORE_DESCRIPTOR_CLASS_LOWPASS (1 << 15)
44 #define NACORE_DESCRIPTOR_CLASS_BANDPASS (1 << 16)
45 #define NACORE_DESCRIPTOR_CLASS_HIGHPASS (1 << 17)
46 #define NACORE_DESCRIPTOR_CLASS_COMB (1 << 18)
47 #define NACORE_DESCRIPTOR_CLASS_ALLPASS (1 << 19)
48 #define NACORE_DESCRIPTOR_CLASS_EQ (1 << 20)
49 #define NACORE_DESCRIPTOR_CLASS_PARAEQ (1 << 21)
50 #define NACORE_DESCRIPTOR_CLASS_MULTIEQ (1 << 22)
51 #define NACORE_DESCRIPTOR_CLASS_SPECTRAL (1 << 23)
52 #define NACORE_DESCRIPTOR_CLASS_PITCH (1 << 24)
53 #define NACORE_DESCRIPTOR_CLASS_AMPLIFIER (1 << 25)
54 #define NACORE_DESCRIPTOR_CLASS_DISTORTION (1 << 26)
55 #define NACORE_DESCRIPTOR_CLASS_WAVESHAPER (1 << 27)
57 /* descriptor.classes_2 */
58 #define NACORE_DESCRIPTOR_CLASS_DYNAMICS (1)
59 #define NACORE_DESCRIPTOR_CLASS_COMPRESSOR (1 << 1)
60 #define NACORE_DESCRIPTOR_CLASS_EXPANDER (1 << 2)
61 #define NACORE_DESCRIPTOR_CLASS_LIMITER (1 << 3)
62 #define NACORE_DESCRIPTOR_CLASS_GATE (1 << 4)
64 /* descriptor.properties */
65 #define NACORE_DESCRIPTOR_HAS_LIVE_DEP (1)
66 #define NACORE_DESCRIPTOR_INPLACE_BROKEN (1 << 1)
67 #define NACORE_DESCRIPTOR_HARD_RT_CAPABLE (1 << 2)
69 /* port_descriptor.properties */
70 #define NACORE_PORT_IS_OUTPUT (1)
71 #define NACORE_PORT_IS_AUDIO (1 << 1)
72 #define NACORE_PORT_IS_MIDI (1 << 2)
73 #define NACORE_PORT_CONNECTION_OPTIONAL (1 << 3)
74 #define NACORE_PORT_REPORTS_LATENCY (1 << 4)
75 #define NACORE_PORT_TOGGLED (1 << 5)
76 #define NACORE_PORT_SAMPLE_RATE (1 << 6)
77 #define NACORE_PORT_INTEGER (1 << 7)
78 #define NACORE_PORT_LOGARITHMIC (1 << 8)
80 /* port_descriptor.scale.properties */
81 #define NACORE_SCALE_HAS_MIN (1)
82 #define NACORE_SCALE_HAS_MAX (1 << 1)
83 #define NACORE_SCALE_HAS_DEFAULT (1 << 2)
85 enum nacore_scale_unit
86 {
87 nacore_scale_unit_none = 0,
88 nacore_scale_unit_bar,
89 nacore_scale_unit_beat,
90 nacore_scale_unit_bpm,
91 nacore_scale_unit_cent,
92 nacore_scale_unit_cm,
93 nacore_scale_unit_coeff,
94 nacore_scale_unit_db,
95 nacore_scale_unit_deg,
96 nacore_scale_unit_hz,
97 nacore_scale_unit_inch,
98 nacore_scale_unit_khz,
99 nacore_scale_unit_km,
100 nacore_scale_unit_m,
101 nacore_scale_unit_mhz,
102 nacore_scale_unit_midi_note,
103 nacore_scale_unit_mi,
104 nacore_scale_unit_min,
105 nacore_scale_unit_mm,
106 nacore_scale_unit_ms,
107 nacore_scale_unit_oct,
108 nacore_scale_unit_pc,
109 nacore_scale_unit_s,
110 nacore_scale_unit_semitone
111 };
113 struct nacore_scale_point
114 {
115 char *label;
116 float value;
117 };
119 struct nacore_port_scale
120 {
121 uint32_t properties;
122 float min;
123 float max;
124 float defaultv;
125 enum nacore_scale_unit unit;
126 struct nacore_scale_point *points;
127 size_t points_count;
128 };
130 struct nacore_port_descriptor
131 {
132 char *name;
133 uint32_t properties;
134 struct nacore_port_scale scale;
135 void *data;
136 };
138 struct nacore_descriptor
139 {
140 char *name;
141 char *uri;
142 char *creator;
143 char *rights;
144 struct nacore_port_descriptor *port_descs;
145 size_t port_descs_count;
146 uint32_t properties;
147 uint32_t classes_1;
148 uint32_t classes_2;
149 void *data;
151 LV2_Handle (*instantiate) (const LV2_Descriptor *descriptor,
152 double sample_rate,
153 const char *bundle_path,
154 const LV2_Feature * const *features);
155 void (*connect_port) (LV2_Handle instance, uint32_t port,
156 void *data_location);
157 void (*activate) (LV2_Handle instance);
158 void (*run) (LV2_Handle instance,
159 uint32_t sample_count);
160 void (*deactivate) (LV2_Handle instance);
161 void (*cleanup) (LV2_Handle instance);
162 const void * (*extension_data)(const char *uri);
163 };
165 #ifdef __cplusplus
166 }
167 #endif
169 #endif /* !_NACORE_BRIDGE_H */