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 __JLH_PROCESS_H__
26 #define __JLH_PROCESS_H__
27 
28 #include <glib.h>
29 #include <jack/jack.h>
30 #include <ladspa.h>
31 
32 #include "lock_free_fifo.h"
33 
34 typedef struct _process_info process_info_t;
35 
36 /** this is what gets passed to the process() callback and contains all
37     the data the process callback will need */
38 struct _process_info {
39 
40   /** the plugin instance chain */
41   struct _plugin * chain;
42   struct _plugin * chain_end;
43 
44   jack_client_t * jack_client;
45   unsigned long port_count;
46   jack_port_t ** jack_input_ports;
47   jack_port_t ** jack_output_ports;
48 
49   unsigned long channels;
50   LADSPA_Data ** jack_input_buffers;
51   LADSPA_Data ** jack_output_buffers;
52   LADSPA_Data *  silent_buffer;
53 
54   char * jack_client_name;
55   int quit;
56 };
57 
58 extern jack_nframes_t sample_rate;
59 extern jack_nframes_t buffer_size;
60 
61 process_info_t * process_info_new (const char * client_name,
62 	unsigned long rack_channels, gboolean connect_inputs, gboolean connect_outputs);
63 void process_info_destroy (process_info_t * procinfo);
64 
65 void process_info_set_channels (process_info_t * procinfo,
66 	unsigned long channels, gboolean connect_inputs, gboolean connect_outputs);
67 
68 int process_ladspa (process_info_t * procinfo, jack_nframes_t frames,
69                     LADSPA_Data ** inputs, LADSPA_Data ** outputs);
70 
71 int process_jack (jack_nframes_t frames, void * data);
72 
73 void process_quit (process_info_t * procinfo);
74 
75 #endif /* __JLH_PROCESS_H__ */
76