fix single-bus AU rendering & related updates
[ardour.git] / libs / ardour / ladspa_plugin.cc
index db28d6d199b074b04cc9228864164f39fc0b0da4..40d8b68951996374a14f81af362c17f338b663fc 100644 (file)
@@ -350,8 +350,8 @@ void
 LadspaPlugin::add_state (XMLNode* root) const
 {
        XMLNode *child;
-       char buf[16];
-       LocaleGuard lg (X_("POSIX"));
+       char buf[32];
+       LocaleGuard lg (X_("C"));
 
        for (uint32_t i = 0; i < parameter_count(); ++i){
 
@@ -384,7 +384,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
        const char *data;
        uint32_t port_id;
 #endif
-       LocaleGuard lg (X_("POSIX"));
+       LocaleGuard lg (X_("C"));
 
        if (node.name() != state_node_name()) {
                error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
@@ -434,7 +434,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
        const char *data;
        uint32_t port_id;
 #endif
-       LocaleGuard lg (X_("POSIX"));
+       LocaleGuard lg (X_("C"));
 
        if (node.name() != state_node_name()) {
                error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
@@ -738,6 +738,29 @@ LadspaPluginInfo::load (Session& session)
        }
 }
 
+std::vector<Plugin::PresetRecord>
+LadspaPluginInfo::get_presets (bool /*user_only*/) const
+{
+       std::vector<Plugin::PresetRecord> 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;
@@ -956,13 +979,13 @@ LadspaPlugin::do_save_preset (string name)
 LADSPA_PortDescriptor
 LadspaPlugin::port_descriptor (uint32_t i) const
 {
-       if (i < _descriptor->PortCount) {               
+       if (i < _descriptor->PortCount) {
                return _descriptor->PortDescriptors[i];
        }
-       
+
        warning << "LADSPA plugin port index " << i << " out of range." << endmsg;
        return 0;
 }
 
-               
-       
+
+