#include "jack_rack.h"
#include "lock_free_fifo.h"
#include "plugin_settings.h"
+#include "framework/mlt_log.h"
#ifndef _
#define _(x) x
#define _x (const xmlChar*)
#define _s (const char*)
+extern plugin_mgr_t *g_jackrack_plugin_mgr;
+
jack_rack_t *
jack_rack_new (const char * client_name, unsigned long channels)
{
g_free (rack);
return NULL;
}
- rack->plugin_mgr = plugin_mgr_new ();
+ rack->plugin_mgr = g_jackrack_plugin_mgr;
plugin_mgr_set_plugins (rack->plugin_mgr, channels);
return rack;
jack_rack_destroy (jack_rack_t * jack_rack)
{
process_quit (jack_rack->procinfo);
- plugin_mgr_destroy (jack_rack->plugin_mgr);
+ // plugin_mgr is shared and global now, so we do not destroy it with each instance
+// plugin_mgr_destroy (jack_rack->plugin_mgr);
process_info_destroy (jack_rack->procinfo);
g_slist_free (jack_rack->saved_plugins);
g_free (jack_rack);
/* check whether or not the plugin is RT capable and confirm with the user if it isn't */
if (!LADSPA_IS_HARD_RT_CAPABLE(desc->properties)) {
- fprintf (stderr, "Plugin not RT capable. The plugin '%s' does not describe itself as being capable of real-time operation. You may experience drop outs or jack may even kick us out if you use it.\n",
+ mlt_log_info( NULL, "Plugin not RT capable. The plugin '%s' does not describe itself as being capable of real-time operation. You may experience drop outs or jack may even kick us out if you use it.\n",
desc->name);
}
plugin = plugin_new (desc, jack_rack);
if (!plugin) {
- fprintf (stderr, "Error loading file plugin '%s' from file '%s'\n",
+ mlt_log_error( NULL, "Error loading file plugin '%s' from file '%s'\n",
desc->name, desc->object_file);
}
}
saved_plugin = NULL;
}
-
+
+ if ( !saved_plugin )
+ return;
+
/* initialize plugin parameters */
plugin->enabled = settings_get_enabled (saved_plugin->settings);
plugin->wet_dry_enabled = settings_get_wet_dry_enabled (saved_plugin->settings);
{
value = settings_get_control_value (saved_plugin->settings, copy, control);
plugin->holders[copy].control_memory[control] = value;
-//printf("setting control value %s (%d) = %f\n", saved_plugin->settings->desc->port_names[control], copy, value);
+//mlt_log_debug( NULL, "setting control value %s (%d) = %f\n", saved_plugin->settings->desc->port_names[control], copy, value);
// lff_write (plugin->holders[copy].ui_control_fifos + control, &value);
}
if (plugin->wet_dry_enabled)
{
value = settings_get_wet_dry_value (saved_plugin->settings, channel);
plugin->wet_dry_values[channel] = value;
-//printf("setting wet/dry value %d = %f\n", channel, value);
+//mlt_log_debug( NULL, "setting wet/dry value %d = %f\n", channel, value);
// lff_write (plugin->wet_dry_fifos + channel, &value);
}
}
xmlChar *content;
unsigned long num;
unsigned long control = 0;
+#ifdef WIN32
+ xmlFreeFunc xmlFree = NULL;
+ xmlMemGet( &xmlFree, NULL, NULL, NULL);
+#endif
for (node = plugin->children; node; node = node->next)
{
desc = plugin_mgr_get_any_desc (jack_rack->plugin_mgr, num);
if (!desc)
{
- fprintf (stderr, _("The file '%s' contains an unknown plugin with ID '%ld'; skipping\n"), filename, num);
+ mlt_log_verbose( NULL, _("The file '%s' contains an unknown plugin with ID '%ld'; skipping\n"), filename, num);
return;
}
xmlNodePtr node;
xmlChar *content;
saved_plugin_t * saved_plugin;
+#ifdef WIN32
+ xmlFreeFunc xmlFree = NULL;
+ xmlMemGet( &xmlFree, NULL, NULL, NULL);
+#endif
for (node = jackrack->children; node; node = node->next)
{
doc = xmlParseFile (filename);
if (!doc)
{
- fprintf (stderr, _("Could not parse file '%s'\n"), filename);
+ mlt_log_error( NULL, _("Could not parse file '%s'\n"), filename);
return 1;
}
if (xmlStrcmp ( ((xmlDtdPtr)doc->children)->name, _x("jackrack")) != 0)
{
- fprintf (stderr, _("The file '%s' is not a JACK Rack settings file\n"), filename);
+ mlt_log_error( NULL, _("The file '%s' is not a JACK Rack settings file\n"), filename);
return 1;
}