libkmid Library API Documentation

VoiceManager Class Reference

List of all members.

Public Member Functions

 VoiceManager (int totalvoices)
 ~VoiceManager ()
int allocateVoice (int chn, int key)
void deallocateVoice (int id)
void initSearch (void)
int search (int chn)
int search (int chn, int note)
int channel (int v)
int note (int v)
int used (int v)
void clearLists (void)

Detailed Description

Definition at line 35 of file voiceman.h.


Constructor & Destructor Documentation

VoiceManager::VoiceManager (  int  totalvoices  ) 
 

Cronstructor.

Definition at line 33 of file voiceman.cc.

VoiceManager::~VoiceManager (   ) 
 

Destructor.

Definition at line 72 of file voiceman.cc.


Member Function Documentation

int VoiceManager::allocateVoice (  int  chn,
int  key
) 
 

Allocates a voice used in channel chn, and playing key key.

Returns:
the voice that should be used.
See also:
deallocateVoice

Definition at line 113 of file voiceman.cc.

Referenced by GUSOut::noteOn(), and FMOut::noteOn().

void VoiceManager::deallocateVoice (  int  id  ) 
 

Deallocates the voice with ID id.

See also:
allocateVoice

Definition at line 151 of file voiceman.cc.

Referenced by GUSOut::noteOff(), and FMOut::noteOff().

void VoiceManager::initSearch (  void   ) 
 

initSearch() must be called always before search() to initialize internal variables.

See also:
search

Definition at line 229 of file voiceman.cc.

Referenced by GUSOut::chnController(), FMOut::chnController(), GUSOut::chnPatchChange(), FMOut::chnPatchChange(), GUSOut::chnPitchBender(), FMOut::chnPitchBender(), FMOut::chnPressure(), GUSOut::keyPressure(), FMOut::keyPressure(), GUSOut::noteOff(), and FMOut::noteOff().

int VoiceManager::search (  int  chn  ) 
 

Returns -1 if channel chn is not currently used, or a voice using channel chn if any.

Calling search repeteadly, will return all the voices using channel chn, and a -1 after the last one.

See also:
initSearch

Definition at line 235 of file voiceman.cc.

Referenced by GUSOut::chnController(), FMOut::chnController(), GUSOut::chnPatchChange(), FMOut::chnPatchChange(), GUSOut::chnPitchBender(), FMOut::chnPitchBender(), FMOut::chnPressure(), GUSOut::keyPressure(), FMOut::keyPressure(), GUSOut::noteOff(), and FMOut::noteOff().

int VoiceManager::search (  int  chn,
int  note
) 
 

This is a convenience function that differs from the above in that it also looks for a specific note (the second parameter).

See also:
initSearch

Definition at line 252 of file voiceman.cc.

int VoiceManager::channel (  int  v  )  [inline]
 

Returns the channel that voice v is using.

Definition at line 154 of file voiceman.h.

int VoiceManager::note (  int  v  )  [inline]
 

Returns the note that voice v is playing.

Definition at line 159 of file voiceman.h.

Referenced by GUSOut::initDev(), and FMOut::initDev().

int VoiceManager::used (  int  v  )  [inline]
 

Returns true or false if the voice v is being used or not respectively.

Definition at line 164 of file voiceman.h.

void VoiceManager::clearLists (  void   ) 
 

Clears the lists of used voices.

Definition at line 95 of file voiceman.cc.

Referenced by GUSOut::closeDev(), and FMOut::closeDev().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkmid Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Nov 1 10:34:18 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003