/* ---------------------------------------------------------------------------- ASIOLIST.h Author: Steinberg Revision: 6/25/02 by Terry Leach Comment, make encapsulation name oriented. PURPOSE: This class encapsulates installed ASIO driver information. Installed ASIO drivers are determined by accessing the registry and retreiving the information stored in HKEY_LOCAL_MACHINE\SOFTWARE\ASIO. This location is used to map driver name ("ASIO Echo WDM" for example) into a CLSID which is used to access the driver interface at run-time. So the minimum sequence of calls to access a driver would be AsioDriverList adlActiveList; // Construction adlActiveList.asioLink( pszDesiredName ); // Name of driver if you know which one you want adlActiveList.asioOpen( &pIASIO ); // Runtime linkage to driver // various driver calls such as pIASIO-> createBuffers( ... ); pIASIO-> start(); adlActiveList.asioClose(); // Release resources associated w runtime linkage */ #ifndef __asiolist__ #define __asiolist__ #define DRVERR -5000 #define DRVERR_INVALID_PARAM DRVERR-1 #define DRVERR_DEVICE_ALREADY_OPEN DRVERR-2 #define DRVERR_DEVICE_NOT_FOUND DRVERR-3 #define DRVERR_UNLINKED DRVERR-4 #define NOLINK -1 #define MAXPATHLEN 512 #define MAXDRVNAMELEN 128 struct asiodrvstruct { int drvID; // Occurance in registry CLSID clsid; // Class ID obtained from registry char dllpath[MAXPATHLEN]; // char drvname[MAXDRVNAMELEN]; // Registered name of the driver LPVOID asiodrv; // Pointer to the driver struct asiodrvstruct *next; // Pointer to next entry in the list }; typedef struct asiodrvstruct ASIODRVSTRUCT; typedef ASIODRVSTRUCT *LPASIODRVSTRUCT; class AsioDriverList { public: AsioDriverList(); ~AsioDriverList(); LONG asioOpenDriver ( int ,VOID ** ); LONG asioCloseDriver ( int ); LONG asioGetNumDev ( VOID ); LONG asioGetDriverName ( int ,char * ,int ); LONG asioGetDriverPath ( int ,char * ,int ); LONG asioGetDriverCLSID ( int ,CLSID * ); LONG asioLink ( char *pszDriverName ); // Link to driver by name LONG asioCLSID ( CLSID *pClassIDofDriver ); // Get driver's class ID LONG asioOpen ( VOID **ppvDriverInterface ); // Runtime link to driver LONG asioClose ( void ); // Release the driver interface public: LPASIODRVSTRUCT lpdrvlist; // List of ASIO drivers in registry int numdrv; // Count of those drivers private: int m_nCurDrv; // Currently selected driver }; typedef class AsioDriverList *LPASIODRIVERLIST; #endif