From e1fcbfea281d0be389307555fbbaf1db8e224cab Mon Sep 17 00:00:00 2001 From: kpl Date: Sat, 24 Nov 2012 10:32:12 -0800 Subject: [PATCH] Added cmAudDspLocalSendSetup() and cmAudDspSendSetup() --- cmAudDsp.c | 33 +++++++++++++++++++++------------ cmAudDsp.h | 3 +++ cmAudDspLocal.c | 15 +++++++++++++++ cmAudDspLocal.h | 2 ++ 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/cmAudDsp.c b/cmAudDsp.c index 3fc253c..43801be 100644 --- a/cmAudDsp.c +++ b/cmAudDsp.c @@ -612,18 +612,6 @@ cmAdRC_t cmAudDspAlloc( cmCtx_t* ctx, cmAdH_t* hp, cmMsgSendFuncPtr_t cbFunc, vo p->curAsCfgIdx = cmInvalidIdx; p->ctx = *ctx; - // notify the client of the available audio system configurations - if((rc = _cmAdSendAudioSysCfgLabels(p)) != kOkAdRC ) - goto errLabel; - - // notify the client of the available devices - if((rc = _cmAdSendDeviceLabels(p)) != kOkAdRC) - goto errLabel; - - // notify the client of the available programs - if((rc = _cmAdSendProgramLabels(p)) != kOkAdRC ) - goto errLabel; - hp->h = p; @@ -653,6 +641,27 @@ cmAdRC_t cmAudDspFree( cmAdH_t* hp ) return rc; } +cmAdRC_t cmAudDspSendSetup( cmAdH_t h ) +{ + cmAdRC_t rc = kOkAdRC; + cmAd_t* p = _cmAdHandleToPtr( h ); + + // notify the client of the available audio system configurations + if((rc = _cmAdSendAudioSysCfgLabels(p)) != kOkAdRC ) + goto errLabel; + + // notify the client of the available devices + if((rc = _cmAdSendDeviceLabels(p)) != kOkAdRC) + goto errLabel; + + // notify the client of the available programs + if((rc = _cmAdSendProgramLabels(p)) != kOkAdRC ) + goto errLabel; + + errLabel: + return rc; +} + bool cmAudDspIsValid( cmAdH_t h ) { return h.h != NULL; } diff --git a/cmAudDsp.h b/cmAudDsp.h index 14bc8f4..04edff4 100644 --- a/cmAudDsp.h +++ b/cmAudDsp.h @@ -40,6 +40,9 @@ extern "C" { cmAdRC_t cmAudDspAlloc( cmCtx_t* ctx, cmAdH_t* hp, cmMsgSendFuncPtr_t cbPtr, void* cbDataPtr ); cmAdRC_t cmAudDspFree( cmAdH_t* hp ); + // Send the setup to the UI (device list,system cfg list, DSP programs) + cmAdRC_t cmAudDspSendSetup( cmAdH_t h ); + bool cmAudDspIsValid( cmAdH_t h ); // This function provides the primary interface for communication from the diff --git a/cmAudDspLocal.c b/cmAudDspLocal.c index 7c25c0b..145027a 100644 --- a/cmAudDspLocal.c +++ b/cmAudDspLocal.c @@ -136,6 +136,21 @@ cmAdlRC_t cmAudDspLocalFree( cmAdlH_t* hp ) return rc; } +cmAdlRC_t cmAudDspLocalSendSetup( cmAdlH_t h ) +{ + cmAdlRC_t rc = kOkAdlRC; + cmAdl_t* p = _cmAdlHandleToPtr(h); + if( cmAudDspSendSetup(p->adH) != kOkAdRC ) + { + rc = cmErrMsg(&p->err,kAudDspFailAdlRC,"The audio DSP system setup request failed."); + goto errLabel; + } + + errLabel: + return rc; +} + + bool cmAudDspLocalIsValid( cmAdlH_t h ) { return h.h != NULL; } diff --git a/cmAudDspLocal.h b/cmAudDspLocal.h index 09c55e3..c90b67d 100644 --- a/cmAudDspLocal.h +++ b/cmAudDspLocal.h @@ -26,6 +26,8 @@ extern "C" { cmAdlRC_t cmAudDspLocalFree( cmAdlH_t* hp ); + cmAdlRC_t cmAudDspLocalSendSetup( cmAdlH_t h ); + bool cmAudDspLocalIsValid( cmAdlH_t h ); cmAiH_t cmAudDspLocalIF_Handle( cmAdlH_t h );