]> git.sesse.net Git - mlt/blob - src/modules/jackrack/process.h
1d218f3cce07195cdf802e298831794ccef35cb9
[mlt] / src / modules / jackrack / process.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 __JLH_PROCESS_H__
22 #define __JLH_PROCESS_H__
23
24 #include <glib.h>
25 #include <jack/jack.h>
26 #include <ladspa.h>
27
28 #include "lock_free_fifo.h"
29
30 typedef struct _process_info process_info_t;
31
32 /** this is what gets passed to the process() callback and contains all
33     the data the process callback will need */
34 struct _process_info {
35
36   /** the plugin instance chain */
37   struct _plugin * chain;
38   struct _plugin * chain_end;
39   
40   jack_client_t * jack_client;
41   unsigned long port_count;
42   jack_port_t ** jack_input_ports;
43   jack_port_t ** jack_output_ports;
44
45   unsigned long channels;
46   LADSPA_Data ** jack_input_buffers;
47   LADSPA_Data ** jack_output_buffers;
48   
49   lff_t * ui_to_process;
50   lff_t * process_to_ui;
51 };
52
53 extern jack_nframes_t sample_rate;
54 extern jack_nframes_t buffer_size;
55
56 struct _ui;
57
58 process_info_t * process_info_new (struct _ui * ui, const char * client_name, 
59         unsigned long rack_channels, gboolean connect_inputs, gboolean connect_outputs);
60 void process_info_destroy (process_info_t * procinfo);
61
62 void process_info_set_channels (process_info_t * procinfo, struct _ui * ui, 
63         unsigned long channels, gboolean connect_inputs, gboolean connect_outputs);
64
65
66 int process (jack_nframes_t frames, void * data);
67
68
69 #endif /* __JLH_PROCESS_H__ */