]> git.sesse.net Git - mlt/blob - src/modules/jackrack/process.h
Merge ../mlt++
[mlt] / src / modules / jackrack / process.h
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 Ushodaya Enterprises Limited
9  * Author: Dan Dennedy <dan@dennedy.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25
26 #ifndef __JLH_PROCESS_H__
27 #define __JLH_PROCESS_H__
28
29 #include <glib.h>
30 #include <jack/jack.h>
31 #include <ladspa.h>
32
33 #include "lock_free_fifo.h"
34
35 typedef struct _process_info process_info_t;
36
37 /** this is what gets passed to the process() callback and contains all
38     the data the process callback will need */
39 struct _process_info {
40
41   /** the plugin instance chain */
42   struct _plugin * chain;
43   struct _plugin * chain_end;
44   
45   jack_client_t * jack_client;
46   unsigned long port_count;
47   jack_port_t ** jack_input_ports;
48   jack_port_t ** jack_output_ports;
49
50   unsigned long channels;
51   LADSPA_Data ** jack_input_buffers;
52   LADSPA_Data ** jack_output_buffers;
53   LADSPA_Data *  silent_buffer;
54   
55   char * jack_client_name;
56   int quit;
57 };
58
59 extern jack_nframes_t sample_rate;
60 extern jack_nframes_t buffer_size;
61
62 process_info_t * process_info_new (const char * client_name,
63         unsigned long rack_channels, gboolean connect_inputs, gboolean connect_outputs);
64 void process_info_destroy (process_info_t * procinfo);
65
66 void process_info_set_channels (process_info_t * procinfo,
67         unsigned long channels, gboolean connect_inputs, gboolean connect_outputs);
68
69 int process_ladspa (process_info_t * procinfo, jack_nframes_t frames,
70                     LADSPA_Data ** inputs, LADSPA_Data ** outputs);
71
72 int process_jack (jack_nframes_t frames, void * data);
73
74 void process_quit (process_info_t * procinfo);
75
76 #endif /* __JLH_PROCESS_H__ */