Purpose: Stores the set of instruments of a DLS
file and initializes CInstruments objects
Remark: The returns values
are based on the DirectX9 constants except DM_FAILED
The functions
raise a CDMusicException exception type with the error
data.
Member functions:
Function:
EnumInstrument
Declaration: HRESULT
CCollection::EnumInstrument(DWORD dwIndex,LPINSTRUMENTINFO
InstInfo)
Purpose: Enumerates the instruments
stored in a collection given the index in the
collection
Parameters:
dwIndex [in] : Index of the instrument in the collection
InstInfo [out]: Address of a INSTRUMENTINFO
structure
Returns:
S_FALSE | No instrument with that index number |
S_OK |
Succeeds |
Throws:
E_OUTOFMEMORY | Insufficient memory to complete the task |
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
DM_FAILED | Error, see DirectMidi causes |
E_FAIL | The method did not succeed |
Function:
GetInstrument (from structure)
Declaration: HRESULT CCollection::GetInstrument(CInstrument
&pInstrument,LPINSTRUMENTINFO
InstInfo)
Purpose: Initializes a CInstrument
object from its collection, given a pointer to an INSTRUMENTINFO
structure
Parameters:
pInstrument [out]: Reference to a created CInstrument object
InstInfo [in]: Address of a INSTRUMENTINFO
structure
Returns:
S_OK |
Succeeds |
Throws:
DMUS_E_INVALIDPATCH | No instrument in the collection matches the patch number |
E_OUTOFMEMORY | Insufficient memory to complete the task |
DM_FAILED | Error, see DirectMidi causes |
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_FAIL | The method did not succeed |
Function:
GetInstrument (from index)
Declaration: HRESULT
CCollection::GetInstrument(CInstrument &pInstrument,INT
nIndex)
Purpose: Initializes a CInstrument object
from its collection given the instrument index
Parameters:
pInstrument [out]: Reference to a CInstrument object
nIndex [in]: Index of the instrument in the
collection
Returns:
S_OK |
Succeeds |
Throws:
S_FALSE | No instrument with that index number |
DMUS_E_INVALIDPATCH | No instrument in the collection matches the patch number |
E_OUTOFMEMORY | Insufficient memory to complete the task |
DM_FAILED | Error, see DirectMidi causes |
E_POINTER | An invalid pointer, usually NULL, was passed as a parameter |
E_FAIL | The method did not succeed |