Copyright (C) Kevin Larke 2009-2020

This file is part of libcm.

libcm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See the GNU General Public License distributed with the libcm package or look here: .


cmAudDsp : Supports a serialized interface to an internal instance of cmAudioSys and cmDspSys.

enum
{
  kOkAdRC = cmOkRC,
  kAudioPortFailAdRC,
  kAudioSysFailAdRC,
  kMidiSysFailAdRC,
  kSerialPortFailAdRC,
  kDspSysFailAdRC,
  kFileSysFailAdRC,
  kJsonFailAdRC,
  kSendMsgFailAdRC,
  kInvalidCfgIdxAdRC,
  kNoPgmLoadedAdRC,
  kInvalidSubSysIdxAdRC,
  kUnknownMsgTypeAdRC,
  kSerialDevCreateFailAdRC,
  kAggDevSysFailAdRC,
  kAggDevCreateFailAdRC,
  kNrtDevSysFailAdRC,
  kAfpDevSysFailAdRC,
  kNetSysFailAdRC,
  kInvalidAudioDevIdxAdRC
};


typedef cmRC_t     cmAdRC_t;
typedef cmHandle_t cmAdH_t;

extern cmAdH_t cmAdNullHandle;

// Create a audio dsp engine and send device and program information to the 
// host application.  
// cbPtr provides a function used by cmAudDsp to send messages to the client.
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
// client program to the aud_dsp system.
cmAdRC_t cmAudDspReceiveClientMsg( cmAdH_t h, unsigned msgBytecnt, const void* msg );