]> git.sesse.net Git - mlt/blobdiff - src/modules/jackrack/plugin_desc.c
Add ladspa producer
[mlt] / src / modules / jackrack / plugin_desc.c
index 1dfea31a4b2def7092c1860728a9d4774d0cb153..88512ccaec6b874b8c57a37140358407e8760492 100644 (file)
@@ -1,20 +1,26 @@
 /*
- *   JACK Rack
- *    
- *   Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net)
- *    
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * JACK Rack
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   GNU General Public License for more details.
+ * Original:
+ * Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net)
  *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Modification for MLT:
+ * Copyright (C) 2004 Ushodaya Enterprises Limited
+ * Author: Dan Dennedy <dan@dennedy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <math.h>
@@ -50,6 +56,7 @@ plugin_desc_init (plugin_desc_t * pd)
   pd->object_file      = NULL;
   pd->id               = 0;
   pd->name             = NULL;
+  pd->maker            = NULL;
   pd->properties       = 0;
   pd->channels         = 0;
   pd->port_count       = 0;
@@ -62,6 +69,7 @@ plugin_desc_init (plugin_desc_t * pd)
   pd->control_port_indicies = NULL;
   pd->aux_channels = 0;
   pd->aux_are_input = TRUE;
+  pd->has_input = TRUE;
 }
 
 static void
@@ -82,6 +90,7 @@ plugin_desc_free (plugin_desc_t * pd)
 {
   plugin_desc_set_object_file (pd, NULL);
   plugin_desc_set_name        (pd, NULL);
+  plugin_desc_set_maker       (pd, NULL);
   plugin_desc_free_ports      (pd);
 }
 
@@ -106,6 +115,7 @@ plugin_desc_new_with_descriptor (const char * object_file,
   plugin_desc_set_index       (pd, index);
   plugin_desc_set_id          (pd, descriptor->UniqueID);
   plugin_desc_set_name        (pd, descriptor->Name);
+  plugin_desc_set_maker       (pd, descriptor->Maker);
   plugin_desc_set_properties  (pd, descriptor->Properties);
   plugin_desc_set_ports       (pd,
                                descriptor->PortCount,
@@ -150,6 +160,12 @@ plugin_desc_set_name        (plugin_desc_t * pd, const char * name)
   set_string_property (pd->name, name);
 }
 
+void
+plugin_desc_set_maker       (plugin_desc_t * pd, const char * maker)
+{
+  set_string_property (pd->maker, maker);
+}
+
 void
 plugin_desc_set_properties  (plugin_desc_t * pd, LADSPA_Properties properties)
 {
@@ -163,7 +179,7 @@ plugin_desc_add_audio_port_index (unsigned long ** indicies,
 {
   (*current_port_count)++;
   
-  if (*current_port_count == 1)
+  if (*current_port_count == 0)
     *indicies = g_malloc (sizeof (unsigned long) * *current_port_count);
   else
     *indicies = g_realloc (*indicies, sizeof (unsigned long) * *current_port_count);
@@ -193,7 +209,7 @@ plugin_desc_set_port_counts (plugin_desc_t * pd)
             continue;
             
           pd->control_port_count++;
-          if (pd->control_port_count == 1)
+          if (pd->control_port_count == 0)
             pd->control_port_indicies = g_malloc (sizeof (unsigned long) * pd->control_port_count);
           else
             pd->control_port_indicies = g_realloc (pd->control_port_indicies,
@@ -205,12 +221,17 @@ plugin_desc_set_port_counts (plugin_desc_t * pd)
   
   if (icount == ocount)
     pd->channels = icount;
+  else if( icount == 0 )
+    {
+      pd->channels = ocount;
+      pd->has_input = FALSE;
+    }
   else
     { /* deal with auxilliary ports */
       unsigned long ** port_indicies;
       unsigned long port_count;
       unsigned long i, j;
-      
+     
       if (icount > ocount)
         {
           pd->channels = ocount;