1 /*
2  * JACK Rack
3  *
4  * Original:
5  * Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net)
6  *
7  * Modification for MLT:
8  * Copyright (C) 2004-2014 Meltytech, LLC
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24 
25 #ifndef __JR_PLUGIN_DESC_H__
26 #define __JR_PLUGIN_DESC_H__
27 
28 #include <ladspa.h>
29 #include <glib.h>
30 
31 typedef struct _plugin_desc plugin_desc_t;
32 
33 struct _plugin_desc
34 {
35   char *                   object_file;
36   unsigned long            index;
37   unsigned long            id;
38   char *                   name;
39   char *                   maker;
40   LADSPA_Properties        properties;
41   gboolean                 rt;
42 
43   unsigned long            channels;
44 
45   gboolean                 aux_are_input;
46   unsigned long            aux_channels;
47 
48   unsigned long            port_count;
49   LADSPA_PortDescriptor *  port_descriptors;
50   LADSPA_PortRangeHint *   port_range_hints;
51   char **                  port_names;
52 
53   unsigned long *          audio_input_port_indicies;
54   unsigned long *          audio_output_port_indicies;
55 
56   unsigned long *          audio_aux_port_indicies;
57 
58   unsigned long            control_port_count;
59   unsigned long *          control_port_indicies;
60 
61   unsigned long            status_port_count;
62   unsigned long *          status_port_indicies;
63 
64   gboolean                 has_input;
65 };
66 
67 plugin_desc_t * plugin_desc_new ();
68 plugin_desc_t * plugin_desc_new_with_descriptor (const char * object_file,
69                                                  unsigned long index,
70                                                  const LADSPA_Descriptor * descriptor);
71 void            plugin_desc_destroy (plugin_desc_t * pd);
72 
73 void plugin_desc_set_object_file (plugin_desc_t * pd, const char * object_file);
74 void plugin_desc_set_index       (plugin_desc_t * pd, unsigned long index);
75 void plugin_desc_set_id          (plugin_desc_t * pd, unsigned long id);
76 void plugin_desc_set_name        (plugin_desc_t * pd, const char * name);
77 void plugin_desc_set_maker       (plugin_desc_t * pd, const char * maker);
78 void plugin_desc_set_properties  (plugin_desc_t * pd, LADSPA_Properties properties);
79 
80 struct _plugin * plugin_desc_instantiate (plugin_desc_t * pd);
81 
82 LADSPA_Data plugin_desc_get_default_control_value (plugin_desc_t * pd, unsigned long port_index, guint32 sample_rate);
83 LADSPA_Data plugin_desc_change_control_value (plugin_desc_t *, unsigned long, LADSPA_Data, guint32, guint32);
84 
85 gint plugin_desc_get_copies (plugin_desc_t * pd, unsigned long rack_channels);
86 
87 #endif /* __JR_PLUGIN_DESC_H__ */
88