TPcxInputStream
TPcxInputStream gets the data coming from the PcxInputPipe object he is connected to and records them in the file specified by the FileName property.
It's not possible to connect more than one PcxInputStream object to a PcxInputPipe object.
TPcxInputStream.AfterRecord
AfterRecord happens right after the execution of the Rec method.
TPcxStreamEventResult = procedure(Sender: TObject; Success : Boolean) of object;
property AfterRecord : TPcxStreamEventResult;
Description
Use AfterRecord to execute a particular action right after the call to the Rec method.
The parameter Success returns the result of the operation :
True : the Rec method has been correctly executed.
False : the Rec method failed.
This event is synchronous, it is not released by a windows message.
See also
BeforeRecord, BeforeStop, AfterStop

TPcxInputStream.AfterStop
AfterStop happens right after the execution of the Stop method.
TPcxStreamEventResult = procedure(Sender: TObject; Success : Boolean) of object;
property AfterStop : TPcxStreamEventResult;
Description
Use AfterStop to execute a particular action right after a call to the Stop method.
The Success parameter returns the result of the operation :
True : the Stop method was correctly executed.
False : the Stop method failed.
This event is synchronous, it is not released by a windows message.
See also
BeforeStop, AfterRecord, BeforeRecord

TPcxInputStream.BeforeRecord
BeforeRecord happens right before the execution of the Rec method.
TPcxStreamEvent = procedure(Sender: TObject) of object;
property BeforeRecord : TPcxStreamEvent;
Description
Use BeforeRecord to execute a particular action right before a call to the Rec method.
This event is synchronous, it is not released by a windows message.
See also
AfterRecord, BeforeStop, AfterStop

TPcxInputStream.BeforeStop
BeforeStop happens right before the execution of the Stop method.
TPcxStreamEvent = procedure(Sender: TObject) of object;
property BeforeStop : TPcxStreamEvent;
Description
Use BeforeStop to executer a particular action right before a call to the Stop method.
This event is synchronous, it is not released by a windows message.
See also
AfterStop, AfterRecord, BeforeRecord

TPcxInputStream.ElapseTimeAsMS
The ElapseTimeAsMS property returns the elapsed time in milliseconds since the start of the stream.
property ElapseTimeAsMS : DWord;
Description
This read-only property, returns the elapsed time in milliseconds since the start of the stream.
If the stream is BUSY, ElapseTimeAsMS returns a value different from 0, in all other cases this value is equal to 0.
See also
ElapseTimeAsSeconds, ElapseTimeAsSamples

TPcxInputStream.ElapseTimeAsSamples
The ElapseTimeAsSamples property returns the elapsed time as samples since the start of the stream.
property ElapseTimeAsSamples : DWord;
Description
This read-only property, returns the elapsed time as samples since the start of the stream.
If the stream is BUSY ElapseTimeAsSamples returns a value different from 0, in all other cases this is equal to 0.
See also
ElapseTimeAsMS, ElapseTimeAsSeconds

TPcxInputStream.ElapseTimeAsSeconds
The ElapseTimeAsSeconds property returns the elapsed time is seconds since the start of the stream.
property ElapseTimeAsSeconds : Single;
Description
This read-only property, returns the elapsed time in seconds since the start of the stream.
If the stream is BUSY ElapseTimeAsSeconds returns a value different from 0, in all other cases this value is equal to 0.
See also
ElapseTimeAsMS, ElapseTimeAsSamples

TPcxInputStream.EndPos
EndPos specifies the maximum duration of the recording.
property EndPos : DWord;
Description
EndPos specifies the maximum duration of the recording expressed in PosUnit. The recording stops automatically at EndPos or before the Stop method is called.
See also
PosUnit

TPcxInputStream.FileName
The FileName property specifies the name of the audio file where the received data by the stream have to be stocked.
property FileName : String;
Description
This property returns or specifies the name of the audio file where the received data by the stream have to be stocked.
See also
Prepare, Rec

TPcxInputStream.GetInfo
GetInfo returns with information collected on the stream.
function GetInfo(var ElapseTime,RemainTime : DWord; var FileName : string; LoopFlag : Boolean) : Boolean;
Description
Use GetInfo to collect most of the information available on the stream.
Elapsetime : elapsed time since the start of the stream expressed in (see ToolSetTimeUnit).
RemainTime : remaining time to play on the stream expressed in (see ToolSetTimeUnit).
FileName : Filename being read.
LoopFlag : Loop state.
True : the stream is going into a loop.
False : the stream won't go into a loop.
If the operation succeeds, the GetInfo method returns True, if not as False and a call to the ToolGetLastError function returns the error code generated by PCXtools.
See also
Status, StatusAsString

TPcxInputStream.GetPositionAsMS
GetPositionAsMS returns the current position of the stream expressed in milliseconds.
function GetPositionAsMS(var ElapseTime,RemainTime : DWord) : Boolean; override;
Description
GetPositionAsMS returns the current position of the stream :
ElapseTime : elapsed time since the start of the stream.
RemainTime : remaining time before halting the stream. If the recording time is not predefined by the EndPos property. RemainTime returns 0.
If the operation succeeds, the GetPositionAsMS method returns True, if not it returns False and a call to ToolGetLastError function returns the error code generated by PCXtools.
See also
ElapseTimeAsMS, EndPos

TPcxInputStream.GetPositionAsSamples
GetPositionAsSamples returns the current stream position expressed as samples.
function GetPositionAsSamples(var ElapseTime,RemainTime : DWord) : Boolean; override;
Description
GetPositionAsSamples returns the current stream position :
ElapseTime : elapsed time since the start of the stream.
RemainTime : time remaining before stopping the stream. If the recording time is not predefined by EndPos property RemainTime returns 0.
If the operation succeeds, the GetPositionAsSamples method returns True, if not it returns False and a call to ToolGetLastError function returns the error code generated by PCXtools.
See also
ElapseTimeAsSamples

TPcxInputStream.Handle
The Handle property returns the number of the stream handle.
property Handle : Stream_Type;
Description
This property is read mode only, the handle value is automatically determined at the connection of the stream to the pipe (see the InputPipe) property.
If Handle = 0, the stream is not connected to the pipe.
The Handle value is not determined by PCXtools, Delphi ToolBox for PCX uses an internal mechanism to attribute the handles to the streams.
Use this handle to call directly the API PCXtools functions.
See also
InputPipe
TPcxInputStream.Initialized
The Initialized property returns the readiness state of the stream for recording.
property Initialized : Boolean;
Description
This property,in read only, returns as True if the Load method has been executed, in other words if the stream is ready to record.
See also
Rec, Status

TPcxInputStream.InputPipe
The InputPipe property specifies the pipe from which the stream gets data.
property InputPipe : TPcxInputPipe;
Description
This property specifies or returns, the pipe from which the stream gets the data. If the pipe is destroyed, this property returns nil.
Attention, InputPipe modifies the value of the Handle property.
See also
Handle, TPcxInputPipe

TPcxInputStream.NotifyBeforeEnd
The NotifyBeforeEnd property determines at what time the OnEndStream event must be released.
property NotifyBeforeEnd : DWord;
Description
The NotifyBeforeEnd property determines at what time the OnEndStream event must be released. The release of the event is computed dealing with the end of the stream. This property is only dealt with in case that the stream records a predetermined time span (see the EndPos property).
Example : if NotifyBeforeEnd = 5000, the OnEndStream event will be released 5 seconds before the end of the stream.
Note
The mechanism of asynchronous events installed by Delphi ToolBox for PCX distributes automatically the messages to the streams, ToolSetMsgNotify can't do this actually.
See also
OnEndStream, EndPos

TPcxInputStream.OnBeginFile
OnBeginFile occurs every time that a file starts to be recorded.
TPcxStreamEvent = procedure(Sender: TObject) of object;
property OnBeginFile : TPcxStreamEvent;
Description
Use OnBeginFile to execute a particular action at each startup of a file recording.
This event is asynchronous, it is released by the C_TELL_BEGIN_FILE message posted by PCXtools.
Note
The mechanism of asynchronous events installed by Delphi ToolBox for PCX distributes automatically the messages to the streams, ToolSetMsgNotify can't do this actually.
See also
OnCloseFile, OnEndStream, OnError

TPcxInputStream.OnCloseFile
OnCloseFile occurs every time that a file recording is finished.
TPcxStreamEvent = procedure(Sender: TObject) of object;
property OnCloseFile : TPcxStreamEvent;
Description
Use OnCloseFile to execute a particular action at each end of file recording.
This event is asynchronous, it is released by the C_TELL_CLOSE_FILE messages posted by PCXtools.
Note
The mechanism of asynchronous events installed by Delphi ToolBox for PCX distributes automatically the messages to the streams, ToolSetMsgNotify can't do this actually.
See also
OnBeginFile, OnEndStream, OnError

TPcxInputStream.OnEndStream
OnEndStream occurs every time that the stream ends.
TPcxStreamEvent = procedure(Sender: TObject) of object;
property OnEndStream : TPcxStreamEvent;
Description
Use OnEndStream to execute a particular action every time that the stream ends.
By modifying the NotifyBeforeEnd, property you can change the moment that this event will start and occurs.
This event is asynchronous, it is released by the C_TELL_BEFORE_END_STREAM message posted by PCXtools.
Note
The mechanism of asynchronous events installed by Delphi ToolBox for PCX distributes automatically the messages to the streams, ToolSetMsgNotify can't do this actually.
See also
NotifyBeforeEnd, OnBeginFile, OnCloseFile, OnError

TPcxInputStream.OnError
OnError occurs every time that PCXtools detects an error.
TPcxStreamEvent = procedure(Sender: TObject) of object;
property OnError : TPcxStreamEvent;
Description
Use OnError to detect the errors generated by PCXtools.
This event is asynchronous, it is released by the C_TELL_ERROR_RUNTIME message posted by PCXtools.
Note
The mechanism of asynchronous events installed by Delphi ToolBox for PCX distributes automatically the messages to the streams, ToolSetMsgNotify can't do this actually.
See also
OnBeginFile, OnCloseFile, OnEndStream

TPcxInputStream.OverwriteMode
The OverwriteMode property allows or refuses the overwrite of a file to be saved if it already exists.
TOverwriteMode = (ovSafe,ovErase);
property OverwriteMode : TOverwriteMode;
Description
This property allows or refuses the overwrite of a file to be saved if it already exists.
The possible values are :
ovSafe : an error returns if the file already exists.
ovErase : the destination file will be overwritten even if it already exists.
See also
Rec, Prepare, FileName

TPcxInputStream.Pause
Pause halts temporarily the stream.
function Pause(Value : Boolean) : Boolean; override;
Description
Use Pause to halt temporarily the stream.
If Value = True, the stream halts, if Value = False, the stream restarts.
Note that when the stream is temporally halted, the ElapseTime and RemainTime properties return the last position before the pause, the time count will start again as soon the stream restarts.
If the operation is successful, the Pause method returns True, else it returns False and a call to the ToolGetLastError function returns the error code generated by PCXtools.
See also
Stop, Prepare, Rec

TPcxInputStream.PosUnit
PosUnit determines the unit used when the StartPos and EndPos properties will be computed.
TPosUnit = (poByte,poMS,poSample);
property PosUnit : TPosUnit;
Description
PosUnit determines the unit used when the StartPos and EndPos properties will be computed.
The values are :
poByte : the time unit is the byte.
poMS : the time unit is the milliseconds.
poSample : the time unit is the sample.
See also
EndPos

TPcxInputStream.Prepare
The Prepare method gets the Stream ready for recording.
function Prepare : Boolean; override;
Description
Use Prepare to have the stream for recording. Prepare initializes the stream with the information found in the RecordFormat property. A call to the Rec method is necessary to start the recording.
If the operation is successful, the Prepare method returns True, if not it returns False and a call to the ToolGetLastError function returns an error code generated by PCXtools.
See also
Rec, RecordFormat, Start

TPcxInputStream.Rec
The Rec method prepares the Stream and starts the recording.
function Rec : Boolean; override;
Description
Use Rec to prepare the stream and start the recording. Rec initializes the stream with information found in the RecordFormat property.
If the operation is successful, the Rec method returns True, if not it returns False and a call to the ToolGetLastError function returns the error code generated by PCXtools.
See also
Prepare, RecordFormat, Start, Pause

TPcxInputStream.RecordFormat
Example
The RecordFormat property describes the format of the next file to record.
property RecordFormat : TPcxSoundFormat;
Description
This property describes the format of the next file to record.
See also
TPcxSoundFormat

TPcxInputStream.Status
Status returns the current state of the stream.
property Status : Integer;
Description
Status returns the following values :
C_STREAM_NOT_CONNECTED : the stream is not connected to a pipe (Attention, this state doesn't exist in PCXtools).
C_STREAM_NOT_AVAILABLE : the stream is not valid.
C_STREAM_FREE : the stream is ready and waiting for a command.
C_STREAM_INITIALIZED : the stream has been initialized by a Rec command.
C_STREAM_BUSY : the stream records a sound.
C_STREAM_UNDERRUN : the stream was not able to catch up with the speed while recording. Attention, the stream status keeps this value as long it hasn't been read.
C_STREAM_PAUSED : the stream is temporally halted (pause).
See also
GetInfo, StatusAsString

TPcxInputStream.StatusAsString
StatusAsString returns the current stream state as a character string (string).
property StatusAsString : string;
Description
StatusAsString returns the following messages :
'Stream not connected' : the stream is not connected to a pipe (Attention, this state doesn't exist in PCXtools).
'Stream not available' : the stream is not valid.
'Stream free' C_STREAM_FREE : the stream is not ready and waiting for a command.
'Stream initialized' C_STREAM_INITIALIZED : the stream has been initialized by a Rec command.
'Stream busy' : the stream records a sound.
'Stream underrun' : the stream was not able to catch up with the speed during the recording. Attention, the stream status keeps this value as long it hasn't been read.
'Stream paused' : the stream is temporally halted (pause).
See also
Status, GetInfo

TPcxInputStream.Stop
Stop stops the stream.
function Stop : Boolean; override;
Description
Call the Stop method to stop the recording stream.
If the stream is already stopped, the Stop method doesn't do anything.
If the operation is successful, the Stop method returns True, if not it returns False and a call to the ToolGetLastError function returns the error code generated by PCXtools.
See also
Prepare, Rec, Pause