1 /* -*- c-basic-offset: 4 -*-  vi:set ts=8 sts=4 sw=4: */
2 
3 /* jack-dssi-host.h
4  *
5  * DSSI Soft Synth Interface
6  *
7  * This is a host for DSSI plugins.  It listens for MIDI events on an
8  * ALSA sequencer port, delivers them to DSSI synths and outputs the
9  * result via JACK.
10  */
11 
12 /*
13  * Copyright 2004, 2009 Chris Cannam, Steve Harris and Sean Bolton.
14  *
15  * Permission to use, copy, modify, distribute, and sell this software
16  * for any purpose is hereby granted without fee, provided that the
17  * above copyright notice and this permission notice are included in
18  * all copies or substantial portions of the software.
19  */
20 
21 #ifndef _JACK_DSSI_HOST_H
22 #define _JACK_DSSI_HOST_H
23 
24 #include "dssi.h"
25 #include <lo/lo.h>
26 
27 #define D3H_MAX_CHANNELS   16  /* MIDI limit */
28 #define D3H_MAX_INSTANCES  (D3H_MAX_CHANNELS)
29 
30 /* character used to seperate DSO names from plugin labels on command line */
31 #define LABEL_SEP ':'
32 
33 typedef struct _d3h_dll_t d3h_dll_t;
34 
35 struct _d3h_dll_t {
36     d3h_dll_t               *next;
37     char                    *name;
38     char                    *directory;
39     int                      is_DSSI_dll;
40     DSSI_Descriptor_Function descfn;      /* if is_DSSI_dll is false, this is a LADSPA_Descriptor_Function */
41 };
42 
43 typedef struct _d3h_plugin_t d3h_plugin_t;
44 
45 struct _d3h_plugin_t {
46     d3h_plugin_t          *next;
47     int                    number;
48     d3h_dll_t             *dll;
49     char                  *label;
50     int                    is_first_in_dll;
51     const DSSI_Descriptor *descriptor;
52     int                    ins;
53     int                    outs;
54     int                    controlIns;
55     int                    controlOuts;
56     int                    instances;
57 };
58 
59 typedef struct _d3h_instance_t d3h_instance_t;
60 
61 #define MIDI_CONTROLLER_COUNT 128
62 
63 struct _d3h_instance_t {
64     int              number;
65     d3h_plugin_t    *plugin;
66     int              channel;
67     int              inactive;
68     char            *friendly_name;
69     int              firstControlIn;                       /* the offset to translate instance control in # to global control in # */
70     int             *pluginPortControlInNumbers;           /* maps instance LADSPA port # to global control in # */
71     long             controllerMap[MIDI_CONTROLLER_COUNT]; /* maps MIDI controller to global control in # */
72 
73     int              pluginProgramCount;
74     DSSI_Program_Descriptor
75                     *pluginPrograms;
76     long             currentBank;
77     long             currentProgram;
78     int              pendingBankLSB;
79     int              pendingBankMSB;
80     int              pendingProgramChange;
81 
82     lo_address       uiTarget;
83     lo_address       uiSource;
84     int              ui_initial_show_sent;
85     int              uiNeedsProgramUpdate;
86     char            *ui_osc_control_path;
87     char            *ui_osc_configure_path;
88     char            *ui_osc_program_path;
89     char            *ui_osc_quit_path;
90     char            *ui_osc_rate_path;
91     char            *ui_osc_show_path;
92 };
93 
94 #endif /* _JACK_DSSI_HOST_H */
95 
96