X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fladspa_plugin.cc;h=7ca6929112d12417e41304c230ef55c994270009;hb=935fd3b32f600d6f20c134fa2ccae78aa4781de5;hp=88f40c1f84041ac0530dbc2604195124c68d105c;hpb=22b07e0233a29d9633ffa825a79503befaf2e16e;p=ardour.git diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 88f40c1f84..7ca6929112 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -51,7 +51,7 @@ #include "pbd/stl_delete.h" -#include "i18n.h" +#include "pbd/i18n.h" #include using namespace std; @@ -141,11 +141,8 @@ LadspaPlugin::init (string module_path, uint32_t index, framecnt_t rate) *_latency_control_port = 0; } - if (!LADSPA_IS_PORT_INPUT(port_descriptor (i))) { - continue; - } - _shadow_data[i] = _default_value (i); + _control_data[i] = _shadow_data[i]; } } @@ -350,8 +347,8 @@ void LadspaPlugin::add_state (XMLNode* root) const { XMLNode *child; - char buf[16]; - LocaleGuard lg (X_("C")); + char buf[32]; + LocaleGuard lg; for (uint32_t i = 0; i < parameter_count(); ++i){ @@ -377,14 +374,14 @@ LadspaPlugin::set_state (const XMLNode& node, int version) #ifndef NO_PLUGIN_STATE XMLNodeList nodes; - XMLProperty *prop; + XMLProperty const * prop; XMLNodeConstIterator iter; XMLNode *child; const char *port; const char *data; uint32_t port_id; #endif - LocaleGuard lg (X_("C")); + LocaleGuard lg; if (node.name() != state_node_name()) { error << _("Bad node sent to LadspaPlugin::set_state") << endmsg; @@ -427,14 +424,14 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) { #ifndef NO_PLUGIN_STATE XMLNodeList nodes; - XMLProperty *prop; + XMLProperty const * prop; XMLNodeConstIterator iter; XMLNode *child; const char *port; const char *data; uint32_t port_id; #endif - LocaleGuard lg (X_("C")); + LocaleGuard lg; if (node.name() != state_node_name()) { error << _("Bad node sent to LadspaPlugin::set_state") << endmsg; @@ -569,10 +566,11 @@ LadspaPlugin::automatable () const int LadspaPlugin::connect_and_run (BufferSet& bufs, + framepos_t start, framepos_t end, double speed, ChanMapping in_map, ChanMapping out_map, pframes_t nframes, framecnt_t offset) { - Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset); + Plugin::connect_and_run (bufs, start, end, speed, in_map, out_map, nframes, offset); cycles_t now; cycles_t then = get_cycles (); @@ -738,6 +736,29 @@ LadspaPluginInfo::load (Session& session) } } +std::vector +LadspaPluginInfo::get_presets (bool /*user_only*/) const +{ + std::vector p; +#if (defined HAVE_LRDF && !defined NO_PLUGIN_STATE) + if (!isdigit (unique_id[0])) { + return p; + } + uint32_t id = atol (unique_id); + lrdf_uris* set_uris = lrdf_get_setting_uris(id); + + if (set_uris) { + for (uint32_t i = 0; i < (uint32_t) set_uris->count; ++i) { + if (char* label = lrdf_get_label (set_uris->items[i])) { + p.push_back (Plugin::PresetRecord (set_uris->items[i], label)); + } + } + lrdf_free_uris(set_uris); + } +#endif + return p; +} + LadspaPluginInfo::LadspaPluginInfo() { type = ARDOUR::LADSPA;