Share via


Windows Media Player 11 SDK Adding Properties to the Sample Audio DSP Plug-inĀ 

Windows Media Player SDK banner art

Previous Next

Adding Properties to the Sample Audio DSP Plug-in

The audio DSP sample code that the Windows Media Player Plug-in Wizard generates uses a single property that represents the scale factor for the audio volume. Your plug-in may require more than one property. You can easily add properties to your DSP plug-in in Visual Studio using the following steps:

  1. Define the methods in the interface definition code in the project's IDL file.

  2. Add the method declarations to the main class declaration in the header file:

    STDMETHOD(get_color)(COLORREF *pColor);
    STDMETHOD(put_color)(COLORREF newColor);
    

  3. Add the method implementations to the project's main CPP file:

    STDMETHODIMP CYourProject::get_color(COLORREF *pColor)
    {
    if ( NULL == pColor )
    {
    return E_POINTER;
    }

    *pColor = m_Color;

    return S_OK; }

STDMETHODIMP CYourProject::put_color(COLORREF newColor) { m_Color = newColor;

return S_OK;

}

Finally, to make the properties accessible to the user, you'll want to make changes to the property page implementation.

See Also

Previous Next