CBasicAudio Class

CBasicAudio class hierarchy

The CBasicAudio class handles the IDispatch interface component of the IBasicAudio interface and leaves the properties and methods of IBasicAudio pure virtual to be implemented by a derived filter class.

The CBasicAudio::GetIDsOfNames, CBasicAudio::GetTypeInfo, CBasicAudio::GetTypeInfoCount, and CBasicAudio::Invoke member functions are standard implementations of the IDispatch interface using the CBaseDispatch class (and a type library) to parse the commands and pass them to the pure virtual IBasicAudio methods.

Microsoft® DirectShow® uses units of 100th of a decibel for the volume scale. A value of 0 indicates maximum volume supported by the device. A value of –10,000 is the minimum volume (usually silence). Balance is expressed in the range –10,000 to 10,000, with 0 being neutral. A negative balance value means that the right channel is attenuated by this decibel value (that is, it is quieter). Similarly, a positive balance value means that the right channel is louder than the left; that is, the left channel is attenuated by the corresponding negative decibel value.

Member Functions

CBasicAudio Constructs a CBasicAudio object.

Implemented INonDelegatingUnknown Methods

NonDelegatingQueryInterface Retrieves a specified reference-counted interface.

Implemented IDispatch Methods

GetIDsOfNames Maps a single member and an optional set of parameters to a corresponding set of integer dispatch identifiers, which can be used during subsequent calls to the CBasicAudio::Invoke member function.
GetTypeInfo Retrieves a type-information object, which can retrieve the type information for an interface.
GetTypeInfoCount Retrieves the number of type-information interfaces provided by an object.
Invoke Provides access to properties and methods exposed by an object.

CBasicAudio::CBasicAudio

CBasicAudio Class

Constructs a CBasicAudio object.

Syntax

CBasicAudio(
  const TCHAR *pName,
  LPUNKNOWN pUnk
  );

Parameters

pName
Pointer to the name of the object used in the CBasicAudio constructor for debugging purposes.
pUnk
Pointer to the owner of this object.

Return Value

No return value.

Remarks

Allocate the pName parameter in static memory. This name appears on the debugging terminal when the object is created and deleted.

CBasicAudio::GetIDsOfNames

CBasicAudio Class

Maps a single member function and an optional set of parameters to a corresponding set of integer dispatch identifiers, which can be used upon subsequent calls to the CBasicAudio::Invoke member function.

Syntax

HRESULT GetIDsOfNames(

  REFIID riid,
  OLECHAR **rgszNames,
  UINT cNames,
  LCID lcid,
  DISPID *rgdispid
  );

Parameters

riid
Reference identifier. Reserved for future use. Must be NULL.
rgszNames
Address of a pointer to a passed-in array of names to be mapped.
cNames
Count of the names to be mapped.
lcid
Locale context in which to interpret the names.
rgdispid
Pointer to a caller-allocated array, each element of which contains an ID corresponding to one of the names passed in the rgszNames array. The first element represents the member name; the subsequent elements represent each of the member's parameters.

Return Value

Returns one of the following values.
DISP_E_UNKNOWN_CLSID The CLSID was not recognized.
DISP_E_UNKNOWNNAME One or more of the names were not known. The returned DISPIDs contain DISPID_UNKNOWN for each entry that corresponds to an unknown name.
E_OUTOFMEMORY Out of memory.
S_OK Success.

CBasicAudio::GetTypeInfo

CBasicAudio Class

Retrieves a type-information object, which can retrieve the type information for an interface.

Syntax

HRESULT GetTypeInfo(

  UINT itinfo,
  LCID lcid,
  ITypeInfo **pptinfo
  );

Parameters

itinfo
Type information to return. Pass zero to retrieve type information for the IDispatch implementation.
lcid
Locale ID for the type information. For classes that support localized member names, an object might be able to return different type information for different languages. This is important for classes that support localized member names. For classes that do not support localized member names, this parameter can be ignored.
pptinfo
Address of a pointer to the type-information object requested.

Return Value

Returns an E_POINTER if pptinfo is invalid. Returns TYPE_E_ELEMENTNOTFOUND if itinfo is not zero. Returns S_OK if is successful. Otherwise, returns an HRESULT from one of the calls to retrieve the type. The HRESULT indicates the error and can be one of the following standard constants, or other values not listed.
E_FAIL Failure.
E_POINTER Null pointer argument.
E_INVALIDARG Invalid argument.

CBasicAudio::GetTypeInfoCount

CBasicAudio Class

Retrieves the number of type-information interfaces provided by an object.

Syntax

HRESULT GetTypeInfoCount(

  UINT *pctinfo
  );

Parameters

pctinfo
Pointer to the location that receives the number of type-information interfaces that the object provides. If the object provides type information, this number is 1; otherwise, the number is 0.

Return Value

Returns E_POINTER if pctinfo is invalid; otherwise, returns S_OK.

CBasicAudio::Invoke

CBasicAudio Class

Provides access to properties and methods exposed by an object.

Syntax

HRESULT Invoke(

  DISPID dispidMember,
  REFIID riid,
  LCID lcid,
  WORD wFlags,
  DISPPARAMS *pdispparams,
  VARIANT *pvarResult,
  EXCEPINFO *pexcepinfo,
  UINT *puArgErr
  );

Parameters

dispidMember
Identifier of the member. Use CBasicAudio::GetIDsOfNames or the object's documentation to obtain the dispatch identifier.
riid
Reserved for future use. Must be IID_NULL.
lcid
Locale context in which to interpret arguments.
wFlags
Flags describing the context of the CBasicAudio::Invoke call.
pdispparams
Pointer to a DISPPARAMS structure containing an array of arguments, an array of argument dispatch IDs for named arguments, and counts for number of elements in the arrays.
pvarResult
Pointer to where the result is to be stored, or NULL if the caller expects no result.
pexcepinfo
Pointer to a structure containing exception information.
puArgErr
Pointer to the index of the first argument, within the rgvarg array, that has an error. The rgvarg array is a member of the DISPPARAMS structure.

Return Value

Returns DISP_E_UNKNOWNINTERFACE if riid is not IID_NULL. Returns one of the error codes from CBasicAudio::GetTypeInfo if the call fails. Otherwise, returns the HRESULT from the call to IDispatch::Invoke.

CBasicAudio::NonDelegatingQueryInterface

CBasicAudio Class

Returns a specified reference-counted interface.

Syntax

HRESULT NonDelegatingQueryInterface(
  REFIID riid,
  void **ppv
  );

Parameters

riid
Reference identifier.
ppv
Address of a pointer to the interface.

Return Value

Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or E_NOINTERFACE if it is not.

Remarks

Returns pointers to the IBasicAudio and IUnknown interfaces by default. Override this member function to publish any additional interfaces implemented by the derived class.

This member function implements the INonDelegatingUnknown::NonDelegatingQueryInterface method.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.