voiceman.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 #ifndef _VOICEMAN_H
00025 #define _VOICEMAN_H
00026 
00035 class VoiceManager
00036 {
00037   private:
00038     class VoiceManagerPrivate;
00039     VoiceManagerPrivate *d;
00040 
00044     int nvoices;
00045 
00049     struct voice
00050     {
00051       int     id;
00052       int   channel;
00053       int   note;
00054       int   used;
00055 
00056       struct voice *prev;
00057       struct voice *next;
00058     };
00059 
00064     voice *FirstVoice; 
00065 
00069     voice *LastVoice; 
00070 
00075     voice *LastnotusedVoice; 
00076 
00080     voice **VoiceList; 
00081 
00086     voice *searcher; 
00087 
00092     voice *searcher_aid; 
00093 
00094   public:
00098     VoiceManager(int totalvoices);
00099 
00103     ~VoiceManager();
00104 
00112     int allocateVoice(int chn,int key);
00113 
00119     void deallocateVoice(int id);
00120 
00127     void initSearch(void); 
00128 
00138     int search(int chn); 
00139     
00140     
00141     
00142 
00149     int search(int chn,int note);
00150 
00154     int channel(int v) {return VoiceList[v]->channel;};
00155 
00159     int note(int v) {return VoiceList[v]->note;};
00160 
00164     int used(int v) {return VoiceList[v]->used;};
00165 
00169     void clearLists(void);
00170 };
00171 
00172 #endif
 
This file is part of the documentation for libkmid Library Version 3.2.0.