]> git.sesse.net Git - mlt/blob - src/modules/jackrack/process.h
cleanup and reduce code in jackrack support code and add new jack-less filter_ladspa.
[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   LADSPA_Data *  silent_buffer;
49   
50   char * jack_client_name;
51   int quit;
52 };
53
54 extern jack_nframes_t sample_rate;
55 extern jack_nframes_t buffer_size;
56
57 process_info_t * process_info_new (const char * client_name,
58         unsigned long rack_channels, gboolean connect_inputs, gboolean connect_outputs);
59 void process_info_destroy (process_info_t * procinfo);
60
61 void process_info_set_channels (process_info_t * procinfo,
62         unsigned long channels, gboolean connect_inputs, gboolean connect_outputs);
63
64 int process_ladspa (process_info_t * procinfo, jack_nframes_t frames,
65                     LADSPA_Data ** inputs, LADSPA_Data ** outputs);
66
67 int process_jack (jack_nframes_t frames, void * data);
68
69 void process_quit (process_info_t * procinfo);
70
71 #endif /* __JLH_PROCESS_H__ */