~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kmid/player/gusout.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
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.
 
18
 
 
19
    Send comments and bug fixes to antlarr@arrakis.es
 
20
    or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
 
21
 
 
22
***************************************************************************/
 
23
#ifndef _GUSOUT_H
 
24
#define _GUSOUT_H
 
25
 
 
26
#include "midiout.h"
 
27
#include "voiceman.h"
 
28
 
 
29
class GUSOut : public MidiOut
 
30
{
 
31
private:
 
32
friend class DeviceManager; 
 
33
 
 
34
 
 
35
    int patchloaded[256];
 
36
    int nvoices;
 
37
 
 
38
    int use8bit; // Use 8 bit patches, instead of 16 bits to use less memory
 
39
    voiceManager *vm;
 
40
 
 
41
    int totalmemory; // Total memory in soundcard
 
42
    int freememory; // Free memory
 
43
 
 
44
 
 
45
    void getPatchesLoadingOrder(int *patchesused,int *patchesordered);
 
46
    char *patchName(int pgm);
 
47
 
 
48
public:
 
49
    GUSOut(int d=0,int total =12);
 
50
    ~GUSOut();
 
51
 
 
52
    virtual void openDev        (int sqfd);
 
53
    virtual void closeDev       (void);
 
54
    virtual void initDev        (void);
 
55
 
 
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 ); 
 
63
 
 
64
    virtual void sysex          ( uchar *data,ulong size);
 
65
 
 
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 
 
70
 
 
71
private:
 
72
static const char *GUS_patches_directory;
 
73
static int delete_GUS_patches_directory;
 
74
public:
 
75
static void setGUSPatchesDirectory(const char *dir);
 
76
 
 
77
};
 
78
 
 
79
#endif