SB AWE32 Developer's Information Pack
PART III Windows Driver API
••
80
Copyright
Creative Technology Ltd., 1994-1996
Version 3.00
char *GetInstrDescriptor( int nBNum, int nINum, char *desc )
//
// Retrieve the Instrument's Descriptor.
//
{
char scratch[BUF_SIZE];
CBufferObject buffer;
CParamObject param;
param.m_UBankIndex = nBNum;
param.m_InstrIndex = nINum;
buffer.m_Size = BUF_SIZE;
buffer.m_Buffer = (LPSTR)&scratch;
AWEManager(hID,AWE_GET_USER_INSTR,(LPARAM)(LPPARAMOBJECT)¶m,
(LPARAM)(LPBUFFEROBJECT)&buffer);
if (buffer.m_SizeUsed == 1)
strcpy(desc,(const char*)"NO DESCRIPTOR\0");
else
strcpy(desc,(const char*)&scratch[0]);
return desc;
}
Note that there is no error handling implemented in the above functions. It is assume that the buffer size
used to retrieve the strings is sufficient. Unlike the query class API, the size required to contain the
descriptor will not be returned if the input buffer size is not large enough. This is because the descriptor
store in the memory has a maximum size of 20 bytes.
Issuing selections
The select class API provided by the Manager allows you to instate selection to the AWE's features.
These API allow you to configure the AWE's Effect Types, Variations and Synthesizer Bank. For User
Bank, a user object module must be specified when using the API. The object module for Banks has the
SBK extension. Individual instruments and banks of instruments uses the same format.
The following functions demostrate how to set the features and load a user define SBK file into the bank.
This example can be added in your program.
#include "windows.h"
#include "AWE_DLL.H"
#define BUF_SIZE 255
#define MAX_USER_BANK 127
#define MAX_INSTR 127
AWEHANDLE hID;
enum SBANK m_CurSynthBank; // Current synthesizer bank
enum TYPEINDEX m_CurEfxType; // Current effects type
enum VARIINDEX m_CurTypeVari[6]; // Current type variations
int m_CurUserBank; // Current user bank number
char cUBankDescriptor[30]; // User Bank Descriptor
void SetSynth( int nSNum )
//
// Configure the hardware with current Synth.
//
{
LRESULT lResult;
lResult = AWEManager(hID, AWE_SELECT_SYN_BANK,
(LPARAM)(WORD)nSNum, 0L);
if (lResult != AWE_NO_ERR)
{
// TO DO:
// DisplayErrorMsg( lResult );