Updates for new header/schema

git-svn-id: http://svn.drobilla.net/lad@109 a436a847-0d15-0410-975c-d299462d15a1
This commit is contained in:
dave 2006-08-22 16:12:33 +00:00
parent 730c3490d3
commit 1abd854fe1
3 changed files with 24 additions and 10 deletions

View File

@ -32,7 +32,7 @@ cleanupAmp(LV2_Handle instance) {
static void
connectPortAmp(LV2_Handle instance, unsigned long port,
connectPortAmp(LV2_Handle instance, uint32_t port,
void *data) {
Amp *plugin = (Amp *)instance;
@ -52,7 +52,7 @@ connectPortAmp(LV2_Handle instance, unsigned long port,
static LV2_Handle
instantiateAmp(const LV2_Descriptor *descriptor,
unsigned long s_rate, const char *path , const LV2_Host_Feature **features) {
uint32_t s_rate, const char *path , const LV2_Host_Feature **features) {
Amp *plugin_data = (Amp *)malloc(sizeof(Amp));
return (LV2_Handle)plugin_data;
@ -62,14 +62,14 @@ instantiateAmp(const LV2_Descriptor *descriptor,
#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) {
runAmp(LV2_Handle instance, uint32_t sample_count) {
Amp *plugin_data = (Amp *)instance;
const float gain = *(plugin_data->gain);
const float * const input = plugin_data->input;
float * const output = plugin_data->output;
unsigned long pos;
uint32_t pos;
float coef = DB_CO(gain);
for (pos = 0; pos < sample_count; pos++) {
@ -95,7 +95,7 @@ init() {
SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(unsigned long index) {
lv2_descriptor(uint32_t index) {
if (!ampDescriptor) init();
switch (index) {

View File

@ -21,8 +21,8 @@
* USA.
*/
#ifndef LV2_INCLUDED
#define LV2_INCLUDED
#ifndef LV2_H_INCLUDED
#define LV2_H_INCLUDED
#include <stdint.h>
@ -33,6 +33,7 @@ extern "C" {
/* ************************************************************************* */
/* Overview:
*
* There are a large number of open source and free software synthesis
@ -70,6 +71,7 @@ extern "C" {
* This API contains very limited error-handling.
*/
/* ************************************************************************* */
@ -84,6 +86,7 @@ typedef void * LV2_Handle;
/* ************************************************************************* */
/** Host feature.
*
* These are passed to a plugin's instantiate method to represent a special
@ -300,8 +303,19 @@ typedef const LV2_Descriptor *
/* ******************************************************************** */
/* Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded
* by the host as a symbol from the dynamic library.
*/
#ifdef WIN32
#define LV2_SYMBOL_EXPORT __declspec(dllexport)
#else
#define LV2_SYMBOL_EXPORT
#endif
#ifdef __cplusplus
}
#endif
#endif /* LV2_INCLUDED */
#endif /* LV2_H_INCLUDED */

View File

@ -72,8 +72,8 @@ The class that represents an LV2 port
In order for it to be used by a host it must have at least
the following properties:
rdf:type (where object is exactly one of
:InputControlRatePort, :OutputControlRatePort,
:InputAudioRatePort, :OututAudioRatePort)
:ControlRateInputPort, :ControlRateOutputPort,
:AudioRateInputPort, :AudioRateOutputPort)
:dataType
:index
:symbol