thg_apm.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:7k
- /*******************************************************************************
- * Copyright(c) Philips Consumer Electronics B.V. 2001
- * The attached material and the information contained therein is proprietary
- * to Philips and is issued only under strict confidentiality arrangements.
- * It shall not be used, reproduced, copied in whole or in part, adapted,
- * modified, or disseminated without a written license of Philips.
- * It must be returned to Philips upon its first request.
- *
- * Project: SA-MP ( Super Audio Media Player )
- * File %name: thg_apm.c %
- * %version: 12 %
- * %date_modified: Tue Feb 26 17:57:38 2002 %
- * %derived_by: kokh %
- * Creation date: Thu Jun 14 16:08:32 2001
- * First author: klerxm
- *
- * Advanced Systems and Applications Lab - Eindhoven
- *
- * Continuus %full_filespec: thg_apm.c~12:csrc:1 %
- *
- * Description: Test harness of the Audio Presentation Manager
- *
- * Change history:
- *
- * Rev Date Who Comments
- * ---- ---------- -------- -----------------------------------------------------
- * 1 2001-06-06 klerxm Dummy version
- * 2 2001-06-14 klerxm Template update
- * 3 2001-08-21 potm First real version
- * 4 2001-09-04 klerxm Changes required for new global header files
- * 5 2001-10-29 potm Added second parameter to SetInputChannels
- * 6 2001-11-30 coenen Added Init, Term and SetBassFilters
- * 7-8
- * 9 2002-02-12 potm Attenuation now set all at once (PR297)
- * 10 2002-02-22 potm Adapted to new prototype of SetInputChannels (CR260)
- * 11 2002-02-22 potm Fixed compiler warning
- * 12 2002-02-27 kokh TH_Send -> SAMP(TH_Send)
- *
- *******************************************************************************/
- #define COMP_PREFIX "APM"
- /*******************************************************************************
- * Include Files
- *******************************************************************************/
- #include "config.h"
- #ifdef TEST_HARNASS
- #include <samp_gen.h>
- #include <samp_apm.h>
- #include <samp_apm_exp.h>
- #if 0
- #include <apm.h>
- #endif
- #include <testharn.h>
- #include <glue_test.h>
- /*******************************************************************************
- * Macro Definitions
- *******************************************************************************/
- /*******************************************************************************
- * Data Definitions
- *******************************************************************************/
- /*******************************************************************************
- * Function prototype
- *******************************************************************************/
- DECLARE_GROUPFUNC(THG_APM)
- /*******************************************************************************
- * Global test-harness function
- *******************************************************************************/
- DEFINE_GROUPFUNC(THG_APM)
- #ifdef THGAPM
- SAMP(ErrCode) lErr = SAMP(ERR_OK);
- SAMP(UInt32) param1, param2, paramArray[6];
- GROUP_SWITCH
- #if 0
- CASE_CMD( "Init" )
- lErr = SAMP_EXP(APM_Init)();
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "Term" )
- lErr = SAMP_EXP(APM_Term)();
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetInputChannels" )
- TH_GetParam (OPTIONS, "%u%u", ¶m1);
- lErr = SAMP_EXP(APM_SetInputChannels)((SAMP(SACD_ChannelsConfigDef))param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- #endif
- CASE_CMD( "SetInputMode" )
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_SetInputMode)(param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetOutputMode" )
- TH_GetParam (OPTIONS, "%u%u", ¶m1, ¶m2);
- lErr = SAMP_EXP(APM_SetOutputMode)(param1, param2);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "Set6chDownmix" )
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_Set6chDownmix)(param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "Set2chDownmix" )
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_Set2chDownmix)(param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetSpeakers" )
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_SetSpeakers)(param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetAttenuation" )
- SAMP(UInt32) lInput[8];
- SAMP(UInt16) lAttenuation[8], lChannelIndex;
- TH_GetParam (OPTIONS, "%u%u%u%u%u%u%u%u", &lInput[0], &lInput[1], &lInput[2], &lInput[3],
- &lInput[4], &lInput[5], &lInput[6], &lInput[7]);
- for(lChannelIndex = 0; lChannelIndex < 8; lChannelIndex++)
- {
- lAttenuation[lChannelIndex] = (SAMP(UInt16))lInput[lChannelIndex];
- }
- lErr = SAMP_EXP(APM_SetAttenuation)(lAttenuation);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetDelay" )
- TH_GetParam (OPTIONS, "%u%u%u%u%u%u", ¶mArray[0], ¶mArray[1],
- ¶mArray[2], ¶mArray[3],
- ¶mArray[4], ¶mArray[5]);
- lErr = SAMP_EXP(APM_SetDelay)(paramArray);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetFilterMode" )
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_SetFilterMode)(param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetPcmUpsampling" )
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_SetPcmUpsampling)((SAMP(UInt8))param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD( "SetBassFilters" )
- TH_GetParam (OPTIONS, "%u%u", ¶m1, ¶m2);
- lErr = SAMP_EXP(APM_SetBassFilters)( param1, param2 );
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- CASE_CMD("SetPIO")
- TH_GetParam (OPTIONS, "%u", ¶m1);
- lErr = SAMP_EXP(APM_SetPIO)((SAMP(BitSet16))param1);
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%u", lErr);
- END_CASE
- DEFAULT
- SAMP(TH_Send)(COMP_PREFIX, cmd, "%s", "Unknown command");
- END_CASE
- #endif
- END_GROUPFUNC
- /*******************************************************************************
- * End of File
- *******************************************************************************/
- #endif