ASX Version4.13.09
Functions

System functions

Functions

ASX32_API int ASX_System_SupportsSubSystem (const int asxSystemType)
 Query ASX library for subsystem support.
ASX32_API ASX_ERROR ASX_System_Create (const int asxSystemType, ASX_HANDLE *phSystem)
 Create a complete ASX system.
ASX32_API ASX_ERROR ASX_System_CreateSubSystem (const int asxSystemType, ASX_HANDLE *pio_hSystem)
 Creates an ASX sub system and adds it to the existing system, if any.
ASX32_API ASX_ERROR ASX_System_SetHostNetworkInterface (const char *szInterface)
 Set the interface ASX should use when communicating with network devices.
ASX32_API ASX_ERROR ASX_System_Delete (ASX_HANDLE hSystem)
 Delete a complete ASX system.
ASX32_API ASX_ERROR ASX_System_RegisterErrorCallback (ASX_HANDLE hSystem, ASX_ERROR_CALLBACK *pCallback, void *pUser1, void *pUser2)
 Register a callback function that should be called when an error is detected.
ASX32_API ASX_ERROR ASX_System_GetName (ASX_HANDLE hSystem, char *pszName, const int nStringLength, int *pnRequiredLength)
 Gets the name of the ASX system.
ASX32_API ASX_ERROR ASX_System_GetVersion (ASX_HANDLE hSystem, char *pszSystemVersion, const int nSystemVersionLength, int *pnRequiredSystemVersionLength, char *pszSubSystemVersion, const int nSubSystemVersionLength, int *pnRequiredSubSystemVersionLength)
 Get ASX system version information.
ASX32_API ASX_ERROR ASX_System_GetAdapterCount (ASX_HANDLE hSystem, int *pnCount)
 Get the number of adapters.
ASX32_API ASX_ERROR ASX_System_GetAdapter (ASX_HANDLE hSystem, const int nAdapter, ASX_HANDLE *p_hAdapter)
 Get a handle to a specific adapter.
ASX32_API ASX_ERROR ASX_System_SetMessageLogging (ASX_HANDLE hSystem, const enum asxMSG_LOGGING eLog)
 Set the message logging level for ASX.
ASX32_API ASX_ERROR ASX_System_GetMessageLogging (ASX_HANDLE hSystem, enum asxMSG_LOGGING *eLog)
 Get the message logging level for ASX.
ASX32_API ASX_ERROR ASX_System_SetCobranetAutoassignParms (const struct asxCobranetIpAutoassignParameters *pCAP)
 Set the IP address range that will be used for assigning IP addresses to cobranet devices.
ASX32_API ASX_ERROR ASX_System_GetCobranetAutoassignParms (struct asxCobranetIpAutoassignParameters *pCAP)
 Get the IP address range that will be used for assigning IP addresses to cobranet devices.

Function Documentation

ASX32_API ASX_ERROR ASX_System_Create ( const int  asxSystemType,
ASX_HANDLE phSystem 
)

Create a complete ASX system.

This function creates a complete ASX interface of the type specified by asxSystemType. If more than one system type is needed use ASX_System_CreateSubSystem() instead.

Parameters:
asxSystemTypeThe ASX system type to open. One of SubSystem types defines above.
phSystemPointer to the returned system handle.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
adapter/main.c, dual_mono_play/main.c, dual_mono_record/main.c, mixer/main.c, mux/main.c, play/main.c, playlist/main.c, record/main.c, system/main.c, tuner/main.c, and volume/main.c.
ASX32_API ASX_ERROR ASX_System_CreateSubSystem ( const int  asxSystemType,
ASX_HANDLE pio_hSystem 
)

Creates an ASX sub system and adds it to the existing system, if any.

Use this function when creating more than one subsystem.

Parameters:
asxSystemTypeThe ASX system type to open. One of SubSystem types defines above.
pio_hSystemPointer to the system handle. Should be a pointer to NULL for the first call.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
cobranet/main.c.
ASX32_API ASX_ERROR ASX_System_Delete ( ASX_HANDLE  hSystem)

Delete a complete ASX system.

The delete function should be called using a previously opened ASX system handle prior to closing an application. Note that when an ASI2416 CobraNet device is in use a call to ASX_System_Delete() triggers a save to ASI2416 flash of any control parameters that might have changed. If this fails for any reason an asxERROR_MIXER_SAVECONTROLSTATE error is returned.

Parameters:
hSystemThe asx system handle.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
adapter/main.c, cobranet/main.c, dual_mono_play/main.c, dual_mono_record/main.c, mixer/main.c, mux/main.c, play/main.c, playlist/main.c, record/main.c, system/main.c, tuner/main.c, and volume/main.c.
ASX32_API ASX_ERROR ASX_System_GetAdapter ( ASX_HANDLE  hSystem,
const int  nAdapter,
ASX_HANDLE p_hAdapter 
)

Get a handle to a specific adapter.

This function returns a handle to an adapter object that can then be used to access functionality of the adapter.

Parameters:
hSystemA handle to an ASX system object.
nAdapterThe index of the adapter.
p_hAdapterThe retuned adapter handle.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
adapter/main.c, cobranet/main.c, dual_mono_play/main.c, dual_mono_record/main.c, mixer/main.c, mux/main.c, play/main.c, playlist/main.c, record/main.c, tuner/main.c, and volume/main.c.
ASX32_API ASX_ERROR ASX_System_GetAdapterCount ( ASX_HANDLE  hSystem,
int *  pnCount 
)

Get the number of adapters.

This function returns the number of recognized sound cards installed in the computer.

Parameters:
hSystemA handle to an ASX system object.
pnCountThe returned number of adapters.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
adapter/main.c, cobranet/main.c, and system/main.c.
ASX32_API ASX_ERROR ASX_System_GetCobranetAutoassignParms ( struct asxCobranetIpAutoassignParameters pCAP)

Get the IP address range that will be used for assigning IP addresses to cobranet devices.

Parameters:
pCAPPointer to the asxCobranetIpAutoassignParameters structure that receives the IP autoassign parameters.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_System_GetMessageLogging ( ASX_HANDLE  hSystem,
enum asxMSG_LOGGING eLog 
)

Get the message logging level for ASX.

Parameters:
hSystemA handle to an ASX system object.
eLogThe error logging level. see asxMSG_LOGGING for options
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_System_GetName ( ASX_HANDLE  hSystem,
char *  pszName,
const int  nStringLength,
int *  pnRequiredLength 
)

Gets the name of the ASX system.

This function returns the name of the audio substem currently being used underneath ASX, for example, "HPI" would be returned if ASX was being run using the AudioScience HPI driver.

Parameters:
hSystemThe asx system handle.
pszNameThe string to use to copy the returned adapter name to. Typical return values are:

  • "HPI"
  • "Wave"
  • "DirectX"
  • "PortAudio"
  • "ALSA"
nStringLengthThe length of the string szString that was passed in.
pnRequiredLengthThe minimum required length in bytes of szString.
Note:
This function can be called will szString=0 and nStringLength=0 to retrieve the string size required.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
system/main.c.
ASX32_API ASX_ERROR ASX_System_GetVersion ( ASX_HANDLE  hSystem,
char *  pszSystemVersion,
const int  nSystemVersionLength,
int *  pnRequiredSystemVersionLength,
char *  pszSubSystemVersion,
const int  nSubSystemVersionLength,
int *  pnRequiredSubSystemVersionLength 
)

Get ASX system version information.

This function returns version information in two strings.

Parameters:
hSystemA handle to an ASX system object.
pszSystemVersionThe ASX version returned as a string.
nSystemVersionLengthThe length of pszSystemVersion in bytes.
pnRequiredSystemVersionLengthThe minimum required length of pszSystemVersion in bytes.
pszSubSystemVersionThe ASX subsystem version returned as a string. This is the version number of the HPI,Wave or ALSA (etc.) driver.
nSubSystemVersionLengthThe length in bytes of pszSubSystemVersion.
pnRequiredSubSystemVersionLengthThe minimum required length in bytes of pszSubSystemVersion.
Note:
This function can be called with string pointers set to zero to determine the size of strings to allocate.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
system/main.c.
ASX32_API ASX_ERROR ASX_System_RegisterErrorCallback ( ASX_HANDLE  hSystem,
ASX_ERROR_CALLBACK pCallback,
void *  pUser1,
void *  pUser2 
)

Register a callback function that should be called when an error is detected.

Note that using this function is optional. ASX_Error_GetLast() can be used after each call, or the error return value of each call may be checked. The callback function itself should use ASX_Error_GetLast() to figure out what error was actually generated.

Parameters:
hSystemA handle to an ASX system object.
pCallbackA pointer to a callback of type ASX_ERROR_CALLBACK.
pUser1A user defined pointer that is passed back when an error occurs.
pUser2A user defined pointer that is passed back when an error occurs.
Note:
An error of type asxERROR_INVALID_CONTROL_ATTRIBUTE returned by control operations that attempt to accesses functionality not supported by the control will not cause a callback to pCallback routine.
ASX32_API ASX_ERROR ASX_System_SetCobranetAutoassignParms ( const struct asxCobranetIpAutoassignParameters pCAP)

Set the IP address range that will be used for assigning IP addresses to cobranet devices.

This function should be called before the ASX_SYSTEM_TYPE_SNMP is create with ASX_System_Create() or ASX_System_CreateSubSystem().

Parameters:
pCAPPointer to the asxCobranetIpAutoassignParameters structure that contains the IP autoassign parameters.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
ASX32_API ASX_ERROR ASX_System_SetHostNetworkInterface ( const char *  szInterface)

Set the interface ASX should use when communicating with network devices.

This function should be called before ASX_System_Create().

Parameters:
szInterfaceThe network interface to use. For Windows this is the IP address of the form "192.168.1.13".
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
cobranet/main.c.
ASX32_API ASX_ERROR ASX_System_SetMessageLogging ( ASX_HANDLE  hSystem,
const enum asxMSG_LOGGING  eLog 
)

Set the message logging level for ASX.

Parameters:
hSystemA handle to an ASX system object.
eLogThe error logging level to set.
Returns:
Returns 0 if there is no error, otherwise one of asxERROR is returned.
Examples:
play/main.c.
ASX32_API int ASX_System_SupportsSubSystem ( const int  asxSystemType)

Query ASX library for subsystem support.

Indicate if this instance of ASX library supports the given subsystem type.

Parameters:
asxSystemTypeThe ASX system type to query. One of SubSystem types defines above.
Returns:
1 if asxSystemType type supported, 0 if asxSystemType is not supported.