ardour
Classes | Macros | Functions | Variables
lv2_plugin.cc File Reference
#include <string>
#include <vector>
#include <limits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <glib/gstdio.h>
#include <glib/gprintf.h>
#include <glibmm.h>
#include <boost/utility.hpp>
#include "pbd/file_utils.h"
#include "pbd/stl_delete.h"
#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/xml++.h"
#include "libardour-config.h"
#include "ardour/audio_buffer.h"
#include "ardour/audioengine.h"
#include "ardour/debug.h"
#include "ardour/lv2_plugin.h"
#include "ardour/session.h"
#include "ardour/tempo.h"
#include "ardour/types.h"
#include "ardour/utils.h"
#include "ardour/worker.h"
#include "ardour/search_paths.h"
#include "i18n.h"
#include <locale.h>
#include <lilv/lilv.h>
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
#include "lv2/lv2plug.in/ns/ext/log/log.h"
#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
#include "lv2/lv2plug.in/ns/ext/port-props/port-props.h"
#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/ext/time/time.h"
#include "lv2/lv2plug.in/ns/ext/worker/worker.h"
#include "lv2/lv2plug.in/ns/ext/resize-port/resize-port.h"
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#include "lv2/lv2plug.in/ns/extensions/units/units.h"
#include "lv2/lv2plug.in/ns/ext/patch/patch.h"
#include "lv2_evbuf.h"

Go to the source code of this file.

Classes

class  LV2World
 
struct  ARDOUR::LV2Plugin::Impl
 

Macros

#define LV2_ATOM_CONTENTS_CONST(type, atom)   ((const void*)((const uint8_t*)(atom) + sizeof(type)))
 
#define LV2_ATOM_BODY_CONST(atom)   LV2_ATOM_CONTENTS_CONST(LV2_Atom, atom)
 
#define LV2_PATCH__property   LV2_PATCH_PREFIX "property"
 
#define LV2_PATCH__value   LV2_PATCH_PREFIX "value"
 
#define LV2_PATCH__writable   LV2_PATCH_PREFIX "writable"
 

Functions

static LV2_Worker_Status work_schedule (LV2_Worker_Schedule_Handle handle, uint32_t size, const void *data)
 
static LV2_Worker_Status work_respond (LV2_Worker_Respond_Handle handle, uint32_t size, const void *data)
 
static int log_vprintf (LV2_Log_Handle, LV2_URID type, const char *fmt, va_list args)
 
static int log_printf (LV2_Log_Handle handle, LV2_URID type, const char *fmt,...)
 
static LilvNode * get_value (LilvWorld *world, const LilvNode *subject, const LilvNode *predicate)
 
static void set_port_value (const char *port_symbol, void *user_data, const void *value, uint32_t, uint32_t type)
 
static void forge_variant (LV2_Atom_Forge *forge, const Variant &value)
 
static bool uri_to_variant_type (const std::string &uri, Variant::Type &type)
 
static void load_parameter_descriptor_units (LilvWorld *lworld, ParameterDescriptor &desc, const LilvNodes *units)
 
static void load_parameter_descriptor (LV2World &world, ParameterDescriptor &desc, Variant::Type datatype, const LilvNode *subject)
 
static bool write_position (LV2_Atom_Forge *forge, LV2_Evbuf *buf, const TempoMetric &t, Timecode::BBT_Time &bbt, double speed, framepos_t position, framecnt_t offset)
 
static bool lv2_filter (const string &str, void *)
 

Variables

static const size_t NBUFS = 4
 
static LV2World _world
 

Macro Definition Documentation

#define LV2_ATOM_BODY_CONST (   atom)    LV2_ATOM_CONTENTS_CONST(LV2_Atom, atom)

Definition at line 88 of file lv2_plugin.cc.

#define LV2_ATOM_CONTENTS_CONST (   type,
  atom 
)    ((const void*)((const uint8_t*)(atom) + sizeof(type)))

Definition at line 84 of file lv2_plugin.cc.

#define LV2_PATCH__property   LV2_PATCH_PREFIX "property"

Definition at line 91 of file lv2_plugin.cc.

#define LV2_PATCH__value   LV2_PATCH_PREFIX "value"

Definition at line 94 of file lv2_plugin.cc.

#define LV2_PATCH__writable   LV2_PATCH_PREFIX "writable"

Definition at line 97 of file lv2_plugin.cc.

Function Documentation

static void forge_variant ( LV2_Atom_Forge *  forge,
const Variant value 
)
static

Definition at line 1245 of file lv2_plugin.cc.

static LilvNode* get_value ( LilvWorld *  world,
const LilvNode *  subject,
const LilvNode *  predicate 
)
static

Definition at line 971 of file lv2_plugin.cc.

static void load_parameter_descriptor ( LV2World world,
ParameterDescriptor desc,
Variant::Type  datatype,
const LilvNode *  subject 
)
static

Definition at line 1382 of file lv2_plugin.cc.

static void load_parameter_descriptor_units ( LilvWorld *  lworld,
ParameterDescriptor desc,
const LilvNodes *  units 
)
static

Definition at line 1362 of file lv2_plugin.cc.

static int log_printf ( LV2_Log_Handle  handle,
LV2_URID  type,
const char *  fmt,
  ... 
)
static

Definition at line 223 of file lv2_plugin.cc.

static int log_vprintf ( LV2_Log_Handle  ,
LV2_URID  type,
const char *  fmt,
va_list  args 
)
static

Definition at line 204 of file lv2_plugin.cc.

static bool lv2_filter ( const string &  str,
void *   
)
static

Definition at line 2301 of file lv2_plugin.cc.

static void set_port_value ( const char *  port_symbol,
void *  user_data,
const void *  value,
uint32_t  ,
uint32_t  type 
)
static

Definition at line 1015 of file lv2_plugin.cc.

static bool uri_to_variant_type ( const std::string &  uri,
Variant::Type type 
)
static

Get a variant type from a URI, return false iff no match found.

Definition at line 1286 of file lv2_plugin.cc.

static LV2_Worker_Status work_respond ( LV2_Worker_Respond_Handle  handle,
uint32_t  size,
const void *  data 
)
static

Called by the plugin to respond to non-RT work.

Definition at line 186 of file lv2_plugin.cc.

static LV2_Worker_Status work_schedule ( LV2_Worker_Schedule_Handle  handle,
uint32_t  size,
const void *  data 
)
static

Called by the plugin to schedule non-RT work.

Definition at line 169 of file lv2_plugin.cc.

static bool write_position ( LV2_Atom_Forge *  forge,
LV2_Evbuf buf,
const TempoMetric t,
Timecode::BBT_Time &  bbt,
double  speed,
framepos_t  position,
framecnt_t  offset 
)
static

Write an ardour position/time/tempo/meter as an LV2 event.

Returns
true on success.

Definition at line 1826 of file lv2_plugin.cc.

Variable Documentation

LV2World _world
static

Definition at line 163 of file lv2_plugin.cc.

const size_t NBUFS = 4
static

The number of MIDI buffers that will fit in a UI/worker comm buffer. This needs to be roughly the number of cycles the UI will get around to actually processing the traffic. Lower values are flakier but save memory.

Definition at line 104 of file lv2_plugin.cc.