TPcxOutputPipe

TPcxOutputPipe collects the data from one or more TPcxOutputStream and directs them towards the physical exit(s) of the associated PCX card.



Properties Methods Events
AutoStart GetClock AfterAllocate
Channel GetInfo AfterRelease
ClockFrequency GetLevel  
Enabled GetPosition  
Handle GetVuMeter  
MaxBitRate Pause  
MaxLevel SetLevel  
MaxStreams Start  
Mode Stop  
MonitoringLevel    
MonitoringMute    
Mute    
Speed    
Status    
StatusAsString    
Stretch    
SupportedFormats    
TimeUnit    

TPcxOutputPipe.AfterAllocate
AfterAllocate happens right after the pipe allocation.

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

property AfterPlay : TPcxPipeEventResult;

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

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

See also
AfterRelease


TPcxOutputPipe.AfterRelease
AfterRelease happens right after the pipe deallocation.

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

property AfterRelease : TPcxPipeEventResult;

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

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

Note
AfterRelease is not called when destroying theTPcxOutputPipe.

See also
AfterAllocate


TPcxOutputPipe.AutoStart
AutoStart allows or not the automatic start of the pipe.

property AutoStart : Boolean;

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

See also
Start, Enabled


TPcxOutputPipe.Channel
Channel specifies the channel number to be given to the pipe.

property Channel : Word;

Description
Channel specifies the channel number to be given to the pipe. If the pipe is in stereo mode, this number will be the left channel.
If Channel = 0, the channel selection is automatic, the first available channel will be allocated to the pipe and Channel gets this number.

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

See also
Enabled, Mode


TPcxOutputPipe.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 allowed :
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 : the sampling frequency is determined by the first operation performed on the pipe,
cfClockLast : the sampling frequency is determined by the last operation performed on the pipe,
cfClockLastSafe : the sampling frequency is determined by the last operation performed on the pipe if there is no stream actually read,
cfClockNo : no sampling frequency defined (default).

Note
Attention, only one quartz pilots all the pipes on a card (Input & Output).
Therefore it is impossible to select different clock frequencies for pipes on the same card.
Any attempt to do this will result in an error ED_SET_CLOCK_IMPOSSIBLE.

See also
GetClock


TPcxOutputPipe.Enabled
Enabled enables or disables the pipe.

property Enabled : Boolean;

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

For a pipe to be used, the Enabled property must be equal to True (default).

See also
AutoStart, Channel, Handle


TPcxOutputPipe.GetClock
GetClock returns the clock type of the pipe.

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

Description
Call GetClock to know the clock type and the sampling frequency of the pipe.
ClockType returns the clock :
C_ANALOG_TYPE : the card internal quartz determines the sampling frequency,
C_DIGITAL_TYPE: the external digital clock determines the sampling frequency (AES/EBU clock),
C_NO_DEFINED_TYPE : Undefined clock type. ClockPresent returns
True if the sampling frequency is determined by a digital clock actually connected,
False if the sampling frequency is determined by a digital clock, but there is no valid signal,
ClockValue returns the sampling frequency or C_CLOCK_FREQ_UNKNOWN if it's not possible to tell this frequency.

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

See also
ClockFrequency


TPcxOutputPipe.GetInfo
GetInfo returns with information 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 information 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 is stopped.
C_PIPE_STARTED : the pipe is started, but no stream is playing or recording.
C_PIPE_BUSY : the pipe is started and one or more streams are actually playing or recording.
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 is temporarily halted (pause).
Mode : mode at which the pipe is working, the following modes are possible :
C_MONO : the pipe works in mono.
C_STEREO : the pipe works in stereo.
NbStream : Actual connected streams to the pipe LowPosition, HighPosition : returns the pipe position expressed in milliseconds or samples according to the TimeUnit property.

If the operation is successful, the GetDigitalLevel method returns True, if not it returns False and a call to the ToolGetLastError function returns an error code generated by PCXtools.

See also
Status


TPcxOutputPipe.GetLevel
GetLevel returns the digital or analog levels of the pipe outputs.

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 outputs.
LevelType specifies the level type to read (digital or analog),
LeftValue returns the left channel level in dB,
RightValue returns the right channel level in dB.

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

See also
SetLevel


TPcxOutputPipe.GetPosition
GetPosition returns the current position of the pipe.

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

GetPosition returns the current position of the pipe expressed in :
Milliseconds is the property TimeUnit = TimeMS Samples if the property TimeUnit = TimeSample.

The Start method restarts the position counter at 0.

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

See also
Start, TimeUnit


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

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

See also
TPcxVuMeters


TPcxOutputPipe.Handle
The Handle property returns the handle number of the pipe.

property Handle : Pipe_Type;

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

Attention, the Enabled property modifies the Handle value.

See also
Enabled


TPcxOutputPipe.MaxBitRate
MaxBitRate determines the maximum amount of bits per second that can flow through the pipe.

property MaxBitRate : Longint;

Description
MaxBitRate determines the maximum amount of bits per second that can flow through the pipe.
Si MaxBitRate = 0, the maximum value is used according to the supported format(s).

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

See also
SupportedFormats, Enabled


TPcxOutputPipe.MaxLevel
MaxLevel returns the maximum output level of the pipe.

property MaxLevel : Single;

Description
MaxLevel returns the maximum output level of the pipe expressed in dB.

See also
SetLevel, GetLevel


TPcxOutputPipe.MaxStreams
MaxStreams determines the maximum number of streams that can be connected to the pipe.

property MaxStreams : Word;

Description
MaxStreams determines the maximum number of streams that can be connected to the pipe.
How more streams are used how smaller the buffers allocated to the streams will be.

Attention, this property can only be modified when the pipe is disabled (Enabled = False), if the pipe is enabled the modification shall not be accepted and MaxStreams will keep his previous value.
Note

Note
This property is checked when allocating the pipe (see the Enabled property).
The PCX driver uses this value when performing memory allocation. To optimize the resources, it's important to adjust this parameter bearing in mind the formats to be supported.

See also
Enabled


TPcxOutputPipe.Mode
Mode determines if the pipe works 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 set to stereo, 2 channels are associated to it. If Mode = moMono, the pipe is set to mono, 1 channel is associated to it.

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

See also
Enabled


TPcxOutputPipe.MonitoringLevel
The MonitoringLevel property specifies or returns the monitoring sound level.

property MonitoringLevel : Single;

Description
This property specifies or returns the monitoring sound level on the pipe.

See also
MonitoringMute


TPcxOutputPipe.MonitoringMute
MonitoringMute returns or modifies the mute state of the pipe monitoring.

property MonitoringMute : Boolean;

Description
This property returns or modifies the mute state of the pipe monitoring.
If Mute = True, the monitoring is silent.
If Mute = False, the monitoring is not silent.

See also
MonitoringLevel


TPcxOutputPipe.Mute
Mute returns or modifies the mute state of the pipe.

property Mute : Boolean;

Description
This property returns or modifies the mute state of the pipe.
If Mute = True, the pipe is silent.
If Mute = False, the pipe is not silent.

See also
GetLevel, SetLevel


TPcxOutputPipe.Pause
Pause halts temporarily the pipe.

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

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

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

See also
Start, Stop


TPcxOutputPipe.SetLevel
SetLevel modifies the digital and analog levels of the pipe outputs.

TLevelType = (leDigital,leAnalog,leNotDefined)

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

Call SetLevel to modify the digital and analog levels of the pipe outputs.
LevelType specifies the level type to be modified (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, if not as False and a call to the ToolGetLastError function returns the error code generated by PCXtools.

See also
GetLevel


TPcxOutputPipe.Speed
Speed modifies or returns the pipe playback speed..

property Speed : Single;

Description
Speed modifies or returns the pipe playback speed. A negative value will reverse the playback direction.
The allowed values are going from -7.0 to +7.0
If Speed = 0, the pipe will stop.
If Speed = 0.5 the pipe plays at half-speed.
If Speed = 1, the pipe plays at normal speed.
If Speed = -0.5 the pipe plays at half speed but reversed
If Speed = -1, the pipe plays reversed at normal speed.

This property is used to modify the length of a sound, his tone varies with the speed. Attention, all the streams connected to the pipe are concerned.

See also
Stretch


TPcxOutputPipe.Start
Start starts the pipe.

function Start : Boolean; override;

Description
Call Start to start the pipe, all the streams on hold will start also.
A stream on hold, is a stream that has been initialized by the PcxOuputStream.Load or PcxOutputStream.Play methods.
Attention, Start reinitializes the time counter returned by GetPosition.

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

See also
Stop, Pause


TPcxOutputPipe.Status
Status returns the current pipe status.

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 is playing or recording.
C_PIPE_BUSY : the pipe is started and one or more streams are actually playing or 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


TPcxOutputPipe.StatusAsString
Status returns the current pipe status as a character string (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 is playing or recording.
'Pipe busy' : the pipe is started and one or more streams are actually playing or recording.
'Pipe underrun' : the pipe under runs, the pipe status keeps this value as long it hasn't been read.
'Pipe paused' : the pipe is temporarily stopped (pause).

See also
Status,GetInfo


TPcxOutputPipe.Stop
Stop stops the pipe.

function Stop : Boolean; override;

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

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

See also
Start, Pause


TPcxOutputPipe.Stretch
Stretch modifies or returns the time stretching value applied to the pipe.

property Stretch : Single;

Description
Stretch modifies or returns the time stretching value applied to the pipe. The allowed values are from 0.8 to 1.2.
If Stretch = 1, the pipe plays the normal time length.
If Stretch = 1.2, the pipe stretches the time length to 120% of the original time.
If Stretch = 0.8, the pipe stretches the time length to 80% of the original time.

This property is used to modify the time length of a sound without changing his tone. Attention, all connected streams to the pipe are affected.

See also
Speed


TPcxOutputPipe.SupportedFormats
SupportedFormats specifies the format 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 played on the pipe.
The elements that can included in the SupportedFormats property 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 for the pipe allocation (see the Enabled property).
The PCX driver uses this value for his memory allocations. To optimize the resources, it's important to adjust this parameter keeping in mind the formats to be supported.

See also
MaxBitRate, Enabled


TPcxOutputPipe.TimeUnit
TimeUnit determines the time unit to be used.

TTimeUnit = (tiMS,tiSample);

property TimeUnit : TTimeUnit;

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

See also
GetPosition