CCollection


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:    

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

Top    Index

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:   

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

 

Top    Index

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:    

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

Top    Index