clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit 2940a86a5a313999213542d99f6f3072d6b34a4f
parent e30bf65f53a25429348b7e29c7c33de69be8492d
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Fri,  3 Oct 2014 01:09:57 +0200

Aestetics

Diffstat:
MMakefile | 2+-
Rclap.h -> include/clap/clap.h | 0
Asamples/clap-info.c | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsamples/load-plugins.c | 52----------------------------------------------------
Mspec.html | 23+++++++++++++++++++++--
Mspec.rst | 4++--
Mstyle.css | 21+++++++++++++++++++++
7 files changed, 97 insertions(+), 57 deletions(-)

diff --git a/Makefile b/Makefile @@ -5,5 +5,5 @@ all: spec.html syntax.css: pygmentize -S monokai -f html -a .code >$@ -spec.html: spec.rst syntax.css style.css +spec.html: spec.rst syntax.css rst2html --syntax-highlight=short --stylesheet=style.css,syntax.css $< >$@ diff --git a/clap.h b/include/clap/clap.h diff --git a/samples/clap-info.c b/samples/clap-info.c @@ -0,0 +1,52 @@ +#include <stdio.h> +#include <dlfcn.h> + +#include <clap/clap.h> + +int main(int argc, char **argv) +{ + struct clap_host host; // XXX initialize host + + void * handle = dlopen(argv[1], RTLD_NOW | RTLD_LOCAL); + if (!handle) { + fprintf(stderr, "failed to load %s: %s\n", argv[1], dlerror()); + return 1; + } + + union { + void *ptr; + clap_create_f clap_create; + } symbol; + + symbol.ptr = dlsym(handle, "clap_create"); + if (!symbol.ptr) { + fprintf(stderr, "symbol not found: clap_create\n"); + return 1; + } + + for (uint32_t index = 0; index < (uint32_t)-1; ++index) { + struct clap_plugin *plugin = symbold.clap_create(index, host, 48000); + if (!plugin) + break; + + fprintf(stdio, + "found plugin:\n" + " id: %s\n" + " name: %s\n" + " description: %s\n" + " manufacturer: %s\n" + " version: %s\n" + " url: %s\n", + plugin->id, + plugin->name, + plugin->description, + plugin->manufacturer, + plugin->version, + plugin->url); + + // destroy the plugin + plugin->destroy(plugin); + } + + return 0; +} diff --git a/samples/load-plugins.c b/samples/load-plugins.c @@ -1,52 +0,0 @@ -#include <stdio.h> -#include <dlfcn.h> - -#include <clap.h> - -int main(int argc, char **argv) -{ - struct clap_host host; // XXX initialize host - - void * handle = dlopen(argv[1], RTLD_NOW | RTLD_LOCAL); - if (!handle) { - fprintf(stderr, "failed to load %s: %s\n", argv[1], dlerror()); - return 1; - } - - union { - void *ptr; - clap_create_f clap_create; - } symbol; - - symbol.ptr = dlsym(handle, "clap_create"); - if (!symbol.ptr) { - fprintf(stderr, "symbol not found: clap_create\n"); - return 1; - } - - for (uint32_t index = 0; index < (uint32_t)-1; ++index) { - struct clap_plugin *plugin = symbold.clap_create(index, host, 48000); - if (!plugin) - break; - - fprintf(stdio, - "found plugin:\n" - " id: %s\n" - " name: %s\n" - " description: %s\n" - " manufacturer: %s\n" - " version: %s\n" - " url: %s\n", - plugin->id, - plugin->name, - plugin->description, - plugin->manufacturer, - plugin->version, - plugin->url); - - // destroy the plugin - plugin->destroy(plugin); - } - - return 0; -} diff --git a/spec.html b/spec.html @@ -7,7 +7,26 @@ <title>CLAP (CLever Audio Plugin)</title> <style type="text/css"> - +.document { + width: 700px; +} + +.title { + text-align: center; +} + +.subtitle { + text-align: center; +} + +.reference, .toc-backref { + text-decoration: none; + color: #942; +} + +.reference:hover, .toc-backref:hover { + color: #294; +} </style> <style type="text/css"> @@ -197,7 +216,7 @@ the index until <tt class="docutils literal">clap_create</tt> returns <tt class= <span class="cp">#include &lt;stdio.h&gt; #include &lt;dlfcn.h&gt; </span> -<span class="cp">#include &lt;clap.h&gt; +<span class="cp">#include &lt;clap/clap.h&gt; </span> <span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span> <span class="p">{</span> diff --git a/spec.rst b/spec.rst @@ -82,7 +82,7 @@ the index until ``clap_create`` returns ``NULL``. Sample ~~~~~~ -.. include:: samples/load-plugins.c +.. include:: samples/clap-info.c :code: c Description @@ -256,5 +256,5 @@ Examples References ========== -.. include:: clap.h +.. include:: include/clap/clap.h :code: c diff --git a/style.css b/style.css @@ -0,0 +1,20 @@ +.document { + width: 700px; +} + +.title { + text-align: center; +} + +.subtitle { + text-align: center; +} + +.reference, .toc-backref { + text-decoration: none; + color: #942; +} + +.reference:hover, .toc-backref:hover { + color: #294; +} +\ No newline at end of file