Home Units Hierarchy Routines All identifiers

Class unaWaveDevice

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaWaveDevice = class(unaMsAcmStreamDevice)

Description

This abstract class is used as base for unaWaveInDevice (recorder) and unaWaveOutDevice (playback) devices.

Since both In and Out devices are working with PCM streams only, we can simplify the process of specifying wave formats. Instead of tag/index pair setSampling() method takes three parameters: samples per second, bits per sample and number of channels. Commonly used values for samples per second are 8,000; 11,025; 22,050 and 44,100. Bits per sample could be 8 or 16 or more. Number of channels is usually 1 (mono) or 2 (stereo).

Hierarchy

Overview

Methods

Public constructor create(deviceID: uint = WAVE_MAPPER; mapped: bool = false; direct: bool = false; isIn: bool = true; overNum: unsigned = 0);
Public function setSampling(pcmFormat: pWAVEFORMATEX): bool; overload;
Public function setSampling(samplesPerSec: unsigned = c_defSamplingSamplesPerSec; bitsPerSample: unsigned = c_defSamplingBitsPerSample; numChannels: unsigned = c_defSamplingNumChannels): bool; overload;
Public function setSampling(const pcmFormat: unaPCMFormat): bool; overload;
Public function setSamplingExt(isSrc: bool; format: PWAVEFORMATEXTENSIBLE): bool;
Protected function addHeader(header: unaWaveHeader): MMRESULT; virtual; abstract;
Protected function close2(timeout: tTimeout = 10014): MMRESULT; override;
Protected function execute(globalIndex: unsigned): int; override;
Protected function onHeaderDone(header: unaWaveHeader; wakeUpByHeaderDone: bool): bool; virtual;
Protected function open2(query: bool = false; timeout: tTimeout = 10004; flags: uint = 0; startDevice: bool = true): MMRESULT; override;
Public procedure BeforeDestruction(); override;
Public procedure shareASIOwith(device: unaWaveDevice);
Protected procedure removeHeader(var header: pointer); override;

Properties

Public property deviceId: uint read f_deviceId write setDeviceId;
Public property direct: bool read f_direct write f_direct;
Public property mapped: bool read f_mapped write f_mapped;
Public property waveEngine: unaVCWaveEngine read f_waveEngine write setWaveEngine;

Description

Methods

Public constructor create(deviceID: uint = WAVE_MAPPER; mapped: bool = false; direct: bool = false; isIn: bool = true; overNum: unsigned = 0);

Parameters
mapped
- The deviceID parameter specifies a waveform-audio device to be mapped to by the wave mapper.
direct
- If this flag is specified, the ACM driver does not perform conversions on the audio data.
Public function setSampling(pcmFormat: pWAVEFORMATEX): bool; overload;

Since most wave devices supports PCM formats only it is handy to have this method.

Public function setSampling(samplesPerSec: unsigned = c_defSamplingSamplesPerSec; bitsPerSample: unsigned = c_defSamplingBitsPerSample; numChannels: unsigned = c_defSamplingNumChannels): bool; overload;

Since most wave devices supports PCM formats only it is handy to have this method.

Public function setSampling(const pcmFormat: unaPCMFormat): bool; overload;

Since most wave devices supports PCM formats only it is handy to have this method.

Public function setSamplingExt(isSrc: bool; format: PWAVEFORMATEXTENSIBLE): bool;

Since most wave devices supports PCM formats only it is handy to have this method.

Protected function addHeader(header: unaWaveHeader): MMRESULT; virtual; abstract;
 
Protected function close2(timeout: tTimeout = 10014): MMRESULT; override;
 
Protected function execute(globalIndex: unsigned): int; override;
 
Protected function onHeaderDone(header: unaWaveHeader; wakeUpByHeaderDone: bool): bool; virtual;
 
Protected function open2(query: bool = false; timeout: tTimeout = 10004; flags: uint = 0; startDevice: bool = true): MMRESULT; override;
 
Public procedure BeforeDestruction(); override;
 
Public procedure shareASIOwith(device: unaWaveDevice);

Share ASIO driver with specified device. When ASIO is shared, no new ASIO driver will be initialized.

Parameters
device
Wave device to share ASIO driver with. If nil, old share will be removed (if any).
Protected procedure removeHeader(var header: pointer); override;
 

Properties

Public property deviceId: uint read f_deviceId write setDeviceId;

Device Id.

Public property direct: bool read f_direct write f_direct;

If this flag is specified, the ACM driver does not perform conversions on the audio data.

Public property mapped: bool read f_mapped write f_mapped;

The deviceID parameter specifies a waveform-audio device to be mapped to by the wave mapper.

Public property waveEngine: unaVCWaveEngine read f_waveEngine write setWaveEngine;

MME, ASIO or DS

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09