Download ASX User Manual
Transcript
244
Example Documentation
ASX_Error_Clear( hObj );
return 1;
}
10.7
mux/main.c
This is an example of how to use the ASX multiplexer control.
/* $Header: /home/eliot/asi/repo/cvsrepo/Repository/apps/asx/examples/mux/main.c,
v 1.5 2004/08/11 14:13:36 as-age Exp $ */
#include "stdio.h"
#include "stdlib.h"
#include "asx.h"
#include "asxstring.h"
int CheckError(ASX_HANDLE hObj, int nLine);
void PrintControlName(ASX_HANDLE hControl);
ASX_HANDLE hSystem=0;
int main(int argc, char* argv[])
{
char *pszName;
ASX_HANDLE hAdapter;
ASX_HANDLE hMixer;
ASX_HANDLE hMux;
ASX_ERROR asxError;
int nAdapterToUse=0;
enum asxNODE eNode;
int nNodeIndex;
char szName[64];
int nRequiredLength;
int nCount;
int i,nLen;
// create the system
ASX_System_Create(ASX_SYSTEM_TYPE_HPI,&hSystem);
CheckError(hSystem, __LINE__);
// get the adapter
asxError = ASX_System_GetAdapter(hSystem,nAdapterToUse,&hAdapter);
CheckError(hSystem, __LINE__);
ASX_Adapter_GetName(hAdapter,0,0,&nLen);
CheckError(hAdapter, __LINE__);
pszName = (char *)malloc(nLen);
ASX_Adapter_GetName(hAdapter,pszName,nLen,&nLen);
CheckError(hAdapter, __LINE__);
printf("Adapter [%d] is %s \n", nAdapterToUse,pszName);
// get the mixer handle
asxError = ASX_Adapter_GetMixer( hAdapter, &hMixer );
CheckError(hAdapter, __LINE__);
// get a multiplexer object
asxError = ASX_Mixer_GetControlByNodeTypeAndIndex(
hMixer,
0,0,
asxNODE_RECORDER,0,
Generated on Thu Dec 17 2015 10:17:26 for ASX by Doxygen