libkmid Library API Documentation

gusout.h

00001 /*  gusout.h   - class gusOut which implements support for Gravis
00002          Ultrasound cards through a /dev/sequencer device
00003     This file is part of LibKMid 0.9.5
00004     Copyright (C) 1998,99,2000  Antonio Larrosa Jimenez
00005     LibKMid's homepage : http://www.arrakis.es/~rlarrosa/libkmid.html
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011  
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016  
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020     Boston, MA 02111-1307, USA.
00021 
00022     Send comments and bug fixes to Antonio Larrosa <larrosa@kde.org>
00023 
00024 ***************************************************************************/
00025 #ifndef _GUSOUT_H
00026 #define _GUSOUT_H
00027 
00028 #include <libkmid/midiout.h>
00029 #include <libkmid/voiceman.h>
00030 
00045 class GUSOut : public MidiOut
00046 {
00047   private:
00048     class GUSOutPrivate;
00049     GUSOutPrivate *di;
00050 
00051     int patchloaded[256];
00052     int nvoices;
00053 
00054     int use8bit; // Use 8 bit patches, instead of 16 bits to use less memory
00055     VoiceManager *vm;
00056 
00057     int totalmemory; // Total memory in soundcard
00058     int freememory; // Free memory
00059 
00060 
00061     void patchesLoadingOrder(int *patchesused,int *patchesordered);
00062     char *patchName(int pgm);
00063 
00064   public:
00068     GUSOut(int d=0,int total =12);
00069 
00073     ~GUSOut();
00074 
00078     virtual void openDev        (int sqfd);
00079 
00083     virtual void closeDev       (void);
00084 
00088     virtual void initDev        (void);
00089 
00093     virtual void noteOn         ( uchar chn, uchar note, uchar vel );
00094 
00098     virtual void noteOff        ( uchar chn, uchar note, uchar vel );
00099 
00103     virtual void keyPressure    ( uchar chn, uchar note, uchar vel );
00104 
00108     virtual void chnPatchChange ( uchar chn, uchar patch );
00109 
00113     virtual void chnPressure    ( uchar chn, uchar vel );
00114 
00118     virtual void chnPitchBender ( uchar chn, uchar lsb,  uchar msb );
00119 
00123     virtual void chnController  ( uchar chn, uchar ctl , uchar v ); 
00124 
00129     virtual void sysex          ( uchar *data,ulong size);
00130 
00140     void setPatchesToUse(int *patchesused);
00141 
00152     int loadPatch  (int pgm);
00153 
00162     int patch(int p); 
00163 
00164   private:
00165     static const char *GUS_patches_directory;
00166     static int delete_GUS_patches_directory;
00167 
00168   public:
00176     static void setGUSPatchesDirectory(const char *dir);
00177 
00178 };
00179 
00180 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:28:29 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001