#include "jack_rack.h"
#include "lock_free_fifo.h"
#include "plugin_settings.h"
+#include "framework/mlt_log.h"
#ifndef _
#define _(x) x
/* 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);
}
{
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);
}
}
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;
}
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;
}
#include "plugin.h"
#include "jack_rack.h"
#include "process.h"
+#include "framework/mlt_log.h"
#define CONTROL_FIFO_SIZE 128
dl_handle = dlopen (desc->object_file, RTLD_NOW|RTLD_GLOBAL);
if (!dl_handle)
{
- fprintf (stderr, "%s: error opening shared object file '%s': %s\n",
+ mlt_log_warning( NULL, "%s: error opening shared object file '%s': %s\n",
__FUNCTION__, desc->object_file, dlerror());
return 1;
}
dlerr = dlerror();
if (dlerr)
{
- fprintf (stderr, "%s: error finding descriptor symbol in object file '%s': %s\n",
+ mlt_log_warning( NULL, "%s: error finding descriptor symbol in object file '%s': %s\n",
__FUNCTION__, desc->object_file, dlerr);
dlclose (dl_handle);
return 1;
if (!holder->aux_ports[i])
{
- fprintf (stderr, "Could not register jack port '%s'; aborting\n", port_name);
+ mlt_log_panic( NULL, "Could not register jack port '%s'; aborting\n", port_name);
abort ();
}
}
plugin->holders[i].aux_ports[j]);
if (err)
- fprintf (stderr, "%s: could not unregister jack port\n", __FUNCTION__);
+ mlt_log_warning( NULL, "%s: could not unregister jack port\n", __FUNCTION__);
}
g_free (plugin->holders[i].aux_ports);
err = dlclose (plugin->dl_handle);
if (err)
{
- fprintf (stderr, "%s: error closing shared object '%s': %s\n",
+ mlt_log_warning( NULL, "%s: error closing shared object '%s': %s\n",
__FUNCTION__, plugin->desc->object_file, dlerror ());
}
#include "plugin_mgr.h"
#include "plugin_desc.h"
+#include "framework/mlt_log.h"
static gboolean
dl_handle = dlopen (filename, RTLD_NOW|RTLD_GLOBAL);
if (!dl_handle)
{
-// fprintf (stderr, "%s: error opening shared object file '%s': %s\n",
-// __FUNCTION__, filename, dlerror());
+ mlt_log_warning( NULL, "%s: error opening shared object file '%s': %s\n",
+ __FUNCTION__, filename, dlerror());
return;
}
dlerr = dlerror();
if (dlerr) {
- fprintf (stderr, "%s: error finding ladspa_descriptor symbol in object file '%s': %s\n",
+ mlt_log_warning( NULL, "%s: error finding ladspa_descriptor symbol in object file '%s': %s\n",
__FUNCTION__, filename, dlerr);
dlclose (dl_handle);
return;
if (exists)
{
- printf ("Plugin %ld exists in both '%s' and '%s'; using version in '%s'\n",
+ mlt_log_info( NULL, "Plugin %ld exists in both '%s' and '%s'; using version in '%s'\n",
descriptor->UniqueID, other_desc->object_file, filename, other_desc->object_file);
plugin_index++;
continue;
plugin_mgr->plugin_count++;
/* print in the splash screen */
- /* printf ("Loaded plugin '%s'\n", desc->name); */
+ /* mlt_log_verbose( NULL, "Loaded plugin '%s'\n", desc->name); */
}
err = dlclose (dl_handle);
if (err)
{
- fprintf (stderr, "%s: error closing object file '%s': %s\n",
+ mlt_log_warning( NULL, "%s: error closing object file '%s': %s\n",
__FUNCTION__, filename, dlerror ());
}
}
dir_stream = opendir (dir);
if (!dir_stream)
{
-/* fprintf (stderr, "%s: error opening directory '%s': %s\n",
+/* mlt_log_warning( NULL, "%s: error opening directory '%s': %s\n",
__FUNCTION__, dir, strerror (errno)); */
return;
}
err = closedir (dir_stream);
if (err)
- fprintf (stderr, "%s: error closing directory '%s': %s\n",
+ mlt_log_warning( NULL, "%s: error closing directory '%s': %s\n",
__FUNCTION__, dir, strerror (errno));
}
if (!pm->all_plugins)
{
- fprintf (stderr, "No LADSPA plugins were found!\n\nCheck your LADSPA_PATH environment variable.\n");
+ mlt_log_warning( NULL, "No LADSPA plugins were found!\n\nCheck your LADSPA_PATH environment variable.\n");
abort ();
}
#include "lock_free_fifo.h"
#include "plugin.h"
#include "jack_rack.h"
+#include "framework/mlt_log.h"
#ifndef _
#define _(x) x
procinfo->jack_input_buffers[channel] = jack_port_get_buffer (procinfo->jack_input_ports[channel], frames);
if (!procinfo->jack_input_buffers[channel])
{
- fprintf (stderr, "%s: no jack buffer for input port %ld\n", __FUNCTION__, channel);
+ mlt_log_verbose( NULL, "%s: no jack buffer for input port %ld\n", __FUNCTION__, channel);
return 1;
}
procinfo->jack_output_buffers[channel] = jack_port_get_buffer (procinfo->jack_output_ports[channel], frames);
if (!procinfo->jack_output_buffers[channel])
{
- fprintf (stderr, "%s: no jack buffer for output port %ld\n", __FUNCTION__, channel);
+ mlt_log_verbose( NULL, "%s: no jack buffer for output port %ld\n", __FUNCTION__, channel);
return 1;
}
}
if (!procinfo)
{
- fprintf (stderr, "%s: no process_info from jack!\n", __FUNCTION__);
+ mlt_log_error( NULL, "%s: no process_info from jack!\n", __FUNCTION__);
return 1;
}
procinfo->jack_input_buffers[channel] = inputs[channel];
if (!procinfo->jack_input_buffers[channel])
{
- fprintf (stderr, "%s: no jack buffer for input port %ld\n", __FUNCTION__, channel);
+ mlt_log_verbose( NULL, "%s: no jack buffer for input port %ld\n", __FUNCTION__, channel);
return 1;
}
procinfo->jack_output_buffers[channel] = outputs[channel];
if (!procinfo->jack_output_buffers[channel])
{
- fprintf (stderr, "%s: no jack buffer for output port %ld\n", __FUNCTION__, channel);
+ mlt_log_verbose( NULL, "%s: no jack buffer for output port %ld\n", __FUNCTION__, channel);
return 1;
}
}
if (!procinfo)
{
- fprintf (stderr, "%s: no process_info from jack!\n", __FUNCTION__);
+ mlt_log_error( NULL, "%s: no process_info from jack!\n", __FUNCTION__);
return 1;
}
err = get_jack_buffers (procinfo, frames);
if (err)
{
- fprintf(stderr, "%s: failed to get jack ports, not processing\n", __FUNCTION__);
+ mlt_log_warning( NULL, "%s: failed to get jack ports, not processing\n", __FUNCTION__);
return 0;
}
static int
process_info_connect_jack (process_info_t * procinfo)
{
- printf (_("Connecting to JACK server with client name '%s'\n"), procinfo->jack_client_name);
+ mlt_log_info( NULL, _("Connecting to JACK server with client name '%s'\n"), procinfo->jack_client_name);
procinfo->jack_client = jack_client_new (procinfo->jack_client_name);
if (!procinfo->jack_client)
{
- fprintf (stderr, "%s: could not create jack client; is the jackd server running?\n", __FUNCTION__);
+ mlt_log_warning( NULL, "%s: could not create jack client; is the jackd server running?\n", __FUNCTION__);
return 1;
}
- printf (_("Connected to JACK server\n"));
+ mlt_log_verbose( NULL, _("Connected to JACK server\n"));
jack_set_process_callback (procinfo->jack_client, process_jack, procinfo);
jack_on_shutdown (procinfo->jack_client, jack_shutdown_cb, procinfo);
full_port_name = g_strdup_printf ("%s:%s", procinfo->jack_client_name, port_name);
- printf (_("Connecting ports '%s' and '%s'\n"), full_port_name, jack_ports[jack_port_index]);
+ mlt_log_debug( NULL, _("Connecting ports '%s' and '%s'\n"), full_port_name, jack_ports[jack_port_index]);
err = jack_connect (procinfo->jack_client,
in ? jack_ports[jack_port_index] : full_port_name,
in ? full_port_name : jack_ports[jack_port_index]);
if (err)
- fprintf (stderr, "%s: error connecting ports '%s' and '%s'\n",
+ mlt_log_warning( NULL, "%s: error connecting ports '%s' and '%s'\n",
__FUNCTION__, full_port_name, jack_ports[jack_port_index]);
else
- printf (_("Connected ports '%s' and '%s'\n"), full_port_name, jack_ports[jack_port_index]);
+ mlt_log_info( NULL, _("Connected ports '%s' and '%s'\n"), full_port_name, jack_ports[jack_port_index]);
free (full_port_name);
}
{
port_name = g_strdup_printf ("%s_%ld", in ? "in" : "out", i + 1);
- //printf (_("Creating %s port %s\n"), in ? "input" : "output", port_name);
+ //mlt_log_debug( NULL, _("Creating %s port %s\n"), in ? "input" : "output", port_name);
port_ptr = (in ? &procinfo->jack_input_ports[i]
: &procinfo->jack_output_ports[i]);
if (!*port_ptr)
{
- fprintf (stderr, "%s: could not register port '%s'; aborting\n",
+ mlt_log_error( NULL, "%s: could not register port '%s'; aborting\n",
__FUNCTION__, port_name);
return 1;
}
- //printf (_("Created %s port %s\n"), in ? "input" : "output", port_name);
+ //mlt_log_debug( NULL, _("Created %s port %s\n"), in ? "input" : "output", port_name);
if ((in && connect_inputs) || (!in && connect_outputs))
process_info_connect_port (procinfo, in, i, port_name);