Tidy (whitespace changes only).

git-svn-id: svn://localhost/ardour2/branches/3.0@8137 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2010-11-30 22:22:05 +00:00
parent f9c6d2d5a1
commit da35445adb
2 changed files with 91 additions and 95 deletions

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2008 Paul Davis
Author: Dave Robillard
Copyright (C) 2008-2010 Paul Davis
Author: David Robillard
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -26,7 +26,6 @@
#include <string>
#include <dlfcn.h>
#include "pbd/stateful.h"
#include <jack/types.h>
@ -138,6 +137,7 @@ class LV2Plugin : public ARDOUR::Plugin
bool _was_activated;
bool _supports_persist;
std::vector<bool> _port_is_input;
std::map<std::string,uint32_t> _port_indices;
typedef struct { const void* (*extension_data)(const char* uri); } LV2_DataAccess;
@ -183,8 +183,8 @@ struct LV2World {
class LV2PluginInfo : public PluginInfo {
public:
LV2PluginInfo (void* slv2_world, void* slv2_plugin);;
~LV2PluginInfo ();;
LV2PluginInfo (void* slv2_world, void* slv2_plugin);
~LV2PluginInfo ();
static PluginInfoList* discover (void* slv2_world);
PluginPtr load (Session& session);

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2008 Paul Davis
Author: Dave Robillard
Copyright (C) 2008-2010 Paul Davis
Author: David Robillard
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -87,15 +87,15 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
_latency_control_port = 0;
_was_activated = false;
SLV2Value persist_uri = slv2_value_new_uri(_world.world, "http://lv2plug.in/ns/ext/persist");
_supports_persist = slv2_plugin_has_feature(plugin, persist_uri);
slv2_value_free(persist_uri);
_instance_access_feature.URI = "http://lv2plug.in/ns/ext/instance-access";
_data_access_feature.URI = "http://lv2plug.in/ns/ext/data-access";
_persist_feature.URI = "http://lv2plug.in/ns/ext/persist";
_persist_feature.data = NULL;
SLV2Value persist_uri = slv2_value_new_uri(_world.world, _persist_feature.URI);
_supports_persist = slv2_plugin_has_feature(plugin, persist_uri);
slv2_value_free(persist_uri);
_features = (LV2_Feature**)malloc(sizeof(LV2_Feature*) * 5);
_features[0] = &_instance_access_feature;
_features[1] = &_data_access_feature;
@ -105,7 +105,6 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
_instance = slv2_plugin_instantiate(plugin, rate, _features);
_name = slv2_plugin_get_name(plugin);
assert(_name);
_author = slv2_plugin_get_author_name(plugin);
if (_instance == 0) {
@ -128,15 +127,14 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
_sample_rate = rate;
const bool latent = slv2_plugin_has_latency(plugin);
uint32_t latency_port = (latent ? slv2_plugin_get_latency_port_index(plugin) : 0);
const uint32_t num_ports = slv2_plugin_get_num_ports(plugin);
_control_data = new float[num_ports];
_shadow_data = new float[num_ports];
_defaults = new float[num_ports];
const bool latent = slv2_plugin_has_latency(plugin);
uint32_t latency_port = (latent ? slv2_plugin_get_latency_port_index(plugin) : 0);
for (uint32_t i = 0; i < num_ports; ++i) {
SLV2Port port = slv2_plugin_get_port_by_index(plugin, i);
SLV2Value sym = slv2_port_get_symbol(_plugin, port);
@ -398,13 +396,13 @@ int
LV2Plugin::set_state(const XMLNode& node, int version)
{
XMLNodeList nodes;
XMLProperty *prop;
XMLProperty* prop;
XMLNodeConstIterator iter;
XMLNode *child;
const char *sym;
const char *value;
XMLNode* child;
const char* sym;
const char* value;
uint32_t port_id;
LocaleGuard lg (X_("POSIX"));
LocaleGuard lg(X_("POSIX"));
if (node.name() != state_node_name()) {
error << _("Bad node sent to LV2Plugin::set_state") << endmsg;
@ -467,8 +465,8 @@ LV2Plugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
desc.label = slv2_value_as_string(slv2_port_get_name(_plugin, port));
desc.lower = min ? slv2_value_as_float(min) : 0.0f;
desc.upper = max ? slv2_value_as_float(max) : 1.0f;
desc.min_unbound = false; // TODO (LV2 extension)
desc.max_unbound = false; // TODO (LV2 extension)
desc.min_unbound = false; // TODO: LV2 extension required
desc.max_unbound = false; // TODO: LV2 extension required
if (desc.integer_step) {
desc.step = 1.0;
@ -661,14 +659,13 @@ LV2Plugin::latency_compute_run ()
uint32_t port_index = 0;
uint32_t in_index = 0;
uint32_t out_index = 0;
const nframes_t bufsize = 1024;
float buffer[bufsize];
memset(buffer,0,sizeof(float)*bufsize);
memset(buffer, 0, sizeof(float) * bufsize);
/* Note that we've already required that plugins
be able to handle in-place processing.
*/
// FIXME: Ensure plugins can handle in-place processing
port_index = 0;
@ -705,7 +702,7 @@ LV2World::LV2World()
srate = slv2_value_new_uri(world, SLV2_NAMESPACE_LV2 "sampleRate");
gtk_gui = slv2_value_new_uri(world, "http://lv2plug.in/ns/extensions/ui#GtkUI");
external_gui = slv2_value_new_uri(world, "http://lv2plug.in/ns/extensions/ui#external");
logarithmic = slv2_value_new_uri(world, "http://lv2plug.in/ns/dev/extportinfo#logarithmic");
logarithmic = slv2_value_new_uri(world, "http: //lv2plug.in/ns/dev/extportinfo#logarithmic");
}
LV2World::~LV2World()
@ -754,7 +751,6 @@ PluginInfoList*
LV2PluginInfo::discover (void* lv2_world)
{
PluginInfoList* plugs = new PluginInfoList;
LV2World* world = (LV2World*)lv2_world;
SLV2Plugins plugins = slv2_world_get_all_plugins(world->world);