1 
2 /*
3  *  Diverse Bristol audio routines.
4  *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2012
5  *
6  *
7  *   This program is free software; you can redistribute it and/or modify
8  *   it under the terms of the GNU General Public License as published by
9  *   the Free Software Foundation; either version 3 of the License, or
10  *   (at your option) any later version.
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with this program; if not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BRIGHTON_H
23 #define BRIGHTON_H
24 
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <string.h>
28 #include <strings.h>
29 #include <unistd.h>
30 
31 #include <config.h>
32 
33 #include "brightondevflags.h"
34 #include "brightonevents.h"
35 
36 struct BrightonWindow;
37 typedef int (*brightonRoutine)();
38 typedef int (*brightonCallback)(struct BrightonWindow *, int, int, float);
39 
40 typedef struct BrightonLocations {
41 	char *name;
42 	int device;
43 	float x, y;
44 	float width, height;
45 	float from, to;
46 	brightonCallback callback;
47 	char *image;
48 	char *image2;
49 	unsigned int flags;
50 	int var;
51 	int val;
52 } brightonLocations;
53 
54 typedef struct brightonResource {
55 	char *name;
56 	char *image;
57 	char *surface;
58 	unsigned int flags;
59 	brightonRoutine init;
60 	brightonRoutine configure;
61 	brightonCallback callback;
62 	int x, y, width, height;
63 	int ndevices;
64 	brightonLocations *devlocn;
65 } brightonResource;
66 
67 #define RESOURCE_COUNT 64 /* Max # of panels */
68 
69 /* Emulation defaults - can be overridden */
70 typedef struct BrightonEmulation {
71 	int voices;
72 	int detune;
73 	int gain;
74 	int pwd;
75 	int glide;
76 	int velocity;
77 	int opacity;
78 	int panel;
79 } brightonEmulation;
80 
81 typedef struct BrightonApp {
82 	char *name;
83 	char *image;
84 	char *surface;
85 	unsigned int flags;
86 	brightonRoutine init;
87 	brightonRoutine configure;
88 	brightonCallback callback;
89 	brightonRoutine destroy;
90 	brightonEmulation emulate;
91 	int width, height, x, y;
92 	/*
93 	 * It would be nice to integrate the following as defaults that would be
94 	 * set when synth is found and overridden by subsequent options:
95 	int voices, detune, gain, glide; This is now brightonEmulation.
96 	 */
97 	int nresources;
98 	brightonResource resources[RESOURCE_COUNT];
99 } brightonApp;
100 
101 extern int brightonRemoveInterface(struct BrightonWindow *);
102 extern int brightonParamChange(struct BrightonWindow *, int, int, brightonEvent *);
103 extern int brightonOpacity(struct BrightonWindow *, float);
104 extern int brightonColorQuality(struct BrightonWindow *, int);
105 extern struct BrightonWindow *brightonInterface(brightonApp *, int, int, int, float, int, int, int);
106 extern void brightonLogo(struct BrightonWindow *);
107 extern int brightonEventMgr();
108 
109 #endif /* BRIGHTON_H */
110 
111