AudioWeaver的新模块开发需要Matlab,VisualStudio,server,硬件平台,嵌入式开发IDE。
AudioWeaver在PC端主要依靠的就是Matlab来配置和控制,Matlab提供接口可以进行参数计算,可视化,自动化,测试,以及系统的编译。同时负责描述模块,生成代码,生成文档。
每个AW 模块都有一个关联的Matlab M文件,其中包含了模块的描述信息,包括
- I/O pin描述: 数据类型,通道数,block size,采样率
- 结构变量: 数据类型,变量名,array size, memory分配要求
- 文档信息:变量描述,pin描述,模块描述
- 链接到inner c代码:process,set,bypass,get函数
- 用户接口:control信号接口
- AWE designer 描述信息
每个模块都有一个instance data structure来保存变量,包括state 和parameters变量。instance data structure包含在模块头文件中module.h。
这个头文件是有AW自动生成的。
typedef struct _awe_modScalerSmoothedExampleInstance
{
ModuleInstanceDescriptor instance;
float gain; // Target gain
float smoothingTime; // Time constant of the ...
float currentGain; // Instantaneous gain applied
...
float smoothingCoeff; // Smoothing coefficient
} awe_modScalerSmoothedExampleInstance;
在开头包含了一个子结构体 ModuleInstanceDescriptor instance,其中指向模块的I/O pin,实时函数(processing,Bypass,Muted,…),类结构。定义在
<AWE>\Include\Framework.h.
里面还有模块instance描述结构:
typedef struct _ModuleInstanceDescriptor
{
ModInstanceDescriptor instanceDescriptor;
struct _LayoutInstance *pOwner;
UINT packedFlags;
float profile_time;
WireInstance **pWires;
void (*pProcessFunc)(void *pInstance);
}
ModuleInstanceDescriptor;
typedef struct _WireInstance
{
/** The basic instance data. */
InstanceDescriptor instanceDescriptor;
/** The pin descriptor describing this wire. */
PinInstanceDescriptor *pPinDescriptor;
/** The wire buffer. */
Sample *buffer;
}
WireInstance;
头文件中还包含了模块配置变量的bit mask宏, 偏移宏 和 类ID。
Server可以通过类ID来新建一个模块在siganlflow中。每个模块的类ID都是唯一的。
#