1
/* gusout.h - class gusOut which implements support for Gravis
2
Ultrasound cards through a /dev/sequencer device
3
Copyright (C) 1998 Antonio Larrosa Jimenez
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
Send comments and bug fixes to antlarr@arrakis.es
20
or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
22
***************************************************************************/
29
class GUSOut : public MidiOut
32
friend class DeviceManager;
38
int use8bit; // Use 8 bit patches, instead of 16 bits to use less memory
41
int totalmemory; // Total memory in soundcard
42
int freememory; // Free memory
45
void getPatchesLoadingOrder(int *patchesused,int *patchesordered);
46
char *patchName(int pgm);
49
GUSOut(int d=0,int total =12);
52
virtual void openDev (int sqfd);
53
virtual void closeDev (void);
54
virtual void initDev (void);
56
virtual void noteOn ( uchar chn, uchar note, uchar vel );
57
virtual void noteOff ( uchar chn, uchar note, uchar vel );
58
virtual void keyPressure ( uchar chn, uchar note, uchar vel );
59
virtual void chnPatchChange ( uchar chn, uchar patch );
60
virtual void chnPressure ( uchar chn, uchar vel );
61
virtual void chnPitchBender ( uchar chn, uchar lsb, uchar msb );
62
virtual void chnController ( uchar chn, uchar ctl , uchar v );
64
virtual void sysex ( uchar *data,ulong size);
66
void setPatchesToUse(int *patchesused);
67
int loadPatch (int pgm);// Returns : 0 if OK, -1 if error
68
int patch(int p); //Returns p if the patch p has been loaded or another
69
// patch (already loaded) if p hasn't been loaded
72
static const char *GUS_patches_directory;
73
static int delete_GUS_patches_directory;
75
static void setGUSPatchesDirectory(const char *dir);