void METH(init) (t_uint16 nChannelsIn, t_uint16 nChannelsOut, t_sample_freq freq) {
    
    METH(open)();
    volctrl_init(&mVolData, freq);
    mInitialized = true;
    
    if (mRampDuration != 0) {
        VolctrlRampConfig_t config;
        fillRampConfigStruct(&config);
        METH(setRampConfig)(config);
    } else {
        VolctrlConfig_t config;
        fillConfigStruct(&config);
        METH(setConfig)(config);
    }

    if (nChannelsIn == 1 && nChannelsOut == 1) {
        mVolData.input_mode = VOLCTRL_INPUT_MONO;
        mProcess = processBufferMono;
    }
    else if (nChannelsIn == 2 && nChannelsOut == 1) {
        mVolData.input_mode = VOLCTRL_INPUT_STEREO;
        mVolData.downmix   = 1;
        mProcess = processBufferDownmix;
    }
    else if (nChannelsIn == 2 && nChannelsOut == 2) {
        mVolData.input_mode = VOLCTRL_INPUT_STEREO;
        mProcess = processBufferStereo;
    }
    else {
        ASSERT(0);
    }
    mVolData.new_config |= VOLCTRL_IMMEDIAT_CMD_PENDING;
}
void nmfQueuePushAndExecute(t_queue _pQueue, t_queue_link *pElem, void *pExecuteFunction)
{
    t_queue_description* pQueue = (t_queue_description*)_pQueue;

    eeMutexLock(pQueue->mutex);
    METH(pushAndExecute)(_pQueue, pElem, pExecuteFunction);
    eeMutexUnlock(pQueue->mutex);
}
void METH(setVolume)(t_sint16 nVolume) {
    mVolume = nVolume;
    if (mInitialized) {
        VolctrlConfig_t config;
        fillConfigStruct(&config);
        METH(setConfig)(config);
    }
}
void METH(setBalance)(t_sint16 nBalance) {
    mBalance = nBalance;
    if (mInitialized) {
        VolctrlConfig_t config;
        fillConfigStruct(&config);
        METH(setConfig)(config);
    }
}
void METH(setMute)(BOOL bMute) {
    mMute = bMute;
    if (mInitialized) {
        VolctrlConfig_t config;
        fillConfigStruct(&config);
        METH(setConfig)(config);
    }
}
t_queue_link *nmfQueuePopMatchingAndExecute(t_queue _pQueue, void* pMatchingFunction, void* pMatchingFunctionArgs, void *pExecuteFunction, void *pExecuteFunctionArgs)
{
    t_queue_description* pQueue = (t_queue_description*)_pQueue;
    t_queue_link *pRes;

    eeMutexLock(pQueue->mutex);
    pRes = METH(popMatchingAndExecute)(_pQueue, pMatchingFunction, pMatchingFunctionArgs, pExecuteFunction, pExecuteFunctionArgs);
    eeMutexUnlock(pQueue->mutex);

    return pRes;
}
Example #7
0
int METH(myItf, myMethod)(int a, int b) {
	int (* METH_PTR(f))(void* pointer, ...);
	METH_PTR(f) = METH(myPrivateMethod);
	
	/* invoke method pointer without 'CALL' construct. */
	f(NULL, &(PRIVATE.a)); /* cannot be detected at compile-time => mind "exception" at runtime */

	/* should be :
	   CALL_PTR(f)(NULL, &(PRIVATE.a)); */

	
	CALL(myOtherPrivateMethod)(1)(NULL, &(PRIVATE.a)); /* cannot be detected at compile-time => mind "exception" at runtime */
	/* should be :
	   CALL_PTR(CALL(myOtherPrivateMethod)(1))(NULL, &(PRIVATE.a));
	   ======================== */
	
	return 0;
}
void METH(setVolumeRamp)(
        t_sint16    nStartVolume,
        t_sint16    nEndVolume,
        t_uint16    nRampChannels,
        t_uint24    nRampDuration,
        BOOL        bRampTerminate
    ) 
{
    mVolume             = nStartVolume;
    mRampEndVolume      = nEndVolume;
    mRampChannels       = nRampChannels;
    mRampDuration       = nRampDuration;
    mRampTerminate      = bRampTerminate;
    
    if (mInitialized) {
        VolctrlRampConfig_t config;
        fillRampConfigStruct(&config);
        METH(setRampConfig)(config);
    }
}
Example #9
0
int METH(myItf, myMethod)(int a, int b) {
	PRIVATE.a = a;
	PRIVATE.b = b;
	return METH(myPrivateMethod)(b);
}
Example #10
0
int (* METH_PTR(METH(myOtherPrivateMethod)(int a)))(void * pointer, ...) {
	PRIVATE.a += a;
	/* return a pointer to the "myPrivateMethod" private method */
	return METH(myPrivateMethod);
}
Example #11
0
int (* METH_PTR(METH(myOtherPrivateMethod)(int a)))(int a) {
	PRIVATE.a += a;
	// return a pointer to the "myPrivateMethod" private method
	return METH(myPrivateMethod);
}