次の方法で共有


How the Echo Sample Persists Data

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

When Windows Media Player enables a DSP plug-in, it may create and destroy many instances of the plug-in object during the course of a session. The plug-in needs a way to persist its property values between instances. The sample code generated by the Windows Media Player Plug-in Wizard stores these values in the registry and retrieves them when the property page is invoked or when a new instance of the plug-in is created.

The default sample code in Echo.h includes two constants that store the default registry path and the scale factor name string. You should keep the variable that specifies the path, but delete the line that specifies the scale factor registry name. Then, add the following code to define constants for the delay time and wet mix property names in the registry. The finished section should appear as follows:

// registry location for preferences
const TCHAR kszPrefsRegKey[] = _T("Software\\Echo\\DSP Plugin");
const TCHAR kszPrefsDelayTime[] = _T("DelayTime");
const TCHAR kszPrefsWetmix[] = _T("Wetmix");

You will use these constants when you modify the property page methods.

Modifying the Echo Sample Property Page