TPcxInputPipe

TPcxInputPipe collects the data coming from the associated channel(s) and directs them towards the PcxInputStream object connected to it.

Propriétés Méthodes Evénements
AutoStart GetClock AfterAllocate
Channel GetInfo AfterRelease
ClockFrequency GetLevel  
Enabled GetPosition  
Handle GetVuMeter  
MaxBitRate Pause  
Mode SetLevel  
Status Start  
StatusAsString Stop  
SupportedFormats    
TimeUnit    


TPcxInputPipe.AfterAllocate
AfterAllocate happens right after the pipe allocation.

TPcxPipeResultEvent = procedure(Sender: TObject; Success : Boolean) of object;

property AfterPlay : TPcxPipeEventResult;

Description
Use AfterAllocate to perform a particular action right after the pipe allocation.
The Success parameter returns the result of the operation :
True : the allocation was done correctly.
False : the allocation failed.

This event is synchronous, it is not released by a windows message.

See also
AfterRelease


TPcxInputPipe.AfterRelease
AfterRelease happens right after the deallocation of the pipe.

TPcxPipeResultEvent = procedure(Sender: TObject; Success : Boolean) of object;

property AfterRelease : TPcxPipeEventResult;

Description
Use AfterRelease to perform a particular action right after the deallocation of the pipe.
The Success parameter returns the result of the operation :
True : the deallocation was done correctly.
False : the deallocation failed.

This event is synchronous, it is not released by a windows message.

Note
AfterRelease is not called when destroying the TPcxInputPipe.

See also
AfterAllocate


TPcxInputPipe.AutoStart
AutoStart allows or refuses the auto startup of the pipe.

property AutoStart : Boolean;

Description
AutoStart = True, the pipe starts automatically when allocated (Enabled = True).
AutoStart = False, a call to the Start method is necessary to start the pipe.

See also
Start, Enabled


TPcxInputPipe.Channel
Channel specifies the channel number allocated to the pipe.

property Channel : Word;

Description
Channel specifies the number of the mono-channel to allocate to the pipe. If the pipe is in stereo mode, this number will be the left channel.
If Channel = 0, the allocation will be automatic, the first available channel will be allocated to the pipe and Channel will get this number.

Note
This property is taken in account for for the allocation of the pipe (see the property Enabled).

See also
Enabled, Mode


TPcxInputPipe.ClockFrequency
The ClockFrequency property specifies the sampling frequency of the pipe.

TClockFrequency = (cf8000Hz,cf11025Hz,cf16000Hz,cf22050Hz,cf24000Hz,cf32000Hz,cf44100Hz,cf48000Hz,
cfClockDigital,cfClockFirst,cfClockLast,cfClockLastSafe,cfClockNo);

property ClockFrequency : TClockFrequency;

Description
The ClockFrequency property specifies the sampling frequency of the pipe.
The following values are accepted :
cf8000Hz : 8 kHz (internal quartz),
cf11025Hz : 11.025 kHz (internal quartz),
cf16000Hz : 16 kHz (internal quartz),
cf22050Hz : 22.05 kHz (internal quartz),
cf24000Hz : 24 kHz (internal quartz),
cf32000Hz : 32 kHz (internal quartz),
cf44100Hz : 44.1 kHz (internal quartz),
cf48000Hz : 48 kHz (internal quartz),
cfClockDigitalHz : the sampling frequency is taken from the external digital clock,
cfClockFirst : (not used with TPcxInputPipe),
cfClockLast : (not used with TPcxInputPipe),
cfClockLastSafe : (not used with TPcxInputPipe),
cfClockNo : no defined sampling frequency (default).

Note
Attention please, only one quartz drives all the pipes on one card (Input & Output).
Therefore it's impossible to select different clock frequencies for pipes located on the same card.
Any attempt to do this will give an error ED_SET_CLOCK_IMPOSSIBLE.

See also
GetClock


TPcxInputPipe.Enabled
Enabled allocates or deallocates the pipe.

property Enabled : Boolean;

Description
Enabled = True allocates the pipe.
If the Channel specified by the Channel property is available, it will be associated to the pipe, the property Handle gets the number of the handle of the pipe returned by PCXtools.
Enabled = False deallocates the pipe.
The pipe is stopped and deallocated, it's Channel will be freed and the Handle property gets the value 0.

For the pipe to be usable, the property Enabled must be equal to True (by default).

See also
AutoStart, Channel, Handle


TPcxInputPipe.GetClock
GetClock returns with the clock type of the pipe.

function GetClock(ClockType : Word; ClockPresent : Boolean; ClockValue : DWord) : Boolean;

Description
Call GetClock to know the clock type of the pipe and also his sample frequency.
C_ANALOG_TYPE : the card internal quartz establishes the sample frequency,
C_DIGITAL_TYPE: the external digital clock establishes the sample frequency (AES/EBU clock),
C_NO_DEFINED_TYPE : Undefined clock type.
ClockPresent returns as
True if the sampling speed is determined by a digital clock actually connected,
False if the sampling speed is determined by a digital clock, but there is no valid digital signal,
ClockValue returns with : the sampling frequency C_CLOCK_FREQ_UNKNOWN in case it's impossible to determine the frequency.

If the operation is successful, the method GetClock returns with True, otherwise we get False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
ClockFrequency


TPcxInputPipe.GetInfo
GetInfo returns with informations about the pipe.

function GetInfo(var VueMeterLeft,VueMeterRight,PeakMeterLeft,PeakMeterRight : Single; var Status : Word; var Mode : TPipeMode; var NbStream : Word; var LowPosition,HighPosition : Longint) : Boolean;

Description
Call GetInfo to collect most of the informations available about the pipe.
VueMeterLeft : digital level of the left channel,
VueMeterRight : digital level of the right channel,
PeakMeterLeft : peak of the left channel.
PeakMeterRight : peak of the right channel.
Status : shows the state of the pipe, the following states are possible:
C_PIPE_NOT_ALLOCATED : the pipe is not allocated.
C_PIPE_STOPPED : the pipe has been stopped. C_PIPE_STARTED : the pipe is started, but no stream plays or records.
C_PIPE_BUSY : the pipe is started and one or several streams are actually in play or record mode.
C_PIPE_UNDERRUN : the pipe under runs, the pipe state keeps this value as long it hasn't been read.
C_PIPE_PAUSED : the pipe has been temporarily stopped (pause).
Mode : mode used by the pipe, the following modes are available :
C_MONO : the pipe works in mono.
C_STEREO : the pipe works in stereo.
NbStream : Number of streams actually connected to the pipe LowPosition, HighPosition : returns with the position of the pipe expressed in milliseconds or as samples according to the value of the TimeUnit property.

If the operation succeeds, the GetInfo method returns as True, otherwise it returns as False and a call to the function ToolGetLastError returns the error code generated by PCXtools.

See also
Status


TPcxInputPipe.GetLevel
GetLevel returns with the digital and analog levels of the pipe entries.

TLevelType = (leDigital,leAnalog,leNotDefined);

function GetLevel(LevelType : TLevelType; var LeftValue,RightValue : Single) : Boolean;

Description
Call GetLevel to know the digital or analog levels of the pipe entries.
LevelType specifies the level type to be read (digital or analogical).
LeftValue returns the left channel level expressed in dB.
RightValue returns the right channel level expressed in dB.

If the operation is successful, the method GetLevel returns as True, otherwise it returns as False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
SetLevel


TPcxInputPipe.GetPosition
GetPosition returns with the elapsed time count since the pipe as been started.

function GetPosition(var LowPosition,HighPosition : Longint) : Boolean;

Description
GetPosition returns with the elapsed time count since the pipe as been started expressed in : Milliseconds if the property TimeUnit = TimeMS Samples if the property TimeUnit = TimeSample. The method Start restarts the position counter at 0.

If the operation is successful, the GetPosition method returns as True, otherwise as False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
Start, TimeUnit


TPcxInputPipe.GetVuMeter
GetVuMeter returns with the instant digital levels of the pipe.

function GetVuMeter(var VueMeterLeft,VueMeterRight,PeakMeterLeft,PeakMeterRight : Single) : Boolean;

Description
GetVuMeter returns with the instant digital levels of the pipe expressed in dB.
VueMeterLeft : level of the left channel,
VueMeterRight : level of the right channel,
PeakMeterLeft : peak of the left channel
PeakMeterRight : peak of the right channel.

If the operation succeeds, the method GetVuMeter returns as True, otherwise as False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
TPcxVuMeters


TPcxInputPipe.Handle
The Handle property returns with the number of the pipe handle.

property Handle : Pipe_Type;

Description
This property is a read-only feature, the value of the handle is automatically determined when allocating the Pipe. Use this handle to call directly the API PCXtools functions.

Pay attention, the property Enabled modifies the value of the Handle.

See also
Enabled


TPcxInputPipe.MaxBitRate
MaxBitRate determines the maximum number of bits per second that can flow through the pipe.

property MaxBitRate : Longint;

Description
MaxBitRate determines the maximum number of bits per second that can flow through the pipe.
If MaxBitRate = 0, the maximum value is used in accordance with the supported format(s).

Note
This property is taken in account when allocating the pipe (see property Enabled).
The PCX driver uses this value for it's memory allocations. To optimize the resources, it's important to adjust this parameter taking in account the throughput that will be used.

See also
SupportedFormats, Enabled



TPcxInputPipe.Mode
Mode determines if the pipe works in mono or stereo.

TPipeMode = (moMono,moStereo);

property Mode : TPipeMode;

Description
This property returns or modifies the functioning mode of the pipe.
If Mode = moStereo, the pipe is working stereo, 2 channels are joined to it.
If Mode = moMono, the pipe is working mono, 1 channel is joined to it.

Note
This property is associated when allocating the pipe (see the property Enabled).

See also
Enabled


TPcxInputPipe.Pause
Pause stops temporarily the pipe.

function Pause(Value : Boolean) : Boolean; override;

Description
Use Pause to halt temporarily the pipe, all the streams connected to this pipe will stop also.
Value = True, the pipe stops,
Value = False, the pipe restarts.
Note that when the pipe is temporarily stopped, the GetPosition method returns the last position before the pause, the time counting will start again as soon the pipe restarts.

If the operation is successful, the Pause method returns True, otherwise it returns False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
Start, Stop


TPcxInputPipe.SetLevel
SSetLevel modifies the levels of the pipe entries.

TLevelType = (leDigital,leAnalog,leNotDefined)

function SetLevel(LevelType : TLevelType; LeftValue,RightValue : Single) : Boolean;

Description
Call SetLevel to modify the digital and analog levels of the pipe entries.
LevelType specifies the level type to modify (digital or analog),
LeftValue modifies the left channel level (expressed in dB),
RightValue modifies the right channel level (expressed in dB).

If the operation is successful, the SetLevel method returns True, otherwise it returns False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
GetLevel


TPcxInputPipe.Start
Start starts the pipe.

function Start : Boolean; override;

Description
Call Start to start the pipe, all the streams waiting to be recorded will also start.
A stream in a waiting state, is a stream that has been initialized by the Rec method.
Attention, Start reinitializes the time counter that was returned by GetPosition.

If the operation is successful, the Start methods returns True, otherwise it returns False and a call to theToolGetLastError function returns the error code generated by PCXtools.

See also
Stop, Pause, AutoStart


TPcxInputPipe.Status
Status returns the current pipe state.

property Status : Word;

Description
Status returns the following values :
C_PIPE_NOT_ALLOCATED : the pipe is not allocated.
C_PIPE_STOPPED : the pipe is stopped.
C_PIPE_STARTED : the pipe is started, but no stream records.
C_PIPE_BUSY : the pipe is started and a stream is actually busy recording.
C_PIPE_UNDERRUN : the pipe under runs, the pipe status keeps this value as long it hasn't been read.
C_PIPE_PAUSED : the pipe is temporarily stopped (pause).

See also
GetInfo, StatusAsString


TPcxInputPipe.StatusAsString
Status returns the current pipe state as a character string.

property StatusAsString : string;

Description
StatusAsString returns the following messages :
'Pipe not allocated' : the pipe is not allocated.
'Pipe stopped' : the pipe is stopped.
'Pipe started' : the pipe is started, but no stream records.
'Pipe busy' : the pipe is started and a stream is actually busy recording.
'Pipe underrun' : the pipe under runs, the pipe status keeps this value as long it has not been read.
'Pipe paused' : the pipe is temporarily stopped (pause).

See also
Status, GetInfo


TPcxInputPipe.Stop
Stop stops the pipe.

function Stop : Boolean; override;

Description
Call Stop to stop the pipe, all the connected streams to this pipe will also stop.

If the operation is successful, the Stop method returns True, otherwise it returns False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
Start, Pause


TPcxInputPipe.SupportedFormats
SupportedFormats specifies the formats supported by this pipe.

TStreamFormats = set of (Mpeg_I,Mpeg_II,Linear_8,Linear_16,Linear_24);

property SupportedFormats : TStreamFormats;

Description
The SupportedFormats property determines the format types that can be recorded on the pipe. The elements that you can be included in the SupportedFormats set are :
Mpeg_I : Mpeg layer I.
Mpeg_II : Mpeg layer II.
Linear_8 : PCM 8 bits.
Linear_16 : PCM 16 bits (INTEL or MOTOROLA).
Linear_24 : PCM 24 bits (not yet supported).

Note
This property is taken in account when allocating the pipe (see the Enabled property).
The PCX driver uses this value for his memory allocations. For an optimal use of the resources, it's important to adjust this parameter in function of the formats to support.

See also
MaxBitRate, Enabled


TPcxInputPipe.TimeUnit
TimeUnit determines the time unit measure to be used.

TTimeUnit = (tiMS,tiSample);

property TimeUnit : TTimeUnit;

Description
TimeUnit determines the time unit measure to be used by the GetPosition method,
If TimeUnit = TimeMS, GetPosition returns the current If TimeUnit = TimeSample, GetPosition returns the current position as samples.

See also
GetPosition