FrameFilterImpl::addFloatParam Method

Registers a float parameter than can be accessed using the methods of IFrameFilter.
Syntax:
protected:
    void addFloatParam( const std::string& name, tFilterError (T::*getFunc)( float& ), tFilterError (T::*setFunc)( float ) );
    void addFloatParam( const std::wstring& name, tFilterError (T::*getFunc)( float& ), tFilterError (T::*setFunc)( float ) );

Name Description
name

Name of the parameter. This string has to be passed to IFrameFilter::setParameter or IFrameFilter::getParameter to access the parameter.

getFunc

Name of a member function of the class derived from FrameFilterImpl. Has to take a reference to a float as its only parameter and return a tFilterError.

setFunc

Name of a member function of the class derived from FrameFilterImpl. Has to take a float as its only parameter and return a tFilterError.

Remarks:

You should register all parameters of your frame filter in your constructor.

Example:

This example shows how to register a float parameter and implement the necessary access methods.

In the constructor of your frame filter implementation, add a call to addFloatParam:

CRotateTransform::CRotateTransform()
    :    m_Angle( 0.0f )
{
    addFloatParam( "angle", &CRotateTransform::getAngle, &CRotateTransform::setAngle );
}

Declare the methods setAngle and getAngle in the header file...

DShowLib::tFilterError    setAngle( float val );
DShowLib::tFilterError    getAngle( float& val );

...and implement them in the source file:

tFilterError    CRotateTransform::setAngle( float val )
{
    m_Angle = val;
    return eNO_ERROR;
}
tFilterError    CRotateTransform::getAngle( float& val )
{
    val = m_Angle;
    return eNO_ERROR;
}

See also: FrameFilterImpl, FrameFilterImpl::addBoolParam, FrameFilterImpl::addLongParam, FrameFilterImpl::addStringParam, FrameFilterImpl::addDataParam

<< FrameFilterImpl