]> git.sesse.net Git - mlt/blob - src/modules/jackrack/plugin.h
cleanup and reduce code in jackrack support code and add new jack-less filter_ladspa.
[mlt] / src / modules / jackrack / plugin.h
1 /*
2  *   JACK Rack
3  *    
4  *   Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net)
5  *    
6  *   This program is free software; you can redistribute it and/or modify
7  *   it under the terms of the GNU General Public License as published by
8  *   the Free Software Foundation; either version 2 of the License, or
9  *   (at your option) any later version.
10  *
11  *   This program is distributed in the hope that it will be useful,
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *   GNU General Public License for more details.
15  *
16  *   You should have received a copy of the GNU General Public License
17  *   along with this program; if not, write to the Free Software
18  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef __JR_PLUGIN_H__
22 #define __JR_PLUGIN_H__
23
24 #include <glib.h>
25 #include <ladspa.h>
26 #include <jack/jack.h>
27
28 #include "process.h"
29 #include "plugin_desc.h"
30
31 typedef struct _ladspa_holder ladspa_holder_t;
32 typedef struct _plugin plugin_t;
33
34 struct _ladspa_holder
35 {
36   LADSPA_Handle instance;
37   lff_t * ui_control_fifos;
38   LADSPA_Data * control_memory;
39
40   jack_port_t **             aux_ports;
41 };
42
43 struct _plugin
44 {
45   plugin_desc_t *            desc;
46   gint                       enabled;
47
48   gint                       copies;
49   ladspa_holder_t *          holders;
50   LADSPA_Data **             audio_input_memory;
51   LADSPA_Data **             audio_output_memory;
52   
53   gboolean                   wet_dry_enabled;
54   /* 1.0 = all wet, 0.0 = all dry, 0.5 = 50% wet/50% dry */
55   LADSPA_Data *              wet_dry_values;
56   lff_t *                    wet_dry_fifos;
57   
58   plugin_t *                 next;
59   plugin_t *                 prev;
60
61   const LADSPA_Descriptor *  descriptor;
62   void *                     dl_handle;
63   struct _jack_rack *        jack_rack;
64   
65 };
66
67 void       process_add_plugin            (process_info_t *, plugin_t *plugin);
68 plugin_t * process_remove_plugin         (process_info_t *, plugin_t *plugin);
69 void       process_ablise_plugin         (process_info_t *, plugin_t *plugin, gboolean able);
70 void       process_ablise_plugin_wet_dry (process_info_t *, plugin_t *plugin, gboolean enable);
71 void       process_move_plugin           (process_info_t *, plugin_t *plugin, gint up);
72 plugin_t * process_change_plugin         (process_info_t *, plugin_t *plugin, plugin_t * new_plugin);
73
74 struct _jack_rack;
75 struct _ui;
76
77 plugin_t * plugin_new (plugin_desc_t * plugin_desc, struct _jack_rack * jack_rack);
78 void       plugin_destroy (plugin_t * plugin);
79
80 void plugin_connect_input_ports (plugin_t * plugin, LADSPA_Data ** inputs);
81 void plugin_connect_output_ports (plugin_t * plugin);
82
83 #endif /* __JR_PLUGIN_H__ */