Description | Hierarchy | Fields | Methods | Properties |
type unavclInOutWavePipe = class(unavclInOutPipe)
Base abstract class for wave devices.
constructor Create(AOwner: TComponent); override; |
|
function getLogVolume(channel: uint = $FFFFFFFF): unsigned; |
|
function getUnVolume(channel: uint = $FFFFFFFF): unsigned; |
|
function getVolume(channel: uint = $FFFFFFFF): unsigned; |
|
function applyDeviceFormat(format: PWAVEFORMATEXTENSIBLE; isSrc: bool = true): bool; virtual; |
|
function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; override; |
|
function doAddConsumer(consumer: unavclInOutPipe; forceNewFormat: bool = true): bool; override; |
|
function doAddProvider(provider: unavclInOutPipe): bool; override; |
|
function doGetPosition(): int64; override; |
|
function doOpen(): bool; override; |
|
function doRead(data: pointer; len: uint): uint; override; |
|
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override; |
|
function getAvailableDataLen(index: integer): uint; override; |
|
function getChunkSize(): uint; virtual; |
|
function getDstChunkSize(): uint; virtual; |
|
function getFormatExchangeData(out data: pointer): uint; override; |
|
function isActive(): bool; override; |
|
procedure AfterConstruction(); override; |
|
procedure BeforeDestruction(); override; |
|
procedure createDevice(); |
|
procedure createDriver(); |
|
procedure ensureFormat(); |
|
procedure flush(); |
|
procedure setVolume100(volume: unsigned = 100; channel: int = -1); |
|
procedure shareASIOwith(pipe: unavclInOutWavePipe); |
|
procedure createNewDevice(); virtual; |
|
procedure destroyOldDevice(); virtual; |
|
procedure doAcmReq(req: uint; var acm: unaMsAcm); virtual; |
|
procedure doClose(); override; |
|
procedure doRemoveProvider(provider: unavclInOutPipe); override; |
|
procedure doSetAddSilence(value: boolean); virtual; |
|
procedure doSetDeviceId(value: int); virtual; |
|
procedure doSetDriver(value: unaMsAcmDriver); virtual; |
|
procedure doSetDriverLibrary(const value: wString); virtual; |
|
procedure doSetDriverMode(value: unaAcmCodecDriverMode); virtual; |
|
procedure doSetFormat(value: PWAVEFORMATEXTENSIBLE); virtual; |
|
procedure doSetFormatTag(value: unsigned); virtual; |
|
procedure doSetLoop(value: boolean); virtual; |
|
procedure doSetSamplingParam(index: int; value: unsigned); virtual; |
|
procedure initWaveParams(); virtual; |
|
procedure Loaded(); override; |
|
procedure onDriverChanged(); virtual; |
property acm2: unaMsAcm read f_acm2; |
|
property addSilence: boolean read f_addSilence write setAddSilence default false; |
|
property calcVolume: boolean read f_calcVolume write setCalcVolume default false; |
|
property channelConsumeMask: int read f_channelConsumeMask write setChannelConsumeMask default -1; |
|
property channelMixMask: int read f_channelMixMask write setChannelMixMask default -1; |
|
property chunkSize: uint read getChunkSize; |
|
property device: unaMsAcmStreamDevice read f_device; |
|
property deviceId: int read f_deviceId write setDeviceId; |
|
property deviceWasCreated: bool read f_deviceWasCreated; |
|
property direct: bool read f_direct write setDirect default false; |
|
property driver: unaMsAcmDriver read f_driver write setDriver; |
|
property driverLibrary: wString read f_driverLibrary write setDriverLibrary; |
|
property driverMode: unaAcmCodecDriverMode read f_driverMode write setDriverMode default unacdm_acm; |
|
property dstChunkSize: uint read getDstChunkSize; |
|
property enableDataProxy; |
|
property formatTag: unsigned read f_formatTag write setFormatTag default WAVE_FORMAT_PCM; |
|
property formatTagImmunable: boolean read f_applyFormatTagImmunable write f_applyFormatTagImmunable default false; |
|
property inputIsPcm: boolean read f_inputIsPcm write setInputIsPcm default true; |
|
property isFormatProvider; |
|
property loop: boolean read f_loop write setLoop default false; |
|
property mapped: bool read f_mapped write setMapped default false; |
|
property minActiveTime: unsigned read getMinActiveTime write setMinActiveTime default 0; |
|
property minVolumeLevel: unsigned read getMinVolLevel write setMinVolLevel default 0; |
|
property onAcmReq: tunaOnAcmReq read f_onAcmReq write f_onAcmReq; |
|
property onDataAvailable; |
|
property onDataDSP; |
|
property onFormatChangeAfter; |
|
property onFormatChangeBefore; |
|
property onThreshold: unaWaveOnThresholdEvent read f_onThreshold write setOnThreshold; |
|
property overNum: unsigned read f_overNum write setOverNum default defOverNumValue; |
|
property pcmFormatExt: PWAVEFORMATEXTENSIBLE read f_formatExt write setFormat; |
|
property pcm_bitsPerSample: unsigned index 1 read getSamplingParam write setSamplingParam default c_defSamplingBitsPerSample; |
|
property pcm_channelMask: unsigned index 3 read getSamplingParam write setSamplingParam default c_defSamplingChannelMask; |
|
property pcm_numChannels: unsigned index 2 read getSamplingParam write setSamplingParam default c_defSamplingNumChannels; |
|
property pcm_samplesPerSec: unsigned index 0 read getSamplingParam write setSamplingParam default c_defSamplingSamplesPerSec; |
|
property realTime: boolean read f_realTime write setRealTime default false; |
|
property silenceDetectionMode: unaWaveInSDMethods read f_sdmCache write setSdm default unasdm_none; |
|
property startDeviceOnOpen: bool read f_sdo write f_sdo default true; |
|
property waveEngine: unaVCWaveEngine read f_waveEngine write setWaveEngine default unavcwe_MME; |
|
property waveError: int read f_waveError; |
|
property waveErrorAsString: string read getWaveErrorAsString; |
constructor Create(AOwner: TComponent); override; |
|
function getLogVolume(channel: uint = $FFFFFFFF): unsigned; |
|
Returns current volume of audio signal passing "through" wave device. Returned volume range from 0 (silence) to 100. Scale is logarithmic. Use getVolume() method to get volume in linear scale. Parameters
|
function getUnVolume(channel: uint = $FFFFFFFF): unsigned; |
|
Returns unchenaged volume of audio signal passing "through" wave device. Returned volume range from 0 (silence) to 32768. Scale is linear. Use getLogVolume() method to get volume in logarithmic scale. Parameters
|
function getVolume(channel: uint = $FFFFFFFF): unsigned; |
|
Returns current volume of audio signal passing "through" wave device. Returned volume range from 0 (silence) to 32768. Scale is linear. Use getLogVolume() method to get volume in logarithmic scale. Parameters
|
function applyDeviceFormat(format: PWAVEFORMATEXTENSIBLE; isSrc: bool = true): bool; virtual; |
|
Applies new data stream format for the wave device. This implementation assumes device is descendand from unaWaveDevice.
Parameters
ReturnsTrue if successfull. |
function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; override; |
|
Applies new data stream format on the device. First, it closes the device. Next, is assigns driverMode and driverLibrary properties. If formatTagImmunable property is False, a new format tag will be assigned. New format will be stored in pcmFormatExt. Finally, applyDeviceFormat() will be called. If device was not re-opened, it also calls checkIfFormatProvider().
Parameters
ReturnsTrue if successfull. |
function doAddConsumer(consumer: unavclInOutPipe; forceNewFormat: bool = true): bool; override; |
|
Adds consumer to the wave device. |
function doAddProvider(provider: unavclInOutPipe): bool; override; |
|
Adds provider to the wave device. |
function doGetPosition(): int64; override; |
|
Returns current position in device. ReturnsCurrent position in data stream (if applicable). |
function doOpen(): bool; override; |
|
Creates and opens the wave device. ReturnsTrue if successfull. |
function doRead(data: pointer; len: uint): uint; override; |
|
Reads data from the wave device. ReturnsNumber of bytes read from device. |
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; override; |
|
If enableDataProcessing is True, writes data into the wave device using its write() method. Otherwise passes data to onNewData() method (thus removing the component from data chain). Does nothing if device is nil.
Parameters
ReturnsNumber of bytes passed to device. |
function getAvailableDataLen(index: integer): uint; override; |
|
Returns available data size. ReturnsData size available to read from the wave device. |
function getChunkSize(): uint; virtual; |
|
Returns chunk size (in bytes). ReturnsSize of input data chunk in bytes. |
function getDstChunkSize(): uint; virtual; |
|
Some devices (like codecs) may have different sife of input and output chunks. ReturnsSize of output data chunk in bytes. |
function getFormatExchangeData(out data: pointer): uint; override; |
|
Fills format exchange data of the pipe stream.
Parameters
ReturnsSize in bytes of data buffer. |
function isActive(): bool; override; |
|
Returns active state of the component. ReturnsTrue if wave device was open successfully. |
procedure AfterConstruction(); override; |
|
Creates the wave device and assigns default values for properties. |
procedure BeforeDestruction(); override; |
|
Destroys the wave device. |
procedure createDevice(); |
|
Destroys previuosly created wave device, then creates new one. Assigns required callbacks for device. |
procedure createDriver(); |
|
Creates ACM or openH323plugin driver for device (if needed). |
procedure ensureFormat(); |
|
Refreshes the device format. |
procedure flush(); |
|
Flushes any data panding. |
procedure setVolume100(volume: unsigned = 100; channel: int = -1); |
|
Changes the volume of specified channel.
Parameters
|
procedure shareASIOwith(pipe: unavclInOutWavePipe); |
|
Share ASIO driver with other device. |
procedure createNewDevice(); virtual; |
|
Does all the job of device creation. Should be overriten with actual implementation. Should not be called directly. |
procedure destroyOldDevice(); virtual; |
|
Called when new device is about to be created. |
procedure doAcmReq(req: uint; var acm: unaMsAcm); virtual; |
|
ACM reqest. Used mostly to disable default ACM enumeration. |
procedure doClose(); override; |
|
Closes the wave device. |
procedure doRemoveProvider(provider: unavclInOutPipe); override; |
|
Removes provider from the wave device. |
procedure doSetAddSilence(value: boolean); virtual; |
|
procedure doSetDeviceId(value: int); virtual; |
|
Sets new device ID and re-creates device object if needed. Parameters
|
procedure doSetDriver(value: unaMsAcmDriver); virtual; |
|
procedure doSetDriverLibrary(const value: wString); virtual; |
|
procedure doSetDriverMode(value: unaAcmCodecDriverMode); virtual; |
|
procedure doSetFormat(value: PWAVEFORMATEXTENSIBLE); virtual; |
|
procedure doSetFormatTag(value: unsigned); virtual; |
|
Sets new format tag and re-creates device and driver objects if needed. Parameters
|
procedure doSetLoop(value: boolean); virtual; |
|
procedure doSetSamplingParam(index: int; value: unsigned); virtual; |
|
procedure initWaveParams(); virtual; |
|
procedure Loaded(); override; |
|
Initializes the wave device. |
procedure onDriverChanged(); virtual; |
|
Triggers when device driver has been changed. |
property acm2: unaMsAcm read f_acm2; |
|
ACM manager for the device (if any). |
property addSilence: boolean read f_addSilence write setAddSilence default false; |
|
Specifies whether device should add silence when it runs out of audio data. |
property calcVolume: boolean read f_calcVolume write setCalcVolume default false; |
|
When True tells the component to calculate audio volume of a data stream coming into or from the component. Use the getVolume() method to get the current volume level. This property must be also set to True if silenceDetectionMode is set to unasdm_VC. |
property channelConsumeMask: int read f_channelConsumeMask write setChannelConsumeMask default -1; |
|
Which channels to consume. |
property channelMixMask: int read f_channelMixMask write setChannelMixMask default -1; |
|
When -1 (default) all channels are included in output stream When >= 0, only one specified channel is included |
property chunkSize: uint read getChunkSize; |
|
Input chunk size. |
property device: unaMsAcmStreamDevice read f_device; |
|
Wave device associated with the pipe. |
property deviceId: int read f_deviceId write setDeviceId; |
|
Specifies device ID for the wave device. Ranges from 0 to number of wave devices - 1. Default value is WAVE_MAPPER, which forces the component to use default device assigned in Control Panel. |
property deviceWasCreated: bool read f_deviceWasCreated; |
|
Internal. |
property direct: bool read f_direct write setDirect default false; |
|
Specifies whether wave device is direct (obsolete). |
property driver: unaMsAcmDriver read f_driver write setDriver; |
|
Device driver. |
property driverLibrary: wString read f_driverLibrary write setDriverLibrary; |
|
Specifies driver library for device. |
property driverMode: unaAcmCodecDriverMode read f_driverMode write setDriverMode default unacdm_acm; |
|
Specifies driver mode for device. |
property dstChunkSize: uint read getDstChunkSize; |
|
Output chunk size. |
property enableDataProxy; |
|
property formatTag: unsigned read f_formatTag write setFormatTag default WAVE_FORMAT_PCM; |
|
Specifies audio format tag for the wave device. |
property formatTagImmunable: boolean read f_applyFormatTagImmunable write f_applyFormatTagImmunable default false; |
|
Specifies the device is immunable for format tag changes (usually useful for codecs). |
property inputIsPcm: boolean read f_inputIsPcm write setInputIsPcm default true; |
|
Specifies whether format of input stream of the device is PCM. |
property isFormatProvider; |
|
property loop: boolean read f_loop write setLoop default false; |
|
Specifies whether wave stream should be looped from end to beginning. |
property mapped: bool read f_mapped write setMapped default false; |
|
Specifies whether wave device is mapped (obsolete). |
property minActiveTime: unsigned read getMinActiveTime write setMinActiveTime default 0; |
|
Minimum active time for recording. |
property minVolumeLevel: unsigned read getMinVolLevel write setMinVolLevel default 0; |
|
Minimum volume level for recording. |
property onAcmReq: tunaOnAcmReq read f_onAcmReq write f_onAcmReq; |
|
Specifies whether device should not utilize ACM |
property onDataAvailable; |
|
property onDataDSP; |
|
property onFormatChangeAfter; |
|
property onFormatChangeBefore; |
|
property onThreshold: unaWaveOnThresholdEvent read f_onThreshold write setOnThreshold; |
|
Fired when current level of signal has crossed the "silence" mark. |
property overNum: unsigned read f_overNum write setOverNum default defOverNumValue; |
|
Specifies how many chunks of data (every chunk can hold 1/50 second of audio) component can store in the input or output buffer, if data cannot be processed immediately. Set this property to 0 to disable the buffer overflow checking (this could lead to uncontrolled memory usage grow). |
property pcmFormatExt: PWAVEFORMATEXTENSIBLE read f_formatExt write setFormat; |
|
PCM format of the wave device. |
property pcm_bitsPerSample: unsigned index 1 read getSamplingParam write setSamplingParam default c_defSamplingBitsPerSample; |
|
Specifies number of bits per sample for wave device. Common values are 8 and 16. |
property pcm_channelMask: unsigned index 3 read getSamplingParam write setSamplingParam default c_defSamplingChannelMask; |
|
Specifies channel mask for multi-channel data streams. |
property pcm_numChannels: unsigned index 2 read getSamplingParam write setSamplingParam default c_defSamplingNumChannels; |
|
Specifies number of channels per sample for wave device. Common values are 1 (mono) and 2 (stereo). |
property pcm_samplesPerSec: unsigned index 0 read getSamplingParam write setSamplingParam default c_defSamplingSamplesPerSec; |
|
Specifies number of samples per second for wave device. Common values are 44100, 22050, 11025 and 8000. |
property realTime: boolean read f_realTime write setRealTime default false; |
|
Specifies whether device is working in real-time manner. |
property silenceDetectionMode: unaWaveInSDMethods read f_sdmCache write setSdm default unasdm_none; |
|
Specifies which method will be used to detect silence. minActiveTime and minVolumeLevel properties control the silence detection behavior for unasdm_VC. |
property startDeviceOnOpen: bool read f_sdo write f_sdo default true; |
|
Specifies whether device should be "started" after open. Default is True. Mostly used with codecs, if data processing is done from one main thread rather than seperate codec threads. |
property waveEngine: unaVCWaveEngine read f_waveEngine write setWaveEngine default unavcwe_MME; |
|
MME, ASIO or DS |
property waveError: int read f_waveError; |
|
Last wave error. |
property waveErrorAsString: string read getWaveErrorAsString; |
|
Last wave error as string. |
(c) 2012 Lake of Soft