Description | Hierarchy | Fields | Methods | Properties |
type unavclInOutPipe = class(tComponent)
Base abstract class for all components.
function addConsumer(consumer: unavclInOutPipe; forceNewFormat: bool = true): bool; |
|
function addProvider(provider: unavclInOutPipe): bool; |
|
function enter(ro: bool; timeout: tTimeout = 100): bool; |
|
function getConsumerIndex(value: unavclInOutPipe): int; |
|
function getPosition(): int64; |
|
function getProviderIndex(value: unavclInOutPipe): int; |
|
function open(provider: unavclInOutPipe = nil): bool; |
|
function read(): aString; overload; |
|
function read(data: pointer; len: uint): uint; overload; |
|
function write(const data: aString; provider: unavclInOutPipe = nil): uint; overload; |
|
function write(data: pointer; len: uint; provider: unavclInOutPipe = nil): uint; overload; |
|
function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; virtual; |
|
function checkIfAutoActivate(value: bool; timeout: tTimeout = 10054): bool; |
|
function checkIfFormatProvider(restoreActiveState: bool): bool; |
|
function doAddConsumer(consumer: unavclInOutPipe; forceNewFormat: bool = true): bool; virtual; |
|
function doAddProvider(provider: unavclInOutPipe): bool; virtual; |
|
function doGetPosition(): int64; virtual; |
|
function doOpen(): bool; virtual; |
|
function doRead(data: pointer; len: uint): uint; virtual; abstract; |
|
function doSetActive(value: bool; timeout: tTimeout = 3000; provider: unavclInOutPipe = nil): bool; |
|
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; virtual; abstract; |
|
function getAvailableDataLen(index: integer): uint; virtual; abstract; |
|
function getFormatExchangeData(out data: pointer): uint; virtual; |
|
function incInOutBytes(index: int; isIn: bool; delta: int): int64; |
|
function isActive(): bool; virtual; abstract; |
|
function onNewData(data: pointer; len: uint; provider: pointer = nil): bool; virtual; |
|
procedure AfterConstruction(); override; |
|
procedure BeforeDestruction(); override; |
|
procedure clearFormatCRC(); |
|
procedure close(timeout: tTimeout = 0; provider: unavclInOutPipe = nil); |
|
procedure leaveRO(); |
|
procedure leaveWO(); |
|
procedure removeConsumer(consumer: unavclInOutPipe); |
|
procedure removeProvider(provider: unavclInOutPipe); |
|
procedure doBeforeAfterFC(doBefore: bool; provider: unavclInOutPipe; data: pointer; len: uint; out allowFC: bool); |
|
procedure doClose(); virtual; |
|
procedure doRemoveConsumer(consumer: unavclInOutPipe); virtual; |
|
procedure doRemoveProvider(provider: unavclInOutPipe); virtual; |
|
procedure doSetEnableDP(value: boolean); virtual; |
|
procedure Loaded(); override; |
|
procedure Notification(component: tComponent; operation: tOperation); override; |
|
procedure notifyConsumers(); |
|
procedure notifyProviders(value: unavclInOutPipe); |
property active: boolean read getActive write setActive default false; |
|
property autoActivate: boolean read f_autoActivate write f_autoActivate default true; |
|
property availableDataLenIn: uint index 0 read getAvailableDataLen; |
|
property availableDataLenOut: uint index 1 read getAvailableDataLen; |
|
property closing: bool read f_closing write f_closing; |
|
property consumer: unavclInOutPipe read getConsumerOneAndOnly write setConsumerOneAndOnly; |
|
property consumerCount: int read getConsumerCount; |
|
property consumers[index:int]: unavclInOutPipe read getConsumer; |
|
property dumpInput: wideString read f_dumpInput write f_dumpInput; |
|
property dumpOutput: wideString read f_dumpOutput write f_dumpOutput; |
|
property enableDataProcessing: boolean read f_enableDP write setEnableDP default True; |
|
property enableDataProxy: boolean read f_enableDataProxy write f_enableDataProxy default false; |
|
property ignoreProviderOptions: unsigned read f_ipo write f_ipo; |
|
property inBytes[index:int]: int64 read getInBytes; |
|
property isFormatProvider: boolean read f_isFormatProvider write f_isFormatProvider default false; |
|
property onDataAvailable: unavclPipeDataEvent read f_dataAvail write f_dataAvail; |
|
property onDataDSP: unavclPipeDataEvent read f_dataDSP write f_dataDSP; |
|
property onFormatChangeAfter: unavclPipeAfterFormatChangeEvent read f_afterFormatChange write f_afterFormatChange; |
|
property onFormatChangeBefore: unavclPipeBeforeFormatChangeEvent read f_beforeFormatChange write f_beforeFormatChange; |
|
property opt: unsigned read f_opt; |
|
property outBytes[index:int]: int64 read getOutBytes; |
|
property position: int64 read getPosition; |
|
property providerCount: int read getProviderCount; |
|
property providerOneAndOnly: unavclInOutPipe read getProviderOneAndOnly; |
|
property providers[index:int]: unavclInOutPipe read getProvider; |
|
property _consumers: unaObjectList read f_consumers; |
|
property _providers: unaObjectList read f_providers; |
function addConsumer(consumer: unavclInOutPipe; forceNewFormat: bool = true): bool; |
|
Adds new consumer for the pipe.
Parameters
ReturnsTrue if successfull. |
function addProvider(provider: unavclInOutPipe): bool; |
|
Adds new provider for the pipe.
Parameters
ReturnsTrue if successfull. |
function enter(ro: bool; timeout: tTimeout = 100): bool; |
|
Enters the internal critical section.
Parameters
ReturnsTrue if critical section was entered. |
function getConsumerIndex(value: unavclInOutPipe): int; |
|
Returns index of consumer. Returnsindex of specified consumer. |
function getPosition(): int64; |
|
Returns position in stream. ReturnsCurrent position in stream (if applicable). |
function getProviderIndex(value: unavclInOutPipe): int; |
|
Returns index of provider. Returnsindex of specified provider. |
function open(provider: unavclInOutPipe = nil): bool; |
|
Opens the pipe. ReturnsTrue if successfull. |
function read(): aString; overload; |
|
Reads data as a AnsiString. ReturnsData read. |
function read(data: pointer; len: uint): uint; overload; |
|
If you did not specify the consumer for the pipe, you must call this method periodically to access the stream output data. Best place to do that is in onDataAvailable() event handler. ReturnsNumber of bytes actually read. |
function write(const data: aString; provider: unavclInOutPipe = nil): uint; overload; |
|
Writes data into the pipe.
Parameters
ReturnsNumber of bytes actually written. |
function write(data: pointer; len: uint; provider: unavclInOutPipe = nil): uint; overload; |
|
Writes data into the pipe.
Parameters
ReturnsNumber of bytes actually written. |
function applyFormat(data: pointer; len: uint; provider: unavclInOutPipe = nil; restoreActiveState: bool = false): bool; virtual; |
|
Applies new format of the data stream. ReturnsTrue if successfull. |
function checkIfAutoActivate(value: bool; timeout: tTimeout = 10054): bool; |
|
Checks if autoActivate property is True and activates/deactivates consumers if yes. |
function checkIfFormatProvider(restoreActiveState: bool): bool; |
|
Checks if component is format provider and applies format to consumer if it is (and format was not applied before). |
function doAddConsumer(consumer: unavclInOutPipe; forceNewFormat: bool = true): bool; virtual; |
|
Adds new consumer for the pipe. ReturnsTrue if successfull. |
function doAddProvider(provider: unavclInOutPipe): bool; virtual; |
|
Assigns new provider for the pipe. Not all components are designed to work with more that one provider. ReturnsTrue if successfull. |
function doGetPosition(): int64; virtual; |
|
Implements positions retrieval routine. ReturnsCurrent position in stream (if applicable). |
function doOpen(): bool; virtual; |
|
Opens the pipe. |
function doRead(data: pointer; len: uint): uint; virtual; abstract; |
|
Reads data from the pipe. |
function doSetActive(value: bool; timeout: tTimeout = 3000; provider: unavclInOutPipe = nil): bool; |
|
Sets active state of the pipe. |
function doWrite(data: pointer; len: uint; provider: pointer = nil): uint; virtual; abstract; |
|
Writes data into the pipe. |
function getAvailableDataLen(index: integer): uint; virtual; abstract; |
|
Returns data size available in the pipe (bytes). |
function getFormatExchangeData(out data: pointer): uint; virtual; |
|
Fills the format of the data stream. ReturnsStream data format. |
function incInOutBytes(index: int; isIn: bool; delta: int): int64; |
|
Increments (or decrements) in/outBytes property by delta.
Parameters
ReturnsNew value of in/outBytes |
function isActive(): bool; virtual; abstract; |
|
Returns component's active state. ReturnsTrue if component was activated succesfully. |
function onNewData(data: pointer; len: uint; provider: pointer = nil): bool; virtual; |
|
Processes new data available from the pipe. ReturnsTrue if successfull. |
procedure AfterConstruction(); override; |
|
Creates list of consumers and providers, internal critical section and data proxy thread. |
procedure BeforeDestruction(); override; |
|
Destroys the pipe. |
procedure clearFormatCRC(); |
|
Forces component to assign its format to consumers (if isFormatProvider is True). Call this method before activation. |
procedure close(timeout: tTimeout = 0; provider: unavclInOutPipe = nil); |
|
Closes the pipe. |
procedure leaveRO(); |
|
Leaves the internal critical section. |
procedure leaveWO(); |
|
procedure removeConsumer(consumer: unavclInOutPipe); |
|
Removes consumer from the pipe. |
procedure removeProvider(provider: unavclInOutPipe); |
|
Removes one of pipe's providers. Parameters
|
procedure doBeforeAfterFC(doBefore: bool; provider: unavclInOutPipe; data: pointer; len: uint; out allowFC: bool); |
|
Calls f_beforeFormatChange or f_afterFormatChange if assigned. |
procedure doClose(); virtual; |
|
Closes the pipe. |
procedure doRemoveConsumer(consumer: unavclInOutPipe); virtual; |
|
Removes consumer from the pipe. |
procedure doRemoveProvider(provider: unavclInOutPipe); virtual; |
|
Removes one of pipe's providers. |
procedure doSetEnableDP(value: boolean); virtual; |
|
Sets enableDataProcessing value. |
procedure Loaded(); override; |
|
Usually creates an internal device of the pipe, and activates the component if needed. |
procedure Notification(component: tComponent; operation: tOperation); override; |
|
IDE/VCL notification for components removal/insertion. |
procedure notifyConsumers(); |
|
Notify all consumers there is no more such provider (self). |
procedure notifyProviders(value: unavclInOutPipe); |
|
Notify all providers there is new consumer (self), or consumer is removed (value = nil). |
property active: boolean read getActive write setActive default false; |
|
Returns or sets the active state of the pipe. Set to True to activate (open) the component. All other properties should be set to proper values before activation. Set to False to deactivate (close) the component. |
property autoActivate: boolean read f_autoActivate write f_autoActivate default true; |
|
When True tells the component it must activate consumer (if any) before activating itself. Same applies for deactivation. When |
property availableDataLenIn: uint index 0 read getAvailableDataLen; |
|
Returns data written into but not yet processed by the pipe. |
property availableDataLenOut: uint index 1 read getAvailableDataLen; |
|
Returns data size available to read from the pipe. |
property closing: bool read f_closing write f_closing; |
|
True if component is being closed. |
property consumer: unavclInOutPipe read getConsumerOneAndOnly write setConsumerOneAndOnly; |
|
Specifies the consumer of component. When set, specified consumer will receive all the stream data from the component. This allows linking the components to create a data flow chain. |
property consumerCount: int read getConsumerCount; |
|
Number of consumers. |
property consumers[index:int]: unavclInOutPipe read getConsumer; |
|
Returns consumer. @param index Index of consumer (from 0 to consumerCount - 1). @return Consumer of a pipe. |
property dumpInput: wideString read f_dumpInput write f_dumpInput; |
|
Specifies the file name to store the stream into. dumpInput is be used to store the input stream, which is coming as input for component. Stream will be saved in "as is" format. For example, will store input stream as a sequence of PCM samples. |
property dumpOutput: wideString read f_dumpOutput write f_dumpOutput; |
|
Specifies the file name to store the stream into. dumpOutput is be used to store the output stream, which is coming as output from the component. Stream will be saved in "as is" format. For example, will store output stream as sequence of PCM samples. |
property enableDataProcessing: boolean read f_enableDP write setEnableDP default True; |
|
Specifies whether the component would perform any data processing. |
property enableDataProxy: boolean read f_enableDataProxy write f_enableDataProxy default false; |
|
Data will be placed to proxy thread before processing. This allows component to return from the write() method as soon as possible. |
property ignoreProviderOptions: unsigned read f_ipo write f_ipo; |
|
Specifies which proviers options will be ignored. |
property inBytes[index:int]: int64 read getInBytes; |
|
Number of bytes received by the pipe. @param index 0 - received from providers; 1 - received from network |
property isFormatProvider: boolean read f_isFormatProvider write f_isFormatProvider default false; |
|
When True the component will assign stream format to the consumer (if any). This simplifies the process of distributing stream format among linked components. For example component can assign PCM format for linked unavclWaveOutDevice component, so WAVe file will be played back correctly. |
property onDataAvailable: unavclPipeDataEvent read f_dataAvail write f_dataAvail; |
|
This event is fired every time component has produced or received new chunk of data. Use this event to access the raw stream data. Any modifications you made with data will not affect data consumers. To modify data before it will passed to consumers, use onDataDSP() event. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event |
property onDataDSP: unavclPipeDataEvent read f_dataDSP write f_dataDSP; |
|
This event is fired every time component has produced or received new chunk of data. Use this event to access the raw stream data. Any modifications you made on data will be passed to comsumers. To modify data without affecting consumers, use onDataAvailable() event. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event |
property onFormatChangeAfter: unavclPipeAfterFormatChangeEvent read f_afterFormatChange write f_afterFormatChange; |
|
This event is fired after new format was applied to a pipe. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event |
property onFormatChangeBefore: unavclPipeBeforeFormatChangeEvent read f_beforeFormatChange write f_beforeFormatChange; |
|
This event is fired before new format is about to be applied to a pipe. Using allowFormatChange parameter it is possible to disable format's applying. NOTE: VCL is NOT multi-threading safe, and you should avoid using VCL routines and classes in this event |
property opt: unsigned read f_opt; |
|
Internal. |
property outBytes[index:int]: int64 read getOutBytes; |
|
Number of bytes produced by the pipe. @param index 0 - sent to consumers; 1 - sent to network |
property position: int64 read getPosition; |
|
Current position in stream (if applicable). |
property providerCount: int read getProviderCount; |
|
Number of providers. |
property providerOneAndOnly: unavclInOutPipe read getProviderOneAndOnly; |
|
Returns first provider of a component (if any). |
property providers[index:int]: unavclInOutPipe read getProvider; |
|
Returns provider. @param index Index of consumer (from 0 to getProviderCount() - 1). @return Provider of a pipe. |
property _consumers: unaObjectList read f_consumers; |
|
List of consumers. |
property _providers: unaObjectList read f_providers; |
|
List of providers. |
(c) 2012 Lake of Soft