Microsoft DirectX 8.0 |
This sample is a Microsoft® DirectX® Media Object (DMO) that creates a gargle effect, similar to the Gargle Filter sample for Microsoft® DirectShow®.
This sample demonstrates how to implement the the following interfaces:
Source: (SDK root)\Samples\Multimedia\DirectShow\DMO\GargleDMO
To use this DMO, build and register GargleDMO.dll. The sample project builds several intermediate libraries. To build the DLL in Microsoft® Visual Studio®, select Batch Build from the Build menu.
You can use the DMO in the DMO Demo sample application, or with the DirectShow GraphEdit utility. GraphEdit automatically wraps the DMO in the DMO Wrapper filter.
You can also use the DMO in Microsoft® DirectMusic® applications, including the Microsoft® DirectMusic® Producer application included with the SDK. In DirectMusic Producer, use the Audiopath Designer to insert the DMO into an audiopath. To control media parameters, use the Parameter Control track. Insert a curve in the track and assign it to control any of the properties on the DMO. For more information, see the Audiopath Designer and Parameter Control Track topics in the DirectMusic Producer application help.
The Gargle DMO provides a property page for the user to set the shape of the modulating waveform (square or triangular) and the frequency. It also supports a custom interface, IGargleDMOSample, for setting these properties.
The Gargle DMO sample is built with the Active Template Library (ATL). The source code is organized into three libraries:
ControlBase Library
- Controlhelp.h, Controlhelp.cpp: Helper classes for the user interface controls; used by the property page.
GargleDMO Library
- Gargle.h, Gargle.cpp: Implements the Gargle DMO, including the IMediaObjectInPlace interface and the custom IGargleDMOSample interface.
- GargleDMO.cpp: Implements the DLL entry-point function, and the DLL functions needed by the COM library, such as DllGetClassObject.
- GargleDMO.def: Exports the DLL functions needed by the COM library.
- GargleDMOProp.h, GargleDMOProp.cpp: Implements the property page. The property pages uses ATL's IPropertyPageImpl class template.
- IGargle.h: Declares the IGargleDMOSample interface.
- Resource.h: Resource constants.
- Stdafx.h, Stdafx.cpp: Basic functions required by ATL.
MedParamBase Library
- Alist.h, Alist.cpp: Simple linked-list class.
- Param.h, Param.cpp: Contains the CParamsManager class, which implements the IMediaParams and IMediaParamInfo interfaces for media parameters.
The Gargle DMO does not use the IMediaObjectImpl base class. It uses an older set of DMO base classes, which the IMediaObjectImpl class is designed to replace.
The IMediaObjectImpl class offers the following improvements:
In future releases, Gargle DMO might be rewritten to use IMediaObjectImpl.