SB AWE32 Developer's Information Pack
PART III Windows Driver API
••
77
Copyright
Creative Technology Ltd., 1994-1996
Version 3.00
#include "string.h"
#include "windows.h"
#include "AWE_DLL.H"
#define BUF_SIZE 255
AWEHANDLE hID;
char cSynthName[4][100]; // Buffer to store support strings
char cEffectType[3][50];
char cReverbList[8][50];
char cChorusList[8][50];
char cTrebleList[12][50];
char cBassList[12][50];
DWORD dwMemAvail;
DWORD dwMemMax;
char *GetElement( char *source, int index, int size )
//
// Return the indexed element in a list of string.
// Each element terminated by '0'.
// Last element terminates with two '0'.
//
{
char *dest = source;
char *end = size;
int i;
for ( i=0; i < index; i++ )
{
// Traverse the pointer till a \0 is met.
while ( *dest != 0 && dest < end ) dest++;
++dest; // skip the \0.
}
return dest; // return head of next string.
}
void RetrieveSupport( void )
//
// Retrieve Synth and Effect Type supported by the MIDI driver.
//
{
char scratch[BUF_SIZE];
WORD i;
CBufferObject buffer;
CParamObject param;
//
// SYNTHESIZER BANK
// Get Synthesizer Emulation List
buffer.m_Size = BUF_SIZE;
buffer.m_Buffer = (LPSTR)&scratch[0];
AWEManager(hID, AWE_QUERY_SYN_SUPPORT,
(LPARAM)(LPBUFFEROBJECT)&buffer, 0L);
// Add into the Synth buffer
for ( i=0; i<buffer.m_Flag; i++ )
strcpy(&cSynthName[i][0],(const char*) GetElement(&scratch[0],i,
(int)buffer.m_SizeUsed));
//
// EFFECTS TYPE
// Get Effects Type List
// Same buffer settings as before.
AWEManager(hID, AWE_QUERY_EFXT_SUPPORT,
(LPARAM)(LPBUFFEROBJECT)&buffer, 0L);
// Add into the EfxType buffer
for ( i=0; i<buffer.m_Flag; i++ )
strcpy(&cEffectType[i][0],(const char*) GetElement(&scratch[0],i,
(int)buffer.m_SizeUsed));
//
// REVERB TYPE VARIATIONS