MatN prevents continuous reload of plugins for AppImage + Andrew libaom compile mod
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / pluginlv2client.C
index 6c5e468b0380f06af03fe67aa053e1e985efa0bf..7493d3b22662239c7f606063cad61fd7cb0cbd23 100644 (file)
@@ -383,13 +383,13 @@ PluginClient *PluginServer::new_lv2_plugin()
 {
        PluginLV2Client *client = new PluginLV2Client(this);
        if( client->load_lv2(path, client->title) ) { delete client;  return client = 0; }
-       client->init_lv2();
+       if( client->init_lv2() ) { delete client;  return client = 0; };
        return client;
 }
 
 int MWindow::init_lv2_index(MWindow *mwindow, Preferences *preferences, FILE *fp)
 {
-       printf("init lv2 index: %s\n", preferences->lv2_path);
+       printf("build lv2 index for: %s\n", preferences->lv2_path);
        PluginLV2BlackList blacklist("lv2_blacklist.txt");
 
        LilvWorld *world = lilv_world_new();
@@ -400,12 +400,19 @@ int MWindow::init_lv2_index(MWindow *mwindow, Preferences *preferences, FILE *fp
                const LilvPlugin *lilv = lilv_plugins_get(all_plugins, i);
                const char *uri = lilv_node_as_uri(lilv_plugin_get_uri(lilv));
                if( blacklist.is_badboy(uri) ) continue;
-printf("LOAD: %s\n", uri);
+// TODO It would be nice to print the full path of this particular plugin
+// in case it fails, because the systems' LV2 path might include multiple
+// directories. But function lilv_uri_to_path does not like the uri.
+
+// Don't print the newline, so called functions can concatenate their
+// error to the name.
+               printf("LOAD: %s ", uri);
                PluginServer server(mwindow, uri, PLUGIN_TYPE_LV2);
                int result = server.open_plugin(1, preferences, 0, 0);
                if( !result ) {
                        server.write_table(fp, uri, PLUGIN_LV2_ID, 0);
                        server.close_plugin();
+                       printf(" \n");
                }
        }