~ubuntu-branches/debian/stretch/bristol/stretch

« back to all changes in this revision

Viewing changes to include/bristol/bristol.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-04-23 09:49:32 UTC
  • mfrom: (1.2.1 upstream) (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100423094932-btfvxmt11hv8dj4p
Tags: 0.60.0-4
* Switch back to deb format 1.0, bug#578693 has been fixed.
* Refresh and improvements, another attempt to fix FTBFS on
  hppa,sparc,s390.
* Drop debian/patches/02-implicit_pointer_conversion.patch patch,
  applied upstream.
* Patch to fix FTBFS on hurd-i386.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/*
3
3
 *  Diverse Bristol audio routines.
4
 
 *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2009
 
4
 *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2010
5
5
 *
6
6
 *
7
7
 *   This program is free software; you can redistribute it and/or modify
8
8
 *   it under the terms of the GNU General Public License as published by
9
 
 *   the Free Software Foundation; either version 2 of the License, or
 
9
 *   the Free Software Foundation; either version 3 of the License, or
10
10
 *   (at your option) any later version.
11
11
 *
12
12
 *   This program is distributed in the hope that it will be useful,
15
15
 *   GNU General Public License for more details.
16
16
 *
17
17
 *   You should have received a copy of the GNU General Public License
18
 
 *   along with this program; if not, write to the Free Software
19
 
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
 *   along with this program; if not, see <http://www.gnu.org/licenses/>.
20
19
 *
21
20
 */
22
21
 
37
36
 
38
37
/*#define BRISTOL_DBG */
39
38
 
40
 
#include <stdlib.h>
41
39
#include <stdio.h>
42
40
#include <string.h>
43
41
#include <strings.h>
46
44
#include <time.h>
47
45
#include <pthread.h>
48
46
 
 
47
#include <config.h>
 
48
 
49
49
/* #include "bristolvers.h" */
50
50
#include "bristoldebug.h"
 
51
#include "ringbuffer.h"
51
52
 
52
53
#include "bristolaudio.h"
53
54
#include "bristolmidiapi.h"
73
74
 
74
75
#define BRISTOL_ENGINE "bristolengine"
75
76
 
 
77
#define BRISTOL_JACK_MULTI              16 /* 2 legacy plus 16 multiIO */
 
78
#define BRISTOL_JACK_UUID_SIZE  32
 
79
 
76
80
/*
77
81
 * The following are channels and flags. They are applied to bristol system
78
82
 * messages, and to the baudio.midiflags
 
83
 *
 
84
 * We should define a controller map for bristol:
 
85
 *      0..63   Emulator operators (osc/env/filt, etc)
 
86
 *      64-95   Engine processes:
 
87
 *              64      Arpeggiator
 
88
 *              65      LADI
 
89
 *      96-126  Emulator effects except:
 
90
 *      127             SYSTEM commands: start/stop/init, etc.
79
91
 */
80
 
#define BRISTOL_SYSTEM                  127
 
92
#define BRISTOL_LADI                    65
 
93
#define BRISTOL_SYSTEM                  127 /* 127/0 */
81
94
#define BRISTOL_HELLO                   0x00002000
82
95
#define BRISTOL_COMMASK                 0x00001f00
83
96
#define BRISTOL_PARAMMASK               0x000000ff
98
111
#define BRISTOL_EVENT_PITCH             0x00000f00 /* NOT SENT AS BRISTOL_SYSTEM */
99
112
/*#define BRISTOL_FREE                  0x00000f00 */
100
113
#define BRISTOL_EXIT_ALGO               0x00001000
101
 
#define BRISTOL_UNISON                  0x00002000
102
 
#define BRISTOL_REQON                   0x00004000
 
114
#define BRISTOL_UNISON                  0x00001100
 
115
#define BRISTOL_REQ_FORWARD             0x00001200 /* Disable event forwarding on chan*/
 
116
#define BRISTOL_REQ_DEBUG               0x00001300 /* Debug level */
103
117
#define BRISTOL_MIDI_DEBUG1             0x00008000 /* Just messages */
104
118
#define BRISTOL_MIDI_DEBUG2             0x00010000 /* And internal functions() */
105
119
#define BRISTOL_MIDI_NRP_ENABLE 0x00020000
106
120
 
 
121
/* LADI are BRISTOL_SYSTEM 1278/1 */
 
122
#define BRISTOL_LADI_SAVE_REQ   0x00000001
 
123
#define BRISTOL_LADI_LOAD_REQ   0x00000002
 
124
 
107
125
#define BRISTOL_CC_HOLD1                64
108
126
 
109
127
#define SYSTEM_CHANNEL                  0x07f /* used for initialisation requests. */
203
221
#define B_NRO                   35
204
222
 
205
223
/*
206
 
 * Audio interface types. These are for audiomain.flags:
 
224
 * Audio interface types. The loest bytes is resevered.
 
225
 *
 
226
 * These are for audiomain.flags:
207
227
 */
208
228
#define BRISTOL_AUDIOMASK               0xff000000
209
229
#define BRISTOL_ALSA                    0x01000000
213
233
#define BRISTOL_DSSI                    0x10000000 /* Unlikely to be supported - LV2? */
214
234
#define BRISTOL_OSC                             0x20000000
215
235
#define BRISTOL_DUMMY                   0x40000000
216
 
 
217
 
#define BRISTOL_AUDIOWAIT               0x01000000
 
236
/* This appears to collide */
 
237
#define BRISTOL_AUDIOWAIT               0x00002000
218
238
 
219
239
/*
220
240
 * MIDI interface types, may interact with audio drivers.
229
249
 
230
250
#define BRISTOL_MIDI_WAIT               0x00800000
231
251
 
 
252
/* Audio connection to Jack ports */
232
253
#define BRISTOL_AUTO_CONN               0x00008000
 
254
/* Separate registration for audio and midi */
 
255
#define BRISTOL_JACK_DUAL               0x00004000
233
256
 
234
257
#define BRISTOL_TERM -3
235
258
#define BRISTOL_FAIL -2
343
366
        struct BAudio *baudio;
344
367
        int index;
345
368
        unsigned int flags;
 
369
        int offset;
346
370
        char ***locals;
347
371
        /*
348
372
         * We need an event structure for each possible poly event. These will be
485
509
 * a poly algorithm can use the rest.
486
510
#define BRISTOL_SUSTAIN         0x0040000000000000ULL
487
511
 */
488
 
#define BRISTOL_LW_FILTER       0x0002000000000000ULL
 
512
#define bfiltertype(x)  ((x&(BRISTOL_LW_FILTER|BRISTOL_LW_FILTER2)) >> 48)
 
513
#define BRISTOL_LW_FILTER       0x0001000000000000ULL
 
514
#define BRISTOL_LW_FILTER2      0x0002000000000000ULL
 
515
#define BRISTOL_LW_FILTERS      (BRISTOL_LW_FILTER|BRISTOL_LW_FILTER2)
489
516
#define BRISTOL_GLIDE_AUTO      0x0004000000000000ULL
490
517
#define BRISTOL_SENSE           0x0008000000000000ULL
491
518
#define BRISTOL_SEQUENCE        0x0010000000000000ULL
624
651
        float ingain;
625
652
        float outgain;
626
653
        char *microTonalMappingFile;
 
654
        unsigned int SysID;
 
655
        jack_ringbuffer_t *rb; /* MIDI thread to audio threadd */
 
656
        jack_ringbuffer_t *rbfp; /* MIDI/Audio thread to forwarding thread */
 
657
        char jackUUID[BRISTOL_JACK_UUID_SIZE];
 
658
        int iocount;
 
659
        float *io_i[BRISTOL_JACK_MULTI];
 
660
        float *io_o[BRISTOL_JACK_MULTI];
 
661
        float m_io_ogc;
 
662
        float m_io_igc;
 
663
        char *cmdline;
 
664
        char *sessionfile;
627
665
} audioMain;
628
666
 
629
667
extern int cleanup();