diff options
author | David Robillard <d@drobilla.net> | 2006-07-26 03:25:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-07-26 03:25:08 +0000 |
commit | 2cd84e4209633e59439c445f821bed8410347bab (patch) | |
tree | ba34505505795cff5cf35c2958ed21933b822e12 /examples/plugins | |
parent | deca2cc89850dffc051d0a0aafc9d681af838934 (diff) | |
download | lilv-2cd84e4209633e59439c445f821bed8410347bab.tar.gz lilv-2cd84e4209633e59439c445f821bed8410347bab.tar.bz2 lilv-2cd84e4209633e59439c445f821bed8410347bab.zip |
- Removed all the unsigned char garbage from the API
- Updated types in lv2.h to be non-machine-dependant (removed unsigned long in favour of uint32_t)
- Updated schema
- Updated example plugin to work with the above (partially)
git-svn-id: http://svn.drobilla.net/lad/libslv2@101 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'examples/plugins')
-rw-r--r-- | examples/plugins/Amp-slv2.lv2/Makefile (renamed from examples/plugins/Amp-swh.lv2/Makefile) | 0 | ||||
-rw-r--r-- | examples/plugins/Amp-slv2.lv2/amp.c (renamed from examples/plugins/Amp-swh.lv2/amp.c) | 26 | ||||
-rw-r--r-- | examples/plugins/Amp-slv2.lv2/amp.ttl | 57 | ||||
-rw-r--r-- | examples/plugins/Amp-slv2.lv2/manifest.ttl (renamed from examples/plugins/Amp-swh.lv2/manifest.ttl) | 6 | ||||
-rw-r--r-- | examples/plugins/Amp-swh.lv2/amp.ttl | 68 |
5 files changed, 80 insertions, 77 deletions
diff --git a/examples/plugins/Amp-swh.lv2/Makefile b/examples/plugins/Amp-slv2.lv2/Makefile index 55180c2..55180c2 100644 --- a/examples/plugins/Amp-swh.lv2/Makefile +++ b/examples/plugins/Amp-slv2.lv2/Makefile diff --git a/examples/plugins/Amp-swh.lv2/amp.c b/examples/plugins/Amp-slv2.lv2/amp.c index a30c4bd..e6b891e 100644 --- a/examples/plugins/Amp-swh.lv2/amp.c +++ b/examples/plugins/Amp-slv2.lv2/amp.c @@ -11,7 +11,7 @@ #define SYMBOL_EXPORT #endif -#define AMP_URI "http://plugin.org.uk/swh-plugins/amp"; +#define AMP_URI "http://codeson.net/plugins/amp" #define AMP_GAIN 0 #define AMP_INPUT 1 #define AMP_OUTPUT 2 @@ -24,11 +24,15 @@ typedef struct { float *output; } Amp; -static void cleanupAmp(LV2_Handle instance) { + +static void +cleanupAmp(LV2_Handle instance) { free(instance); } -static void connectPortAmp(LV2_Handle instance, unsigned long port, + +static void +connectPortAmp(LV2_Handle instance, unsigned long port, void *data) { Amp *plugin = (Amp *)instance; @@ -45,16 +49,20 @@ static void connectPortAmp(LV2_Handle instance, unsigned long port, } } -static LV2_Handle instantiateAmp(const LV2_Descriptor *descriptor, + +static LV2_Handle +instantiateAmp(const LV2_Descriptor *descriptor, unsigned long s_rate, const char *path , const LV2_Host_Feature **features) { Amp *plugin_data = (Amp *)malloc(sizeof(Amp)); return (LV2_Handle)plugin_data; } + #define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g) * 0.05f) : 0.0f) -static void runAmp(LV2_Handle instance, unsigned long sample_count) { +static void +runAmp(LV2_Handle instance, unsigned long sample_count) { Amp *plugin_data = (Amp *)instance; const float gain = *(plugin_data->gain); @@ -69,7 +77,9 @@ static void runAmp(LV2_Handle instance, unsigned long sample_count) { } } -static void init() { + +static void +init() { ampDescriptor = (LV2_Descriptor *)malloc(sizeof(LV2_Descriptor)); @@ -82,8 +92,10 @@ static void init() { ampDescriptor->run = runAmp; } + SYMBOL_EXPORT -const LV2_Descriptor *lv2_descriptor(unsigned long index) { +const LV2_Descriptor* +lv2_descriptor(unsigned long index) { if (!ampDescriptor) init(); switch (index) { diff --git a/examples/plugins/Amp-slv2.lv2/amp.ttl b/examples/plugins/Amp-slv2.lv2/amp.ttl new file mode 100644 index 0000000..abc5b33 --- /dev/null +++ b/examples/plugins/Amp-slv2.lv2/amp.ttl @@ -0,0 +1,57 @@ +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix lv2: <http://lv2plug.in/ontology#> . +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix doap: <http://usefulinc.com/ns/doap#> . + +<http://codeson.net/plugins/amp> a lv2:Plugin ; + a lv2:AmplifierPlugin ; + doap:maintainer [ + foaf:name "Dave Robillard"; + foaf:homepage <http://codeson.net/> ; + foaf:mbox <mailto:drobilla@connect.carleton.ca> + ] ; + doap:name "Simple Amplifier" ; + doap:name "Einfacher Verstrker"@de ; + doap:licence <http://usefulinc.com/doap/licenses/gpl> ; + + lv2:property lv2:hardRTCapable ; + + lv2:port [ + a lv2:ControlRateInputPort ; + lv2:datatype lv2:float ; + lv2:index 0 ; + lv2:symbol "gain" ; + lv2:name "Gain" ; + lv2:name "Gewinn"@de ; + lv2:default [ rdf:value 0.0 ] ; + lv2:minimum [ rdf:value -90.0 ] ; + lv2:maximum [ rdf:value 24.0 ] ; + lv2:scalePoint [ + rdfs:label "+5" ; + rdf:value 5.0 + ] , [ + rdfs:label "Unity" ; + rdf:value 1.0 + ] , [ + rdfs:label "-5" ; + rdf:value -5.0 + ] , [ + rdfs:label "-10" ; + rdf:value -10.0 + ] + ] , [ + a lv2:AudioRateInputPort ; + lv2:datatype lv2:float ; + lv2:index 1 ; + lv2:symbol "in" ; + lv2:name "Input" + ] , [ + a lv2:AudioRateOutputPort ; + lv2:datatype lv2:float ; + lv2:index 2 ; + lv2:symbol "out" ; + lv2:name "Output" + ] +. + diff --git a/examples/plugins/Amp-swh.lv2/manifest.ttl b/examples/plugins/Amp-slv2.lv2/manifest.ttl index a26f506..94456e6 100644 --- a/examples/plugins/Amp-swh.lv2/manifest.ttl +++ b/examples/plugins/Amp-slv2.lv2/manifest.ttl @@ -4,6 +4,8 @@ @prefix lv2: <http://lv2plug.in/ontology#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -<http://plugin.org.uk/swh-plugins/amp> lv2:binary <amp.so> ; - rdfs:seeAlso <amp.ttl> . +<http://codeson.net/plugins/amp> + lv2:binary <amp.so> ; + rdfs:seeAlso <amp.ttl> . + diff --git a/examples/plugins/Amp-swh.lv2/amp.ttl b/examples/plugins/Amp-swh.lv2/amp.ttl deleted file mode 100644 index d44c0b9..0000000 --- a/examples/plugins/Amp-swh.lv2/amp.ttl +++ /dev/null @@ -1,68 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ontology#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix doap: <http://usefulinc.com/ns/doap#> . - -<http://plugin.org.uk/swh-plugins/amp> a lv2:Plugin ; - a lv2:AmplifierPlugin ; - doap:maintainer [ - foaf:name "Steve Harris"; - foaf:homepage <http://plugin.org.uk/> ; - foaf:mbox <mailto:steve@plugin.org.uk> ; - ] ; - doap:name "Simple amplifier" ; - doap:name "简单放大器"@ch ; - doap:name "Einfacher Verstärker"@de ; - doap:name "Simple amp"@en-gb ; - doap:name "Amplificador simple"@es ; - doap:name "Amplificateur de base"@fr ; - doap:name "Amplificatore semplice"@it ; - doap:name "簡単なアンプ"@jp ; - doap:name "Просто усилитель"@ru ; - doap:licence <http://usefulinc.com/doap/licenses/gpl> ; - lv2:property lv2:hardRtCapable ; - - lv2:port [ - a lv2:InputControlRatePort ; - lv2:datatype lv2:float ; - lv2:index 0 ; - lv2:symbol "gain" ; - lv2:name "gain" ; - lv2:name "收益"@ch ; - lv2:name "gewinn"@de ; - lv2:name "gain"@en-gb ; - lv2:name "aumento"@es ; - lv2:name "gain"@fr ; - lv2:name "guadagno"@it ; - lv2:name "利益"@jp ; - lv2:name "увеличение"@ru ; - lv2:default 0.0 ; - lv2:minimum -90.0 ; - lv2:maximum 24.0 ; - lv2:scalePoint [ - lv2:label "+5" ; - lv2:value 5.0 ; - ] , [ - lv2:label "0" ; - lv2:value 0.0 ; - ] , [ - lv2:label "-5" ; - lv2:value -5.0 ; - ] , [ - lv2:label "-10" ; - lv2:value -10.0 ; - ] - ] , [ - a lv2:InputAudioRatePort ; - lv2:datatype lv2:float ; - lv2:index 1 ; - lv2:symbol "in" ; - lv2:name "in" ; - ] , [ - a lv2:OutputAudioRatePort ; - lv2:datatype lv2:float ; - lv2:index 2 ; - lv2:symbol "out" ; - lv2:name "out" ; - ] -. - |