Home Units Hierarchy Routines All identifiers

Class unaMsAcmDriver

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaMsAcmDriver = class(unaObject)

Description

List of installed drivers is maintained by unaMsAcm class, so usually there is no need to create/destroy the driver class explicitly. Use the unaMsAcm.getDriver() method instead.

Driver has lists of associated wave formats and filters. You should explicitly call enumFilters() or enumFormats() to enumerate the filters and formats supported by driver. Driver will be opened for enumeration purposes. Explicitly opening the driver by calling the open() method ensures the driver handle will be valid until class is destroyed, or method close() is called.

Use getDetails() method to retrieve pointer on ACMDRIVERDETAILSW structure. You should treat this structure as read-only.

Hierarchy

Overview

Methods

Public constructor create(acm: unaMsAcm; id: HACMDRIVERID; support: unsigned; const libName: wString = '');
Public destructor Destroy(); override;
Public function about(wnd: HWND): MMRESULT;
Public function assignFormat(tag: unsigned; index: unsigned; device: unaWaveDevice): bool;
Public function close(): MMRESULT;
Public function enumFilters(flags: uint = 0): MMRESULT;
Public function enumFormats(flags: uint = 0; force: bool = false; pwfx: pWAVEFORMATEX = nil; tagsOnly: bool = false): MMRESULT;
Public function getDetails(): pACMDRIVERDETAILSW;
Public function getFilter(index: unsigned): unaMsAcmFilter;
Public function getFilterCount(): unsigned;
Public function getFormat(index: unsigned): unaMsAcmFormat;
Public function getFormatCount(): unsigned;
Public function getFormatTag(index: unsigned): unaMsAcmFormatTag;
Public function getFormatTagCount(): unsigned;
Public function getHandle(): HACMDRIVER;
Public function getPriority(): unsigned;
Public function isEnabled(): bool;
Public function isOpen(): bool;
Public function open(): MMRESULT;
Public function preparePafd(var pafd: ACMFORMATDETAILS; tag: unsigned = 0; index: unsigned = 0): bool;
Public function sendDriverMessage(msg: UINT; lParam1: LongInt; lParam2: Longint = 0): Longint;
Public function suggestCodecFormat(srcFormat: pWAVEFORMATEX; dstFormat: pWAVEFORMATEX; flags: uint): MMRESULT;
Protected function isMyLib(const libName: wString): bool;
Protected function refInc(delta: int): int;
Public procedure AfterConstruction(); override;
Public procedure BeforeDestruction(); override;
Public procedure setEnabled(value: bool);
Public procedure setPriority(value: unsigned);

Properties

Public property acm: unaMsAcm read f_acm;
Public property id: HACMDRIVERID read f_id;
Public property isInstallable: bool read f_isInstallable;

Description

Methods

Public constructor create(acm: unaMsAcm; id: HACMDRIVERID; support: unsigned; const libName: wString = '');

Initializes the instance of MS ACM driver object. id parameters specifies the ID of driver to use.

Public destructor Destroy(); override;
 
Public function about(wnd: HWND): MMRESULT;

Displays a custom About dialog box from an ACM driver. If the driver does not support a custom About dialog box, MMSYSERR_NOTSUPPORTED will be returned.

Public function assignFormat(tag: unsigned; index: unsigned; device: unaWaveDevice): bool;

Retrieves format details and fills the PCM sampling parameters of given wave device.

Public function close(): MMRESULT;

Closes a previously opened ACM driver instance.

Returns

MMSYSERR_NOERROR if successfull.

Public function enumFilters(flags: uint = 0): MMRESULT;

Enumerates waveform-audio filters available from the ACM driver. Enumerated filters will be stored in the filters list. You can access them using getFilter() method.

Public function enumFormats(flags: uint = 0; force: bool = false; pwfx: pWAVEFORMATEX = nil; tagsOnly: bool = false): MMRESULT;

Enumerates waveform-audio formats available from the ACM driver. You can specify any combination of the following values for flags parameter:

  • (ACM_FORMATENUMF_HARDWARE - The enumerator should only enumerate formats that are supported as native input or output formats on one or more of the installed waveform-audio devices)

  • (ACM_FORMATENUMF_INPUT - Enumerator should enumerate only formats that are supported for input (recording))

  • (ACM_FORMATENUMF_NCHANNELS - The nChannels member of the WAVEFORMATEX structure pointed to by the pwfx parameter is valid. The enumerator will enumerate only a format that conforms to this attribute)

  • (ACM_FORMATENUMF_NSAMPLESPERSEC - The nSamplesPerSec member of the WAVEFORMATEX structure pointed to by the pwfx parameter is valid. The enumerator will enumerate only a format that conforms to this attribute)

  • (ACM_FORMATENUMF_OUTPUT - Enumerator should enumerate only formats that are supported for output (playback))

  • (ACM_FORMATENUMF_WBITSPERSAMPLE - The wBitsPerSample member of the WAVEFORMATEX structure pointed to by the pwfx parameter is valid. The enumerator will enumerate only a format that conforms to this attribute)

  • (ACM_FORMATENUMF_WFORMATTAG - This is default flag, and you should use it in most cases)

Enumerated formats will be stored in the formats list. You can access them using getFormat() method.

Public function getDetails(): pACMDRIVERDETAILSW;

Returns driver details.

Public function getFilter(index: unsigned): unaMsAcmFilter;

Returns wave filter object by its index in filter list.

Public function getFilterCount(): unsigned;

Returns number of filters stored in filter list.

Public function getFormat(index: unsigned): unaMsAcmFormat;

Returns wave format object by its index in format list.

Public function getFormatCount(): unsigned;

Returns number of formats stored in format list.

Public function getFormatTag(index: unsigned): unaMsAcmFormatTag;
 
Public function getFormatTagCount(): unsigned;
 
Public function getHandle(): HACMDRIVER;

Returns driver handle returned by acmDriverOpen() function

Public function getPriority(): unsigned;

Returns ACM priority of the driver.

Public function isEnabled(): bool;

Returns true if driver is enabled.

Public function isOpen(): bool;

Returns true if driver was successfully opened or false otherwise.

Returns

True if driver is opened.

Public function open(): MMRESULT;

Opens the ACM driver. Installabe drivers need not to be opened.

Returns

MMSYSERR_NOERROR if successfull.

Public function preparePafd(var pafd: ACMFORMATDETAILS; tag: unsigned = 0; index: unsigned = 0): bool;

Calls the master acm class to fill the given ACMFORMATDETAILS structure.

Public function sendDriverMessage(msg: UINT; lParam1: LongInt; lParam2: Longint = 0): Longint;

Sends a message to installed or opened driver.

Public function suggestCodecFormat(srcFormat: pWAVEFORMATEX; dstFormat: pWAVEFORMATEX; flags: uint): MMRESULT;

Queries the ACM driver to suggest a destination format for the supplied source format. srcFormat is a WAVEFORMATEX structure that identifies the source format for which a destination format will be suggested by the driver. dstFormat is a WAVEFORMATEX structure that will receive the suggested destination format for the srcFormat format. Depending on the flags parameter, some members of the structure pointed to by dstFormat may require initialization. The following values are defined for flags parameter:

  • (ACM_FORMATSUGGESTF_NCHANNELS - The nChannels member of the structure pointed to by dstFormat is valid. The ACM will query the driver if it can suggest a destination format matching nChannels or fail)

  • (ACM_FORMATSUGGESTF_NSAMPLESPERSEC - The nSamplesPerSec member of the structure pointed to by dstFormat is valid. The ACM will query acceptable the driver if it can suggest a destination format matching nSamplesPerSec or fail)

  • (ACM_FORMATSUGGESTF_WBITSPERSAMPLE - The wBitsPerSample member of the structure pointed to by dstFormat is valid. The ACM will query acceptable the driver if it can suggest a destination format matching wBitsPerSample or fail)

  • (ACM_FORMATSUGGESTF_WFORMATTAG - The wFormatTag member of the structure pointed to by dstFormat is valid. The ACM will query the driver if it can suggest a destination format matching wFormatTag or fail)

Returns

MMSYSERR_NOERROR if successful or an error code otherwise.

Protected function isMyLib(const libName: wString): bool;
 
Protected function refInc(delta: int): int;
 
Public procedure AfterConstruction(); override;
 
Public procedure BeforeDestruction(); override;
 
Public procedure setEnabled(value: bool);

Enables of disables the driver.

Public procedure setPriority(value: unsigned);

Sets ACM priority of the driver.

Properties

Public property acm: unaMsAcm read f_acm;

unaMsAcm class instance.

Public property id: HACMDRIVERID read f_id;

id of the driver.

Public property isInstallable: bool read f_isInstallable;

Read-only property which indicates whether the driver was created as installable.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09