1
/* voiceman.h - The voiceManager class handles a set of voices for synths
2
Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
Send comments and bug fixes to antlarr@arrakis.es
19
or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
21
***************************************************************************/
40
voice *FirstVoice; // Points to the beginning of the voice list, that is, to
41
// the older voice which is ready to be used
42
voice *LastVoice; // Points to the last voice, I mean, the latest used
45
voice *LastnotusedVoice; // Points to the latest (list order) not used voice
46
//, that is, to where deallocated voices will be moved
48
voice **VoiceList; // Array with pointer to the voices, arranged by id for
51
voice *searcher; // Variable used to search channels
53
voice *searcher_aid; // An auxiliary variable for simpler searches
55
voiceManager(int totalvoices);
58
int allocateVoice(int chn,int key);
59
void deallocateVoice(int id);
61
void initSearch(void); // call this function always before Search !!!
62
int Search(int chn); //returns -1 if channel chn is not currently used
63
// Continue searching for more voices which
64
// use the channel chn
65
int Search(int chn,int note); // The same but also looks for a note
68
int Channel(int v) {return VoiceList[v]->channel;};
69
int Note(int v) {return VoiceList[v]->note;};
70
int Used(int v) {return VoiceList[v]->used;};
74
void cleanLists(void);